Skip to content

mcp: demo next still names CLI verbs, not Path A tools #1307

Done

Description

@Birfy

What happens

On tip f9c35b5 (after #1306), MCP algorithm_spec and plan already rewrite next into host tool language (#1296 / #1298 / #1303 / #1305). MCP demo still returns the CLI demo --json list untouched.

After a successful demo(algorithm="gepa"), next is:

agentdescent show  <run_id>
agentdescent apply <run_id> --dry-run
agentdescent algorithms run gepa <your-skill-dir> <your-cases.jsonl> --model <model> [--base-url <url>] --rounds 1 --workers 1 --out spec.json
agentdescent plan spec.json --probe
agentdescent evolve spec.json --max-calls <N>
agentdescent doctor

tests/test_mcp.py currently pins the algorithms run line. A host that followed algorithm_spec or plan next would call those tools; a host that followed this demo next is told to run CLI verbs it may not have (algorithms run, init, plan --probe, evolve), instead of show, apply(..., dry_run=true), and algorithm_spec (whose own next already names plan(..., probe=true) and a capped start).

The same leftover shows up when demo refuses a real-model-only card: the error still says to run agentdescent algorithms run … --model <model> [--base-url <url>] and agentdescent algorithms show.

This is the same leftover-surface class as #1296 / #1299 / #1303 / #1305, now for MCP demo.

Repro

Fresh clone of ThinkFlowLab/agentdescent at f9c35b5e38106ff7818a4500e30e0a920cc61517. pip install -e ".[mcp]". Isolated AGENTDESCENT_HOME. No network is required: the packaged offline demo needs no provider key.

from agentdescent.mcp import Tools

r = Tools(None).demo(algorithm="gepa")
# r["ok"] is True, r["run_id"] exists
# r["next"] contains "agentdescent algorithms run gepa …"
# and "agentdescent plan spec.json --probe"
# and "agentdescent evolve spec.json --max-calls <N>"

A default demo() (no algorithm) likewise names agentdescent init and the CLI plan/evolve lines. By contrast, a successful algorithm_spec already returns an MCP plan(..., probe=true) then capped start next, not a CLI command.

Expected

  • After MCP demo finishes a run, next should be a short list in tool language, for example: call show with this run_id; call apply with this run_id and dry_run=true to preview the write; then, when an algorithm was named, to run this card on the user's data, call algorithm_spec with the name, their path and cases, and model and base_url (never guess those), plus rounds=1 and workers=1; if that refuses, follow its next and do not start; otherwise follow its next. When no algorithm was named, the last step should send the host through list_algorithms and then that same algorithm_spec call (there is no MCP init tool). It must not say agentdescent show, algorithms run, init, plan, or evolve.
  • When MCP demo refuses a real-model-only card, the error should name algorithm_spec (and describe_algorithm for parameters) with model / base_url, and must not say agentdescent algorithms run or algorithms show. No model name is guessed.
  • The CLI demo / demo --json next list, and the CLI live-model refusal, stay on the CLI verbs (including --model / --base-url). MCP algorithm_spec / plan next lines are unchanged.
  • The tool still does not start a real run or probe. apply is only named with dry_run=true.

Suggested fix

  • In agentdescent/mcp.py (Tools.demo), after the shared demo_payload returns, rewrite next into the MCP list above. On a SpecError whose message tells the host to run agentdescent algorithms run, rewrite that sentence into tool language. Do not change demo_payload (those strings are still correct for the CLI).
  • Pin this in tests/test_mcp.py (replace the current CLI algorithms run pins on the MCP path; keep the CLI pins in tests/test_demo.py).
  • Mention the tool-language next in the demo tool description.
  • changelog.d/<n>-mcp-demo-next.md.

Acceptance

  • MCP demo(algorithm="gepa") (and evoskill) returns ok: true and a next list that names show, apply with dry_run=true, and algorithm_spec, with no agentdescent CLI verbs and no start / evolve / init.
  • MCP demo() with no algorithm names list_algorithms then algorithm_spec in that last step, not init.
  • MCP demo on a real-model-only card returns ok: false and an error that names algorithm_spec / describe_algorithm, not agentdescent algorithms run / show.
  • CLI demo --json next still starts with agentdescent show and still names algorithms run or init, plan --probe, and evolve --max-calls.
  • pytest -q -o addopts='' tests/test_mcp.py tests/test_demo.py tests/test_mcp_algorithm_spec.py tests/test_mcp_plan_probe.py tests/test_first_run_caps.py passes, including the new pins.

Activity

  1. added
    bug
    area:plugins
    area:cli
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:pluginsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions