Skip to content
mentoor

Topic 4 of 4 · 5 min read

Changing tools without breaking connected agents

Goal: Plan the rollout of a breaking tool change so existing agents and clients keep working through the transition.

Treat a tool's name, parameters and result shape as a public API: add new things freely, and retire old things in steps with a notice and a date. Agents are callers you cannot easily update. Some are prompts and configs owned by other teams.

Check yourself · 1 of 3

Which change to a live tool is safe for existing agents?

Choose one answer

Why it matters

A model reads your tool list and its descriptions, then builds calls from them. If you rename get_invoice to fetch_invoice, every saved agent, prompt and workflow that names the old tool fails, and often fails quietly: the model sees "unknown tool" and improvises. Even a changed result shape can break a downstream parser.

Safe and unsafe changes

  • Safe: a new optional parameter, a new tool, a new optional field in a result, a clearer description.
  • Unsafe: renaming or removing a tool or parameter, making an optional parameter required, changing a type, changing what a value means (cents instead of dollars), tightening validation.

Changing a description is safe for the protocol but not for behaviour. The model reads descriptions, so a rewrite can change how it calls the tool. Test it.

A rollout in steps

  1. Add the new version beside the old one. Keep get_invoice and add get_invoice_v2 (or a new parameter).
  2. Mark the old one deprecated. Put it in the description ("Deprecated, use get_invoice_v2, removed after 2027-03-01") and return a warning in results.
  3. Tell clients. If your server declares the listChanged capability, send notifications/tools/list_changed so connected clients refresh their lists. Also publish a changelog and tell the teams you can identify from your call logs.
  4. Watch usage. Use per-tool call counts by client from your audit log. Remove only when the old tool's traffic is zero or the date has passed.
  5. Remove. Return a clear error that names the replacement for a while after removal.

Protocol revisions

The spec itself changes. A server can serve both older clients that expect an initialize handshake and newer clients that send version info on each request, if it implements both behaviours. Clients can call server/discover to learn which versions a server supports, and a server answers an unsupported version with UnsupportedProtocolVersionError. The spec keeps a registry of deprecated features with a migration path and an earliest removal date: copy that habit for your own tools.

Before and after

Before: Monday, get_invoice is replaced by fetch_invoice. Tuesday, three agents fail.

After: fetch_invoice ships beside get_invoice, which says "Deprecated, use fetch_invoice, removal 2027-03-01". Call counts show two teams still use the old one in January, so they get a message, and removal happens in March.

What goes wrong

  • Deprecating with no date, so nobody moves.
  • Removing on the date without checking traffic.
  • Reusing a name with a new meaning, which breaks callers silently. Pick a new name.
  • Assuming the model re-reads the list mid-run. A running agent may keep its old tool list until it reconnects.

Examples

Renaming a parameter

list_orders takes customer. You want customer_id. Accept both: keep customer, add customer_id, mark customer deprecated in the description, and log which clients still send it. Remove customer only after those clients move.

Same name, new meaning

get_balance returned dollars. The new version returns cents under the same name. Agents that format the number now show balances 100 times too large, with no error. Ship get_balance_cents instead and deprecate the old tool.

Key points

  • Treat tool names, parameters and result shapes as a public API for callers you cannot update quickly.
  • Additive changes are safe; renames, removals, new required parameters and changed meanings are breaking.
  • Roll out in steps: add the new tool, mark the old one deprecated with a date, notify, watch traffic, then remove.
  • Send notifications/tools/list_changed when the list changes, but expect some running agents to keep an older list.
  • A server can support several protocol revisions at once, and clients can learn the supported versions through server/discover.

Common mistakes

  • Renaming a tool in place instead of adding a new one and deprecating the old.
  • Announcing a deprecation without a removal date.
  • Removing a tool without checking call counts by client.
  • Changing the unit or meaning of a field while keeping its name.

Check yourself · 2 of 3

You must replace get_invoice with fetch_invoice. What is the best first step?

Choose one answer

Check yourself · 3 of 3

When is it reasonable to remove a deprecated tool?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic