Treat a tool's input schema like a public API: additive changes in place, breaking changes under a new name, and make old-style calls fail with an error the model can fix itself.
Safe to change in place
- Adding an *optional* argument with a sensible default.
- Adding fields to the result (clients should ignore unknown fields).
- Relaxing validation (accepting more values).
- Improving the description. Note that this changes model behaviour, so test it.
Breaking: needs a new tool name
- A new *required* argument, a renamed or removed argument, a changed type, or a result shape existing callers depend on.
- Add
search_v2 (or a better descriptive name) alongside the old tool, mark the old description as deprecated ("Deprecated: use search_v2, which adds X"), keep both for a deprecation window, then remove the old one. - Avoid a
version argument on one tool. Models fill it inconsistently, and the schema becomes a union that is hard to validate.
notifications/tools/list_changed
Declare "tools": {"listChanged": true} and send the notification when the list changes, but do not rely on it. Many clients only call tools/list at connect time, and stateless Streamable HTTP servers often have no open stream to push notifications on. Design so that a client with a stale list still works or gets a clear error.
Make stale calls self-correcting
When a call arrives in the old shape, return a tool result with isError: true and a precise, actionable message instead of a protocol error:
Argument 'q' was renamed to 'query' in this tool. Call search_hive again with {"query": "..."}.
Models recover well from this kind of message. Where you can do it safely, accept the old argument as an alias for a while and log how often it is used. When usage reaches zero, remove it.
Process
- Keep the tool definitions in one place and generate everything else (tools/list, server card, docs) from it, so they cannot drift apart.
- Version the server (
serverInfo.version) and note tool changes in a changelog. - Before shipping, run a small eval: real prompts against the new schema, checking that the model picks the right tool and fills the arguments correctly.