Skip to content

mcp: describe_algorithm and algorithm_spec name/kind refusals still name CLI algorithms list / run #1321

Done

Description

@Birfy

What happens

On tip 37d03875 (after #1320), MCP describe_algorithm / list_algorithms already rewrite each card's run into algorithm_spec with model and base_url, and placeholder / plan / apply / diagnose refusals already speak Path A tools. The leftover a host actually reads is the name and kind refusal from describe_algorithm and algorithm_spec.

Those errors come from shared _unknown_algorithm_message / kind_mismatch_message (also used by algorithms show / run). MCP returns them almost unchanged, so a host is sent to a CLI it may not have.

Measured with from agentdescent.mcp import Tools on this tip:

Tools(None).describe_algorithm("nope")["error"]
# describe_algorithm: unknown algorithm 'nope'; available: […] (see `agentdescent algorithms list`)

Tools(None).algorithm_spec("nope", prompt)["error"]
# algorithm_spec: unknown algorithm 'nope'; available: […] (see `agentdescent algorithms list`)

# gepa (text-only) on a skill_dir that holds SKILL.md:
# algorithm 'gepa' applies to kind ['text'], not 'skill_dir'; …
#   (agentdescent algorithms list --kind skill_dir);
#   to run gepa on one file, target it as text:
#   agentdescent algorithms run gepa …/SKILL.md --kind text --model <model> [--base-url <url>];
#   … reuse the prompt-inlined cases `agentdescent demo --kind text --dir <dir>` writes

list_algorithms()["note"] also still says Filter with --kind / kind=.

_mcp_gate_wording (#1317 / #1319) does not catch these phrases.

The CLI algorithms show / run wording on the same inputs stays correct for an operator who has the CLI.

Expected

  • MCP describe_algorithm / algorithm_spec unknown-name errors name list_algorithms, not agentdescent algorithms list.
  • A kind-mismatch error names list_algorithms with kind=… when the kind is known, and (when a one-file text retry applies) algorithm_spec with kind=text, path, cases, and model and base_url (never guess those), not CLI algorithms run / init / demo --kind.
  • list_algorithms note filters with the Path A field kind, not CLI --kind.
  • The CLI algorithms show / run / init wording is unchanged.

Suggested fix

  • Rewrite the shared phrases on the MCP path only (_mcp_algorithm_error_wording, applied from describe_algorithm, algorithm_spec, and _mcp_gate_wording). Do not change algorithms/__init__.py or cli.py.
  • Pin this in a focused MCP test beside tests/test_mcp_describe_run.py.
  • changelog.d/<n>-mcp-algorithm-error-wording.md.

Acceptance

  • describe_algorithm("nope") and algorithm_spec("nope", …) errors contain call list_algorithms and do not contain agentdescent algorithms list.
  • algorithm_spec("gepa", skill_dir, …) errors contain list_algorithms with kind=skill_dir and algorithm_spec with kind=text; they do not contain agentdescent algorithms run, --model, or agentdescent demo.
  • CLI algorithms show nope --json still contains (see \agentdescent algorithms list`)`.
  • CLI algorithms run gepa <skill_dir> … --json still contains agentdescent algorithms list --kind skill_dir and agentdescent algorithms run.

Activity

  1. added
    bug
    area:plugins
    area:cli
    on Nov 30, 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