🐾 fix: use the agents.yaml description as the send_message tool description #7
Reference in New Issue
Block a user
Delete Branch "fix/tool-description-from-agents-yaml"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Every agent's
send_messagetool advertised the generic fallback —"Send a message to the scotty agent"— which tells an MCP client nothing about what the agent is for.register_agent_toolsresolves the tool description astool_description→ the@fast.agentdecorator'sdescription=→ generic fallback. Pallas never passedtool_description, and no agent in the estate sets a decorator description — 0 of 34 agent modules acrosskottos,iolaus,mentoranddodona. So every agent everywhere landed on the fallback.Meanwhile the description an operator actually wrote already lives in
agents.yamland is published in the registry._start_agenthad it in scope (it buildsrequest_limitsfrom the sameentrydict) and simply never passed it through.The fix
One line of wiring in
_start_agent:Fixes every agent in every deployment at once, with no per-repo edits. Verified against Kottos's real
agents.yaml— all six agents resolve to their actual descriptions:Precedence — note the direction
tool_descriptionis checked first, so this makesagents.yamlwin over adescription=on the decorator. That's deliberate:agents.yamlis the deployment's source of truth for agent metadata, and an operator editing it shouldn't be silently overridden by a value buried in an agent module. It's also moot in practice right now, since nothing sets a decorator description — but the comment and docs state the order explicitly so the next person doesn't have to derive it.Tests
New
tests/test_tool_description.py, 8 tests pinning:{agent}is interpolated, and prose containing other braces (e.g.{"a": 1}) is not passed through.format()— that guard would otherwise raiseKeyErrorpytest tests/ -q→ 84 passed.Docs
agents.<name>.descriptionin the field table now notes its second role, and a new "Tool description" subsection undersend_messagedocuments the resolution order.Related
Surfaced by r/daedalus#20, which makes tool descriptions visible in the agent panel instead of hiding them in a
title=tooltip — the generic string is a lot more noticeable now that you can actually read it.🤖 Generated with Claude Code
Every agent's MCP tool advertised the generic "Send a message to the {agent} agent" fallback, because register_agent_tools only had the @fast.agent decorator's description to fall back on — and no agent in the estate sets one (0 of 34 agent modules across kottos, iolaus, mentor and dodona). Meanwhile the description an operator actually wrote already sits in agents.yaml and is published in the registry; _start_agent had it in scope and simply never passed it through. Wire it to tool_description. Fixes every agent in every deployment at once, with no per-repo edits: scotty's tool description becomes "Systems administration expert — infrastructure diagnostics, security hardening, and keeping everything running" instead of "Send a message to the scotty agent". Adds tests/test_tool_description.py pinning the resolution order (agents.yaml > decorator > fallback) and the {agent} templating, including that prose containing other braces is not passed through .format(). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>