Repository navigation
Description
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:
- 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.
- 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/showrefusals name Path A fields (to,from,install_to,home) and Path A tools (apply,show), not CLI flags (--to,--from,--install-to,--home) and notagentdescent apply. - A text-artifact-onto-directory refusal on MCP says to pass
toset to a file (or read it withshow), with no--to FILE. - MCP
apply(run_id, install_to="grok-bot")tells the host to materialize by callingapplywith thisrun_idandto=<path>(and notinstall_to=grok-bot), then to ask Grok Bot to save the listed files. It must not containagentdescent applyor--to. showof apolicy_slotrun:apply_plan.needsnamesto, not--to PATH.- The CLI
apply/show/apply --jsonwording is unchanged, including--to FILEand theagentdescent apply … --to …grok-bot sentence. - The tools still do not write a grok-bot skill store.
Suggested fix
- In
agentdescent/mcp.py(Tools.applyandTools.show), rewrite the returnederror,notes, andapply_planstring fields into the tool language above. Do not changecli.py(those strings are still correct for the CLI). - Mention the tool-language refusals in the
applyandshowtool descriptions. - Pin this in a focused MCP test (keep the CLI pins in
tests/test_text_kind_dir_target.pyandtests/test_skill_library_apply_install.py). changelog.d/<n>-mcp-apply-wording.md.
Acceptance
- MCP
applyonto a directory dest for a text run returnserrorcontainingtoand not--to FILE/agentdescent. - CLI
apply --jsononto the same dest still contains--to FILE. - MCP
apply(run_id, install_to="grok-bot")returnserrorthat namesapplywithto=and has noagentdescentand no--to. - CLI
apply <run_id> --install-to grok-botstill containsagentdescent applyand--to. - MCP
showapply_planstrings (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.pypasses, including the new pins.
Activity