Skip to main content
Glama
bobidk91-ops

Telegram MCP Server

by bobidk91-ops

edit_message

Modify existing Telegram messages by updating text content with support for HTML or Markdown formatting, using the message ID for precise editing.

Instructions

Edit an existing message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYesMessage ID to edit
parse_modeNoParse mode for new text
textYesNew message text

Implementation Reference

  • The switch case that handles execution of the 'edit_message' tool. It destructures arguments, calls TelegramBot's editMessageText method with chat_id (CHANNEL_ID), message_id, text, and parse_mode, then returns a formatted success response.
    case 'edit_message': {
      const { message_id, text, parse_mode = 'HTML' } = args as {
        message_id: number;
        text: string;
        parse_mode?: string;
      };
      
      const result = await bot.editMessageText(text, {
        chat_id: CHANNEL_ID,
        message_id,
        parse_mode: parse_mode as any,
      });
      
      return {
        content: [
          {
            type: 'text',
            text: `āœ… Message edited successfully!\n\nšŸ“± Channel: ${CHANNEL_ID}\nšŸ“ Message ID: ${message_id}\nšŸ“„ New Text: ${text}`,
          },
        ],
      };
    }
  • src/index.ts:151-173 (registration)
    The tool registration entry in the ListToolsRequestSchema response array, defining name, description, and inputSchema for 'edit_message'.
    {
      name: 'edit_message',
      description: 'Edit an existing message',
      inputSchema: {
        type: 'object',
        properties: {
          message_id: {
            type: 'number',
            description: 'ID of the message to edit',
          },
          text: {
            type: 'string',
            description: 'New message text',
          },
          parse_mode: {
            type: 'string',
            enum: ['HTML', 'Markdown'],
            description: 'Parse mode for the message',
          },
        },
        required: ['message_id', 'text'],
      },
    },
  • The input schema definition for the 'edit_message' tool, specifying required message_id and text, optional parse_mode.
    inputSchema: {
      type: 'object',
      properties: {
        message_id: {
          type: 'number',
          description: 'ID of the message to edit',
        },
        text: {
          type: 'string',
          description: 'New message text',
        },
        parse_mode: {
          type: 'string',
          enum: ['HTML', 'Markdown'],
          description: 'Parse mode for the message',
        },
      },
      required: ['message_id', 'text'],
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool edits a message, implying a mutation, but doesn't cover critical aspects like required permissions, whether edits are reversible, rate limits, or what happens if the message_id is invalid. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is extremely concise with a single sentence ('Edit an existing message'), which is front-loaded and wastes no words. It directly states the tool's action without unnecessary elaboration, making it efficient for quick understanding, though this conciseness comes at the cost of detail.

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

Completeness2/5

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

Given the tool's complexity (a mutation operation with 3 parameters) and the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral traits, usage context, or output expectations, leaving significant gaps for the agent to navigate. For a tool that modifies data, more comprehensive guidance is needed.

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?

The description adds no parameter semantics beyond what the input schema provides. Since schema description coverage is 100%, the schema already documents all parameters (message_id, parse_mode, text) with descriptions and enums. The description doesn't explain how these parameters interact (e.g., parse_mode applies to the new text) or provide additional context, so it meets the baseline for high schema coverage.

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

Purpose3/5

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

The description states the action ('edit') and resource ('an existing message'), which provides a basic understanding of the tool's function. However, it doesn't differentiate this tool from potential siblings like 'send_message' or 'delete_message' beyond the obvious verb difference, nor does it specify what aspects of the message can be edited (e.g., text, formatting). This makes the purpose somewhat vague but still identifiable.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid message_id), exclusions (e.g., cannot edit messages after a certain time), or comparisons to siblings like 'send_message' for new messages or 'delete_message' for removal. This lack of context leaves the agent to infer usage based on the tool name alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bobidk91-ops/telegram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server