Dê um bom nome e uma boa descrição à ferramenta
Escreva descrições que o modelo consiga realmente usar para agir.
Dê um bom nome e uma boa descrição à ferramenta é uma aula grátis de MCP Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de MCP Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de MCP Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
The Model Reads First
Before an AI ever runs your tool, it reads its name and description to decide whether this tool fits the task. 🧭
Name It Like a Verb
A good MCP tool name says what it does at a glance, like get_weather or send_email. Short, action-first, no surprises.
Where the Name Comes From
In FastMCP the tool name defaults to your Python function name, so name the function carefully and use snake_case.
@mcp.tool()
def get_weather(city: str) -> str:
...Override the Name
If the function name is not ideal, pass an explicit name to the decorator so the model sees exactly what you want.
@mcp.tool(name="get_weather")
def weather_lookup(city: str) -> str:
...The Description Is a Prompt
The tool description is read by the model as guidance. Treat it like a tiny prompt that tells the AI when and why to call this tool.
Docstrings Become Descriptions
FastMCP turns your function's docstring into the tool description automatically, so write it for the model, not just for humans.
@mcp.tool()
def get_weather(city: str) -> str:
"""Get the current weather for a city."""Say What It Returns
A strong description names the inputs and the output, so the model knows what it gets back before it ever calls the tool.
Be Specific About Limits
State the boundaries in the description: which cities, which formats, what it cannot do. Clear limits stop the model from misusing your tool.
Avoid Vague Verbs
Words like process or handle tell the model nothing. Use a precise verb so the AI can tell your tools apart at call time.
One Tool, One Job
Keep each tool focused on a single job. A narrow, well-named tool is far easier for the model to pick correctly than a do-everything one.
Test the Name Out Loud
Read the name and first line of the description together. If a stranger could not guess what it does, the model probably cannot either.
Quick Check
Where does FastMCP get a tool's description from by default?
Recap
The model reads the name and description first. Use action names, docstring descriptions, and clear limits so the AI calls your tool correctly. ✅
Perguntas Frequentes
A aula “Dê um bom nome e uma boa descrição à ferramenta” é grátis?
Sim — o texto completo de “Dê um bom nome e uma boa descrição à ferramenta” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de MCP Academy, atualize para CoddyKit PRO. O curso de MCP Academy inclui 4 aulas no total.
O que vou aprender em “Dê um bom nome e uma boa descrição à ferramenta”?
Escreva descrições que o modelo consiga realmente usar para agir. Você pratica MCP Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar MCP Academy?
Nenhuma experiência prévia é necessária. MCP Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.
Quanto tempo leva a aula “Dê um bom nome e uma boa descrição à ferramenta”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de MCP Academy?
Sim. Cada aula de MCP Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Dê um bom nome e uma boa descrição à ferramenta
- Declarar parâmetros com dicas de tipo
- Retornar resultados úteis
- Uma ferramenta de calculadora, do início ao fim