AI Agents & RAG

Verified against Anthropic MCP · 2026-07-23

Design MCP tool definitions an agent can actually use correctly

A prompt for writing the tool name, description, and parameter schema for a new MCP server before implementation, optimized for how an LLM reads tool definitions at the moment of selecting between them — not how a human-facing API reference would document the same operations.

Anthropic MCPClaudeClaude DesktopClaude Code4 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

You are designing the tool definitions for a new MCP server, before any implementation code gets written. Your job is to write tool names, descriptions, and parameter schemas the way an LLM actually reads and selects between them — not the way a human-facing API reference would document the same operations.

SERVER PURPOSE
An MCP server exposing a subset of the internal order-management system to AI agents for customer-support use cases

CANDIDATE OPERATIONS
look up an order by ID, look up all orders for a customer email, check whether an order is eligible for a refund, issue a refund up to a preset limit

TOOL DEFINITION RULES
- Name each tool by what it does and returns, not by the underlying implementation — get_order_status, not a name describing the table it happens to query. An LLM selects a tool primarily from its name and description at the moment of deciding what to call, and a name that describes an internal detail instead of an outcome makes correct tool selection harder for no benefit to anyone.
- Write the description to state exactly when to call this tool versus a similar one, not just what it does in isolation. If the candidate operations contain two that could plausibly be confused, the description of each must say the specific thing that distinguishes it — don't rely on the name alone to disambiguate.
- Every parameter needs a description stating its expected format and any constraints, following verb_noun snake_case, matching the rest of the internal API's naming so tool names read consistently with existing docs. An LLM given an untyped-feeling "id" parameter with no format guidance will guess a plausible-looking format that may not match what the server actually expects, and that mismatch fails at execution time with an error the model then has to interpret and recover from.
- State what each tool returns on success, including the shape of the response, and what it returns on a common, expected failure such as not-found or permission-denied versus an unexpected error — a tool that only documents its happy path leaves the calling agent unable to distinguish "this doesn't exist" from "something broke," which leads to different correct next actions.

DISAMBIGUATION PASS
For every pair of tools whose descriptions overlap even slightly, write one sentence stating exactly which one a caller should pick and why, as if answering the question an agent would actually face mid-task. If you can't write that sentence clearly, the two tools are not adequately distinguished yet — merge them or sharpen the descriptions until you can.

SCOPE AND SIDE EFFECTS
For every tool, state explicitly whether it's read-only or has a side effect that writes data, sends something, or costs money — this needs to be visible in the tool's description itself, not just in the server-side implementation, since refunds under $50 can be issued directly; anything above requires a separate human-approval tool, not a parameter on issue_refund only matters if the agent can actually tell from the tool definition alone whether a call is reversible.

OUTPUT FORMAT
For each tool: name, one-sentence purpose stating when to use it over any similar tool, full parameter list with types/formats/constraints, return shape on success, and return shape on the 2-3 most likely failure modes.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

An LLM choosing which tool to call does not read a full API reference the way a human developer would before writing an integration — it looks at the tool name and description in the moment, weighs it against the other available tools' names and descriptions, and calls the one that seems like the best match, all within the same forward pass that's also handling the rest of the conversation. That means an implementation-flavored name carries information that's irrelevant to the decision and omits the information that's actually decision-relevant, which measurably increases the odds of a wrong tool call compared to a name and description built around the outcome a caller cares about. Documenting expected failure modes explicitly, not just the happy path, is what lets an agent take a different, correct next action depending on why a call didn't succeed. A tool that returns the same generic error shape whether an order doesn't exist or the server is down forces the calling agent to treat both identically, when the right response is completely different — order-not-found might mean the agent should ask the customer to double-check the order number, while a server error means it should retry or escalate. An agent can only branch on a distinction it's actually been told exists. Making read-only versus side-effecting status visible in the tool's own description, rather than something only the server-side implementation knows, matters because an agent's judgment about whether a given action is safe to take without extra confirmation can only reason over what's in front of it at decision time — the tool definition. A refund tool whose description doesn't mention that it moves real money looks, from the calling agent's perspective, exactly as safe to call as a read-only lookup tool with a similar-sounding name, and an agent has no way to apply appropriately more caution to an action whose consequences it was never told about.

What you get back

Tool: check_refund_eligibility(order_id: string, matching pattern ORD-#####) — read-only. Purpose: use this before issue_refund to confirm eligibility; never call issue_refund speculatively to "see what happens." Returns on success: {eligible: boolean, max_refund_cents: number, reason}. Returns on failure: {error: "order_not_found"} if the ID doesn't match any record, distinct from {error: "service_unavailable"} for a transient failure.

Verified against

Anthropic MCP spec 2026-06-18 · 2026-07-23

Claude Sonnet 4.6 · 2026-07-23

Changelog

  • 2026-07-23 Initial publish, verified against the MCP 2026-06-18 spec and Claude Sonnet 4.6 tool-selection behavior.

Building this for real?

This is a free starting point. If you'd rather have AI agents & automation built and running for your business, that's Scult's day job.

EXPLORE AI AGENTS & AUTOMATION
All AI Agents & RAG prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY