Darkmind / Issue 040

Tell the Agent When Not to Use a Tool

Put exclusion rules, safe alternatives, and output limits in each tool definition so an agent can reject a tempting near-match before it produces a bad call.

Nov 16, 20264 min readAgent design

A tool name can be technically accurate and still route an agent into the wrong action. Consider search_customer, get_account, and update_account. An agent that needs to find a billing policy might see “account” in the request and reach for a customer record. Or it may use a broad search tool when a versioned documentation lookup is the only source allowed to support the answer. The call can validate perfectly and still be the wrong move.

The practical move is to give each callable tool an explicit do-not-use boundary. Put it in the tool’s description beside the purpose, inputs, and return value: the nearby tasks this tool must reject, the prerequisite it needs, and the safe alternative or next step. That makes tool selection a decision with exclusions, not a vocabulary-matching game.

Tool definitions are part of the instructions the model sees. Anthropic says a tool description should explain what the tool does, when it should and should not be used, parameter behavior, and important limitations; it calls detailed descriptions the most important factor in tool performance.[1] OpenAI likewise recommends clear names, parameter descriptions, and instructions, including when not to use a function.[2] A schema can prevent malformed arguments, but it cannot establish that the selected operation is relevant, current, or authorized for the task.

Describe the tempting wrong use

Start with one tool at a time. Ask: what request sounds close enough that an agent might select this tool, but should take another path? Those are the exclusions worth documenting.

For a lookup_order tool, “Do not use to find an order from an email address; first resolve an authorized customer or order ID” prevents a fuzzy identifier from becoming a lookup key. For send_customer_email, “Do not use to draft or preview; use create_email_draft until an approved draft ID exists” separates a communication effect from a writing task. For search_public_docs, “Do not use for tenant-specific policy or account state” prevents public material from being mistaken for a customer’s governing record.

Be concrete. “Use responsibly” is not an exclusion. Neither is “only when appropriate.” Name the condition the wrapper can check or the agent can observe: a missing stable ID, an unapproved external effect, the wrong source class, stale state, or a request that needs clarification first.

Copy this tool-boundary card

Use this as the description source for a function, MCP tool, or internal agent capability. Keep safety enforcement in code; the card improves routing before the call reaches that boundary.

TOOL: [stable verb_noun name]

USE FOR
- [one observable job]
- [authorized scope and preconditions]

DO NOT USE FOR
- [tempting near-match task] → use [safe alternative] instead
- [missing prerequisite] → return [needs_input / named read]
- [prohibited effect or source class] → stop or request approval

INPUT CONTRACT
- required stable identifiers: [IDs the application, not the model, resolves]
- allowed fields / filters: [bounded list]
- freshness or approval witness: [version, proposal ID, or null]

RETURNS
- [what the result can establish]
- does not establish: [important limit]
- safe next actions: [bounded choices]

EXAMPLE ROUTING
- Request: [near-miss wording]
  Decision: do_not_call
  Because: [specific exclusion]
  Next: [tool or question]

The alternative matters. A rule that merely says “do not use” can leave the model hunting through an unrelated tool menu. Point it toward a constrained next move: resolve an ID from a bounded index, fetch the governing policy, create a draft, or return needs_approval. If no safe alternative exists, say so. A well-designed stop is better than an improvisation with a powerful neighbor tool.

Keep names, schemas, and boundaries aligned

An exclusion sentence cannot compensate for an overloaded capability. If manage_account can search, edit, export, and close an account depending on a free-form action field, the model has to infer too much before any description can save it. Split actions when their prerequisites or consequences differ, or use a small enumerated action value with action-specific validation.

At the same time, do not create a separate tool for every tiny variation. Anthropic recommends consolidating related operations to reduce selection ambiguity, while OpenAI recommends combining functions that are always called in sequence.[1][2] The useful dividing line is behavior: keep operations together when they share the same target, safety checks, and failure receipt. Separate them when one can disclose data, change state, or rely on evidence the other does not need.

Test descriptions with near-misses, not just the happy path. Give an evaluation set requests that should select the tool, requests that should select its alternative, and requests that must stop. Review the selected tool and its arguments before reading the final prose. A correct answer produced after an unnecessary or wrong-scope read is still a routing defect waiting to become a larger mistake.

Failure mode: treating documentation as an access control

A detailed description does not enforce policy. A model can ignore it, a prompt injection can try to redirect it, and a future caller can expose the same function in a different context. The executor still needs identifier validation, authorization, field allowlists, approval checks, and a typed failure result.

Use the description to make the right route easier to choose, then make the application refuse routes that violate the declared boundary. When a new incident reveals a confusing near-match, update the tool card and add that case to the routing set.

The habit to keep

every tool should say not only what it can do, but which plausible requests must not reach it—and what the next safe move is instead.

Sources

  1. Anthropic, “Define tools”
  2. OpenAI, “Function calling”