A before/after schema tightening example, a structured tool-error shape, and a worked case of ambiguous tool choice.
The difference between a tool the model uses correctly and one it misuses is almost always in the schema, not the model's capability:
update with a single parameter: data (freeform string).data differently, so the tool's own implementation has to guess how to parse it.A tool that fails should say what happened in a shape the caller (often another part of the same agentic system) can act on, not a bare exception string:
{ error: "failed" } — gives the caller nothing to work with.{ error_type: "validation", message: "order_id 4471 not found", retryable: false } — the caller (or coordinator) can immediately tell this isn't worth retrying and needs a different order_id.If a system has both search_orders and get_order_by_id, and a user asks "what's the status of order 4471?", the model should reliably pick get_order_by_id — but only if the two tools' descriptions clearly stake out non-overlapping territory. If search_orders's description doesn't make clear it's for browsing multiple results rather than looking up one known ID, the model may guess wrong or hedge by calling both.