Skip to main content
Glama
grammy-mcp
by louietyj

deleteMessage

Destructive

Delete a Telegram message by specifying its chat ID and message ID; use it to remove messages within Telegram's time and permission limits.

Instructions

Use this method to delete a message, including service messages, with the following limitations:

  • A message can only be deleted if it was sent less than 48 hours ago.

  • A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.

  • Bots can delete outgoing messages in private chats, groups, and supergroups.

  • Bots can delete incoming messages in private chats.

  • Bots granted can_post_messages permissions can delete outgoing messages in channels.

  • If the bot is an administrator of a group, it can delete any message there.

  • If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there.

  • If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat. Returns True on success.

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": {
      "chat_id": "<chat_id>",
      "message_id": "<message_id>"
    },
    "name": "deleteMessage"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_idYesUnique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username`
message_idYesIdentifier of the message to delete

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already flag destructive=true/openWorld=true, and the description goes well beyond that by enumerating the permission scopes required per chat type (can_post_messages, can_delete_messages, can_manage_direct_messages) and the retention windows that gate deletion. It also states the return value ('Returns True on success') despite there being no output schema, closing the last behavioral gap.

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?

The purpose leads and the constraints follow as a scannable bullet list, with the return value last. A few bullets overlap (general outgoing-message rule vs. the administrator-right rules), but each carries distinct permission detail rather than filler.

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?

For a two-parameter destructive tool with no output schema, the definition covers eligibility windows, permission requirements per chat type, and the success return. Nothing material is missing that would cause a wrong invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so both chat_id and message_id are already documented, including the @username format. The description adds no parameter-level detail such as identifier format or channel/DM addressing nuances, so it sits at the expected baseline when the schema does the heavy lifting.

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

Purpose4/5

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

Opens with a specific verb+resource ('delete a message, including service messages'), which is unambiguous. It does not name the sibling deleteMessages, so an agent has to infer on its own whether bulk deletion is handled elsewhere.

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

Usage Guidelines4/5

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

The limitations list effectively states when this tool will and will not work: the 48-hour window, the 24-hour dice-message exception, and the per-chat-type bot permission rules. It gives strong contextual conditions but never routes the agent to an alternative (e.g., a bulk-delete sibling) when the single-message constraints don't apply.

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

Deploy Server

Other Tools