Skip to main content
Glama

editar_mensagem

Edit an already-sent WhatsApp message to correct errors or update information, using its message ID. Verify the target text first and only edit messages sent from your account.

Instructions

Edita uma mensagem JÁ ENVIADA por você/pela IA (o WhatsApp marca 'editada'). Use pra corrigir erro ou atualizar info numa msg recente. Só funciona em mensagem PRÓPRIA (fromMe) — ATENÇÃO: mensagens que o OPERADOR mandou do celular também são fromMe (mesma conta) e são editáveis por esta tool. Por isso NUNCA escolha o msgId por posição ('a última'): pegue via ler_mensagens e CONFIRA que o texto da msg alvo é exatamente o que você quer substituir antes de chamar. CONFIRMAÇÃO: mesma convenção do responder — no modo 'confirmar', mostre o texto novo e espere OK antes de chamar.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "grupo": "<grupo>",
      "msgId": "<msgId>",
      "texto": "<texto>"
    },
    "name": "editar_mensagem"
  }
}

Input Schema

NameRequiredDescriptionDefault
grupoYesslug do grupo/DM, nome exato, OU jid
msgIdYesid da mensagem a editar (de ler_mensagens)
textoYestexto NOVO completo (substitui o anterior)
operador_pediuNotrue SÓ quando o operador pediu, nesta conversa, este envio pra este chat. Libera a trava do autônomo de quando ele respondeu pelo celular (`operador_assumiu`); nunca a de 'é IA?' (`perguntou_ia`). Nunca use por conta própria pra contornar a trava.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the WhatsApp 'editada' side effect, the fromMe restriction, and the non-obvious trap that operator messages sent from the phone are also fromMe and therefore editable. It does not cover failure behavior (e.g. what happens if the message is too old to edit, since it only hints at 'msg recente') or whether the edit history is visible.

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-loaded with purpose and side effect, then the risk warning, then the confirmation rule — a sensible ordering, and every sentence carries a constraint an agent needs. Capitalized emphasis and the mixed parenthetical asides make it slightly denser than necessary, but nothing is filler.

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

Completeness4/5

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

For a 4-parameter mutation tool with no annotations and no output schema, the description covers the danger zones (wrong target, operator-owned messages, confirmation gate) thoroughly. The remaining gap is failure/edge behavior — no statement of what an unsuccessful edit returns or how old a message can be — which matters for a mutation with no structured safety hints.

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 the baseline is 3, and the description still adds real meaning: it explains why msgId must be derived from ler_mensagens and text-verified rather than chosen by position, and it reinforces that 'texto' is the full replacement text. The operador_pediu semantics are already fully spelled out in the schema, so the description adds nothing there.

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 ('Edita uma mensagem JÁ ENVIADA') plus the visible side effect (WhatsApp marks it 'editada') and the hard precondition (only fromMe messages). An agent can tell this apart from 'responder' (send new) and from 'ler_mensagens' (read) 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 the positive trigger ('corrigir erro ou atualizar info numa msg recente'), an explicit anti-pattern ('NUNCA escolha o msgId por posição'), the correct alternative workflow (get the id via ler_mensagens and verify the target text), and the confirmation convention tied to the 'confirmar' mode. When-to-use, when-not-to-use and the alternative source of truth are all named.

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