How to Write MCP Tool Descriptions the Model Actually Understands
The model decides whether to call your tool based almost entirely on its name, description and parameter descriptions. If those are vague, the model will skip the tool, call it at the wrong time or pass bad arguments. Clear descriptions are the cheapest way to make an MCP server work better.
What the model sees
When a client lists your tools, each entry has a name, an optional title, a description and an inputSchema in JSON Schema. The host puts those into the model's context. The model has no access to your source code, your README or your intentions. The description is the whole manual.
A weak example
server.registerTool(
"search",
{
description: "Searches stuff",
inputSchema: { q: z.string() },
},
handler
);
Search what? Where? What does q accept? What comes back? The model must guess. With many tools on a connection, a name like search also collides in the model's mind with other search-like tools.
A stronger version
server.registerTool(
"search_support_tickets",
{
title: "Search support tickets",
description:
"Full-text search over customer support tickets. " +
"Use this to find past tickets about a problem before answering a question. " +
"Returns up to 10 matches with id, subject, status and a short snippet. " +
"Does not return full ticket bodies; use get_support_ticket for that.",
inputSchema: {
query: z
.string()
.describe("Keywords to search for, such as 'refund delay'"),
status: z
.enum(["open", "closed", "any"])
.default("any")
.describe("Only return tickets with this status"),
},
},
handler
);
A checklist for descriptions
- Say what it does in the first sentence. Use a verb and an object.
- Say when to use it. "Use this to find past tickets before answering" is a trigger the model can match to a user request.
- Say what it returns. Mention the shape and any limits, such as "up to 10 results".
- Say what it does not do and where to go instead. Naming a related tool reduces wrong picks.
- Mention side effects. If it sends, deletes or spends something, say so in plain words.
- Keep it short. Two to four sentences. Every tool description is paid for in tokens on every request.
Parameter descriptions
Each parameter deserves a description, especially when the name alone is ambiguous. Good parameter text covers the format ("ISO 8601 date, like 2025-03-31"), allowed values, units, and an example. Use enums where a field has a fixed set of values, since the model cannot pass an invalid choice if the schema forbids it. Mark optional arguments as optional with a default and explain what the default does.
Naming
- Use
verb_nounnames such ascreate_invoiceandlist_projects. - Be specific:
search_support_ticketsbeatssearch. - Use only letters, numbers, underscores and hyphens, which most clients and model APIs accept as tool names.
- Be consistent across the server: if one tool says
project_id, do not call itprojectIdorprojin another.
Same idea in Python
In FastMCP the docstring is the description and an Args-style section is not parsed for per-argument text, so use Field descriptions for parameters.
from typing import Annotated, Literal
from pydantic import Field
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("support")
@mcp.tool()
def search_support_tickets(
query: Annotated[str, Field(description="Keywords, such as 'refund delay'")],
status: Annotated[
Literal["open", "closed", "any"],
Field(description="Only return tickets with this status"),
] = "any",
) -> str:
"""Full-text search over support tickets. Use this to find past tickets
before answering a question. Returns up to 10 matches with id, subject
and status. For the full body use get_support_ticket."""
return "no results"
A worked rewrite
Take a tool named update with the description "Updates a record". Rewrite it step by step. First, name it for the object: update_customer_email. Second, state the effect: "Change the email address stored for one customer." Third, state the trigger: "Use when the user asks to correct or change a customer's email." Fourth, state the guardrail: "Does not verify the address; ask the user to confirm it first." The result is longer, but each added sentence removes a way the model could misuse the tool.
Also think about the tools around it. If there are two tools that could plausibly answer the same request, the model will pick based on wording. Spell out the difference, such as "searches by keyword" against "fetches one ticket by exact id". When descriptions of sibling tools are written together, they read as a set instead of a pile.
Test your descriptions
Read your tool list as a stranger would. Then try prompts in a real client and watch which tool the model picks. If it picks the wrong one, change the description of the tool it should have picked and the one it picked wrongly. Wording changes are quick to try and often fix the problem without any code change. A later post covers evaluating tool use systematically.
Common mistakes
- Repeating the name as the description, such as "Gets the user" for
get_user. - Writing internal jargon the model has never seen.
- Describing implementation ("runs a SQL query against the foo table") instead of purpose.
- Putting instructions for the whole server into one tool description. Use the server instructions field for that, which a later post covers.
Comments
No comments yet. Have a question or a tip? Be the first to share it.