Description
What happens
On tip 5264d34b (after #1312), MCP demo / plan / algorithm_spec / diagnose already rewrite host-facing next and recommendations into Path A tool language. MCP describe_algorithm and list_algorithms still return the shared Algorithm.describe() run field untouched, so a host is told to run a CLI recipe it may not have.
After MCP describe_algorithm("gepa") (and on each row of list_algorithms), run is:
agentdescent algorithms run gepa <your-prompt.txt> <your-cases.jsonl> --model <model> [--base-url <url>]
The same leftover-surface class as #1307 / #1309 / #1311, now for the card run recipe a host reads before calling algorithm_spec. The CLI algorithms show / algorithms show --json wording stays correct for an operator who has the CLI.
Repro
Fresh clone of ThinkFlowLab/agentdescent at 5264d34b49909a03d2daf2e16fda41433a0b1dcb. pip install -e ".[mcp]". No provider key is required.
from agentdescent.mcp import Tools
from agentdescent.algorithms import get
# Tools.describe_algorithm currently returns get(name).describe() unchanged
r = Tools(None).describe_algorithm("gepa")
# r["run"] starts with "agentdescent algorithms run gepa "
# Tools(None).list_algorithms()["algorithms"] carry the same CLI recipe
# CLI: agentdescent algorithms show gepa --json still names that recipe, which is intended
assert get("gepa").describe()["run"] == r["run"]By contrast, MCP demo already says call algorithm_spec with the name, their path and cases, and model and base_url (never guess those), not agentdescent algorithms run.
Expected
- After MCP
describe_algorithmand on eachlist_algorithmscard,runnamesalgorithm_specwith the card's name, the same path placeholder the CLI recipe uses,cases=<your-cases.jsonl>, and model and base_url (never guess those). It must not start withagentdescent algorithms runor name--model/--base-urlflags. - Other card fields (name, summary, kinds, fidelity, surface, params, research_port, fidelity_note) stay the same.
- The CLI
algorithms show/algorithms show --jsonrunstays on the CLI recipe (agentdescent algorithms run … --model <model> [--base-url <url>]).Algorithm.describe()itself is unchanged. - No model name is guessed. The tools still do not start a run or write a spec by themselves.
Suggested fix
- In
agentdescent/mcp.py(Tools.describe_algorithmandTools.list_algorithms), afterdescribe(), rewriteruninto the tool language above. Do not changealgorithms.py(those strings are still correct for the CLI). - Mention the tool-language
runin thedescribe_algorithmandlist_algorithmstool descriptions. - Pin this in a focused MCP test (keep the CLI pins in
tests/test_algorithms.py). changelog.d/<n>-mcp-describe-run.md.
Acceptance
- MCP
describe_algorithm("gepa")returnsrunthat namesalgorithm_spec,name=gepa,path=<your-prompt.txt>, and model and base_url, with noagentdescentand no--model/--base-url. - MCP
describe_algorithmforevoskill/archive_selectionkeeps the same path placeholders as the CLI (<your-skill-dir>/<path>). - MCP
list_algorithmsrows matchdescribe_algorithmfor the same name. - CLI
algorithms show --jsonstill usesagentdescent algorithms run … --model <model> [--base-url <url>]. pytest -q -o addopts='' tests/test_mcp_describe_run.py tests/test_algorithms.py tests/test_mcp.pypasses, including the new pins.
Activity