Skip to main content
Glama

Get conversation messages

get_conversation_messages
Read-only

Retorna o histórico de mensagens de uma conversa específica. Use para ler o contexto de um atendimento antes de responder. Informe conversation_id, ou contact_id / contact_phone para ler a conversa mais recente desse contato. Mensagem com foto, PDF ou áudio traz attachments[].attachment_id: abra com get_attachment para ver a imagem, o PDF ou a transcrição do áudio. Cada mensagem tem id e from (cliente, agente, pessoa, automacao); last_message_id é o que reply_to_conversation pede para conferir que nada mudou.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_conversation_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoQuantidade de mensagens mais recentes (padrão 20, máx 100)
contact_idNoAlternativa a conversation_id: lê a conversa mais recente desse contato
contact_phoneNoAlternativa a conversation_id: telefone do contato, só dígitos com DDI
conversation_idNoID da conversa
incluir_pessoalNotrue = permite ler conversa do número pessoal de quem está usando a chave.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / incluir_pessoal
      Added value: +{
      +  "description": "true = permite ler conversa do número pessoal de quem está usando a chave.",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / contact_id
      Added value: +{
      +  "description": "Alternativa a conversation_id: lê a conversa mais recente desse contato",
      +  "type": "string"
      +}
    • addedInput schema / properties / contact_phone
      Added value: +{
      +  "description": "Alternativa a conversation_id: telefone do contato, só dígitos com DDI",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "conversation_id"
      -]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish readOnly=true, non-destructive and closed-world, so the safety profile is covered; the description adds substantive context beyond them: messages carry attachments[].attachment_id that must be resolved via another call, each message exposes id and from with enumerated role values (cliente, agente, pessoa, automacao), and last_message_id serves as a concurrency check for reply_to_conversation. It does not describe ordering, truncation, or behavior when no conversation exists, which keeps it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose in one sentence, then adds addressing modes, attachment handling, and return fields in a logical order with no filler. The final sentence packs three separate ideas (message id, from roles, last_message_id concurrency) into one string, which is dense but still parseable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five optional parameters, high schema coverage, annotations present, and no output schema, the description fills exactly the gaps that matter: it explains the alternative addressing paths, the shape of returned messages, attachment indirection, and how last_message_id feeds into the reply tool. An agent has everything needed to call this correctly and to handle attachments in the next step.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description genuinely adds meaning: it explains that contact_id and contact_phone are alternatives to conversation_id and that they resolve to the contact's most recent conversation, which the schema does not state. It also implies the role of incluir_pessoal by framing it as reading a personal number's conversation, though it does not elaborate on the failure mode when that flag is omitted.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Retorna o histórico de mensagens de uma conversa específica.' It also disambiguates the resource from adjacent tools by naming get_attachment for attachment contents and reply_to_conversation for the reply flow, so an agent can place this tool in the workflow without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit use case ('ler o contexto de um atendimento antes de responder') and spells out the three addressing modes: conversation_id, or contact_id / contact_phone to read that contact's most recent conversation. It also routes follow-up work to the correct siblings (get_attachment for images/PDFs/audio transcripts, reply_to_conversation for replying), which is exactly the when-to-use guidance an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources