Skip to content

mcp: apply and show refusals still name CLI --to / agentdescent apply #1315

Done

Description

@Birfy

What happens

On tip 105c3a37 (after #1314), MCP demo / plan / algorithm_spec / diagnose / describe_algorithm already rewrite host-facing next, recommendations, and card run into Path A tool language. MCP apply and show still return the shared CLI wording in error / apply_plan / notes, so a host is told flags and a CLI verb it may not have.

Two leftovers a host actually reads:

  1. Applying (or previewing) a text artifact onto a directory. The shared refusal is:
<run_id> evolved a single text artifact and '<dir>' is a directory; pass --to FILE to write it to a file, or read it with `show`

MCP apply / show surface that string unchanged. Path A apply takes the field to, not --to.

  1. MCP apply(run_id, install_to="grok-bot") (and the no-source fallback). The shared grok-bot refusal tells the host to materialize with a CLI command:
First materialize without touching Grok Bot's store: `agentdescent apply <run_id> --to <path>`; then ask Grok Bot to save each file below as a user skill:

or, with no run_id/source:

materialize with `agentdescent apply <run_id> --to <dir>`

The same leftover-surface class as #1307 / #1309 / #1311 / #1313, now for apply/show refusals. The CLI apply / show wording stays correct for an operator who has the CLI. Other apply refusals in the same helpers still name --to / --from / --install-to / --home (destination symlink, policy-slot needs --to PATH, dest mismatch notes).

MCP apply(source=..., install_to="grok-bot") already lists save paths and does not mention the CLI command; only the run_id and empty fallback do.

Repro

Fresh clone of ThinkFlowLab/agentdescent at 105c3a372e3e0104700462ceceff690901fc5baf. pip install -e ".[mcp]". No provider key is required.

from agentdescent.cli import _refuse_text_dest, _grok_bot_apply_message
from agentdescent.mcp import Tools

# The shared helpers still speak CLI:
# str(_refuse_text_dest('RID', '/tmp'))  # raises
#   "... pass --to FILE to write it to a file, or read it with `show`"
# _grok_bot_apply_message(home='/tmp')
#   "... materialize with `agentdescent apply <run_id> --to <dir>` ..."

# Tools.apply / Tools.show return those strings unchanged today
# (apply to a directory dest, or apply(run_id, install_to="grok-bot")).

By contrast, MCP diagnose already says call apply with this run_id and dry_run=true, not agentdescent apply --dry-run.

Expected

  • MCP apply / show refusals name Path A fields (to, from, install_to, home) and Path A tools (apply, show), not CLI flags (--to, --from, --install-to, --home) and not agentdescent apply.
  • A text-artifact-onto-directory refusal on MCP says to pass to set to a file (or read it with show), with no --to FILE.
  • MCP apply(run_id, install_to="grok-bot") tells the host to materialize by calling apply with this run_id and to=<path> (and not install_to=grok-bot), then to ask Grok Bot to save the listed files. It must not contain agentdescent apply or --to.
  • show of a policy_slot run: apply_plan.needs names to, not --to PATH.
  • The CLI apply / show / apply --json wording is unchanged, including --to FILE and the agentdescent apply … --to … grok-bot sentence.
  • The tools still do not write a grok-bot skill store.

Suggested fix

  • In agentdescent/mcp.py (Tools.apply and Tools.show), rewrite the returned error, notes, and apply_plan string fields into the tool language above. Do not change cli.py (those strings are still correct for the CLI).
  • Mention the tool-language refusals in the apply and show tool descriptions.
  • Pin this in a focused MCP test (keep the CLI pins in tests/test_text_kind_dir_target.py and tests/test_skill_library_apply_install.py).
  • changelog.d/<n>-mcp-apply-wording.md.

Acceptance

  • MCP apply onto a directory dest for a text run returns error containing to and not --to FILE / agentdescent.
  • CLI apply --json onto the same dest still contains --to FILE.
  • MCP apply(run_id, install_to="grok-bot") returns error that names apply with to= and has no agentdescent and no --to.
  • CLI apply <run_id> --install-to grok-bot still contains agentdescent apply and --to.
  • MCP show apply_plan strings (needs / error) have no --to / --from / agentdescent.
  • pytest -q -o addopts='' tests/test_mcp_apply_wording.py tests/test_text_kind_dir_target.py tests/test_skill_library_apply_install.py tests/test_mcp.py passes, including the new pins.

Activity

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