Offering tools
Declare anmcp connector with isService: true, and list the tools by name.
interface.yaml
api/service.yaml, exactly as any other service method.
api/service.yaml
description is what the Agent reads to decide whether to call it. It is the toolβs
selection text, so write what the tool achieves, not how it works. A vague description means
a tool that never gets picked, or gets picked for the wrong thing.
instructions on the connector is different. Each description says what one tool does.
instructions says how to use them well together, which is the thing no single tool
description can express. There is a section on writing it below.
params is what the Agent passed. Its shape comes from the toolβs own inputs, so
validate what you rely on rather than assuming.
Using tools
An Agent node consumes tools rather than offering them, so it declares the sameserviceType with isService: false.
interface.yaml
api/toolExchange.yaml describes how this API expresses a tool call.
api/toolExchange.yaml
toolExchange makes the node a CallbackNode, because a tool loop is
multi-turn by definition. Lint enforces that.
What the exchange describes
The platform counts the turns and runs the tools. The manifest describes the wire format, because every API expresses the same idea differently.
That is a lot to write per node, so put it in
shared/ once and $ref it. Every node
for the same API imports the same protocol, and local keys layer on top.
Two limits, and why both exist
maxTurns bounds how long the loop may run. Set it to 1 and the node answers in a single
pass and cannot call a tool at all.
stuckAfterRepeats catches a different failure. The same tool with the same arguments three
times is stuck, and maxTurns does not catch it, because a model calling many different
tools forever is not stuck by that rule.
Writing instructions
instructions is appended to the Agentβs system prompt, so it costs tokens on every turn.
Earn them.
Not every node needs it. Where the tool descriptions are self-sufficient, leave it out.
Include it when:
- the tools have a sequence, such as read, then edit, then retry
- which tool to reach for depends on context, such as a small edit against a full rewrite
- there are anti-patterns that waste calls or fail outright
- recovering from an error needs an order that no single description implies
- Do not repeat the tool descriptions. Write the strategy between tools, not the tools.
- Be prescriptive. βAlwaysβ and βneverβ, not βconsiderβ.
- Give the reason for anything non-obvious. βNever re-read after a stale error, because the error already carries the new hashβ saves a wasted call.
- Show sequences. The value is in the choreography, not the inventory.
- Keep it short. Under a hundred lines, because it is in the prompt on every turn.
prompts/skills/ and discovered at run time.
instructions is part of the MCP schema and travels with the tools.
When it goes wrong
Next: Connectors & Signals

