Dobre nazywanie i opisywanie narzędzi
Pisz opisy, na podstawie których model może rzeczywiście działać.
Dobre nazywanie i opisywanie narzędzi to bezpłatna lekcja MCP Academy na CoddyKit. To lekcja 1 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MCP Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MCP Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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. ✅
Często zadawane pytania
Czy lekcja „Dobre nazywanie i opisywanie narzędzi” jest bezpłatna?
Tak — pełny tekst „Dobre nazywanie i opisywanie narzędzi” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MCP Academy, przejdź na CoddyKit PRO. Kurs MCP Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Dobre nazywanie i opisywanie narzędzi”?
Pisz opisy, na podstawie których model może rzeczywiście działać. Ćwiczysz MCP Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć MCP Academy?
Nie wymagamy żadnego doświadczenia. MCP Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 1 z 4.
Ile czasu zajmuje lekcja „Dobre nazywanie i opisywanie narzędzi”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji MCP Academy?
Tak. Każda lekcja MCP Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Dobre nazywanie i opisywanie narzędzi
- Deklarowanie parametrów za pomocą adnotacji typów
- Zwracanie użytecznych wyników
- Narzędzie kalkulatora od początku do końca