Narzędzia: działania wykonywane przez model
Funkcje wywoływane przez AI w celu wykonania określonych działań.
Narzędzia: działania wykonywane przez model 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.
Meet the First Primitive
MCP gives a model three building blocks. The first is the tool: a function the AI can actually run to do something in the world. 🔧
Tools Take Action
A tool is for doing, not just knowing. Sending an email, querying a database, or creating a file all belong here because each one changes or fetches live state.
The Model Decides
You expose the tool, but the model chooses when to call it. Based on the conversation, the AI picks the right tool and fills in its arguments for you.
A Tool Is Just a Function
In the Python SDK a tool is a normal function. You mark it with the @mcp.tool() decorator and the server advertises it to clients.
@mcp.tool()
def add(a: int, b: int) -> int:
return a + bEvery Tool Needs a Name
Each tool carries a name the model uses to call it. By default the function name becomes the tool name, so add and get_weather just work.
Descriptions Guide the AI
The model reads your docstring to learn what a tool does. A clear one sentence summary makes the AI pick the right tool at the right moment.
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers together."""
return a + bArguments Become a Schema
Your function's parameters turn into an input schema. The model sees the names and types so it knows exactly what data to send.
Results Flow Back
Whatever your tool returns goes back to the model as context. The AI then weaves that result into its reply to the user.
Tools Can Have Side Effects
Because a tool runs real code, it can change things: write to disk, charge a card, or post a message. That power is exactly why tools sit under user control. ⚠️
Model-Controlled by Design
MCP calls tools model-controlled. The model initiates the call, while the host app can still ask the user to approve it before anything runs.
One Tool, One Job
Keep each tool focused on a single clear action. Small, well named tools are far easier for the model to choose correctly than one giant catch-all.
Quick Check
Let's lock in what makes a tool a tool.
Recap: Tools
Nice work! A tool is a model-controlled function that does something. You name it, describe it, type its arguments, and return a result the AI can use. ✅
Często zadawane pytania
Czy lekcja „Narzędzia: działania wykonywane przez model” jest bezpłatna?
Tak — pełny tekst „Narzędzia: działania wykonywane przez model” 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 „Narzędzia: działania wykonywane przez model”?
Funkcje wywoływane przez AI w celu wykonania określonych 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 „Narzędzia: działania wykonywane przez model”?
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
- Narzędzia: działania wykonywane przez model
- Zasoby: dane odczytywane przez model
- Prompty: instrukcje wielokrotnego użytku
- Wybór właściwego prymitywu