0Pricing
MCP Academy · Aula

Ferramentas: ações executadas pelo modelo

Funções que a IA invoca para realizar uma ação.

Ferramentas: ações executadas pelo modelo é 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.

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 + b

Every 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 + b

Arguments 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. ✅

Perguntas Frequentes

A aula “Ferramentas: ações executadas pelo modelo” é grátis?

Sim — o texto completo de “Ferramentas: ações executadas pelo modelo” é 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 “Ferramentas: ações executadas pelo modelo”?

Funções que a IA invoca para realizar uma ação. 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 “Ferramentas: ações executadas pelo modelo”?

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

  1. Ferramentas: ações executadas pelo modelo
  2. Recursos: dados lidos pelo modelo
  3. Prompts: instruções reutilizáveis
  4. Escolher o primitivo certo
← Voltar para MCP Academy