Skip to main content
Glama

Send Telegram Message

tg_send_message

Send a message from one of your Telegram accounts — text, or an attachment: an image via image_base64 (JPEG/PNG, at most 5 MiB; text becomes the caption), a document via document_base64 (any file, at most 20 MiB; text becomes the caption), or audio via audio_base64 (at most 16 MiB; no caption). Address the recipient by its Telegram chat id (@telegram) to reply, or by an @username or t.me link to start a conversation. Check the returned status: "sent" means delivered; "queued" means accepted but not yet confirmed and may still arrive, so do NOT send it again; "refused" means nothing was sent and the reason explains whether retrying will help. For a WhatsApp number use wa_send_message instead.

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": {
      "to": "<to>"
    },
    "name": "tg_send_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesthe recipient on Telegram: the chat id exactly as tg_list_messages reports it (<id>@telegram; a group is -<id>@telegram, a channel or supergroup -100<id>@telegram) to reply, or to start a conversation an @username or a t.me/<name> link. A phone in +E.164 form works only if it is already in this account's Telegram contacts. Never a bare number, which could be a phone or a user id
textNothe message body; when an attachment is set this is its caption and may be empty. Either text or an attachment is required
audio_pttNooptional: true to send as a voice note (push-to-talk) rather than a regular audio attachment
account_idNothe Telegram account to send from — the account_id on the message row you are replying to, or from wa_list_accounts; omit it when the workspace has only one Telegram account
audio_mimeNooptional: the audio's mime type, e.g. audio/ogg; codecs=opus
image_mimeNooptional: the image's mime type, image/jpeg or image/png
audio_base64Nooptional: base64-encoded audio to attach, at most 16 MiB decoded; audio has no caption
image_base64Nooptional: base64-encoded JPEG or PNG to attach, at most 5 MiB decoded; when set, text becomes the caption
audio_secondsNooptional: the audio's duration in seconds
document_mimeNooptional: the document's mime type, e.g. application/pdf
document_base64Nooptional: base64-encoded document/file to attach, at most 20 MiB decoded; when set, text is the caption
document_filenameNooptional: the filename shown to the recipient, e.g. report.pdf

Output Schema

NameRequiredDescriptionDefault
statusYessent (delivered), queued (accepted but unconfirmed - do NOT re-send), or refused (not attempted)
refusalNopresent only when status is refused
message_idNoWhatsApp's id for the message, present only when status is sent
request_idNocorrelation id; a queued message appears in wa_list_messages under this id once it settles

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and idempotentHint=false but say nothing about outcome semantics; the description fills exactly that gap by defining "sent", "queued" (accepted, may still arrive, do not resend) and "refused" (nothing sent, reason indicates whether retry helps). It also discloses size ceilings per attachment type and the caption interaction, which is real behavioral context rather than restated metadata. No contradiction with the annotations.

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?

It is one long paragraph but densely front-loaded: payload shapes first, addressing second, status handling third, sibling routing last. Every sentence carries actionable content — no filler, no restatement of the tool name.

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 12-parameter send tool with an output schema, the description covers the things an agent must know before calling: how to address the recipient, what each attachment slot does, and how to interpret each status. Return-value structure itself is left to the output schema, which is the correct division of labor.

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 every parameter's meaning is already documented in the schema, and the description largely mirrors it (5 MiB image, 20 MiB document, 16 MiB audio, text-as-caption). The added value is limited to consolidating the attachment rules in one place rather than introducing new syntax or format guidance, so baseline 3 applies.

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 (send a Telegram message) and immediately enumerates the supported payload shapes: text, image via image_base64, document via document_base64, audio via audio_base64. It also names the sibling it is not (wa_send_message for WhatsApp), so an agent can separate it from the other send tool without opening a 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 explicit routing rules both ways: use this tool for Telegram, use wa_send_message for a WhatsApp number. It also tells the agent how to pick the recipient form (chat id to reply, @username or t.me link to open a conversation) and what to do on each returned status, including the explicit instruction not to resend on "queued".

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