Conteúdo textual e estruturado
Saiba quando retornar texto simples e quando retornar dados.
Conteúdo textual e estruturado é 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.
Two Ways to Reply
Every MCP tool result carries content, and you choose its shape. The big split is plain text versus structured data the client can parse.
What Text Content Is
A text result is just a string for the model to read, like a sentence or a paragraph. It is simple, human-friendly, and easy to drop into a prompt. 📝
What Structured Content Is
Structured content is real data, like a JSON object with named fields. Clients can read each field instead of guessing from prose.
{"temp_c": 21, "condition": "sunny", "city": "Cappadocia"}Why Text Alone Can Fail
If a tool returns "It is 21 degrees and sunny," the client must parse that English to use it. Wording changes break the parsing instantly.
Why Structure Wins for Code
With structured output, a client reads result.temp_c directly. The shape is predictable, so apps and agents can rely on it without scraping text.
You Can Send Both
MCP lets a tool return a readable text summary and structured data together. The model reads the prose; code reads the fields.
When Text Is the Right Call
Pick plain text when the answer is a message for a human to read, like an explanation, a status note, or a short summary.
When Structure Is the Right Call
Pick structured content when another program will consume the result, such as a price, a record, or a list of items to act on.
Default Is Text
If your tool just returns a string, MCP wraps it as text content automatically. Structured output is something you opt into on purpose.
def get_status() -> str:
return "All systems healthy"Think Consumer First
Ask who reads the result: a human, the model, or downstream code? That consumer decides whether you reach for text or structure.
Mixing Is Common
Mature tools usually return both: a friendly summary for the model plus a typed payload for the app. This keeps the result useful on every side.
Quick Check
A tool feeds prices into a billing app. Which output fits best?
Recap: Text vs Structure
You learned the two result shapes: readable text for humans and the model, and structured data for code. Match the shape to who reads it. ✅
Perguntas Frequentes
A aula “Conteúdo textual e estruturado” é grátis?
Sim — o texto completo de “Conteúdo textual e estruturado” é 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 “Conteúdo textual e estruturado”?
Saiba quando retornar texto simples e quando retornar dados. 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 “Conteúdo textual e estruturado”?
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
- Conteúdo textual e estruturado
- Retornar um objeto de resultado tipado
- Esquemas de saída para clientes
- Retornar imagens e dados binários