Nombrar y describir bien una herramienta
Escriba descripciones que el modelo pueda utilizar realmente.
Nombrar y describir bien una herramienta es una lección gratuita de MCP Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de MCP Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de MCP Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en 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. ✅
Preguntas frecuentes
¿La lección «Nombrar y describir bien una herramienta» es gratis?
Sí — el texto completo de «Nombrar y describir bien una herramienta» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de MCP Academy, actualiza a CoddyKit PRO. El curso de MCP Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Nombrar y describir bien una herramienta»?
Escriba descripciones que el modelo pueda utilizar realmente. Practicas MCP Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar MCP Academy?
No se requiere experiencia previa. MCP Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.
¿Cuánto tiempo toma la lección «Nombrar y describir bien una herramienta»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de MCP Academy?
Sí. Cada lección de MCP Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Nombrar y describir bien una herramienta
- Declarar parámetros con indicaciones de tipo
- Devolver resultados útiles
- Una herramienta de calculadora, de principio a fin