Send Telegram Message
tg_send_messageSend 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
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | the 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 | |
| text | No | the message body; when an attachment is set this is its caption and may be empty. Either text or an attachment is required | |
| audio_ptt | No | optional: true to send as a voice note (push-to-talk) rather than a regular audio attachment | |
| account_id | No | the 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_mime | No | optional: the audio's mime type, e.g. audio/ogg; codecs=opus | |
| image_mime | No | optional: the image's mime type, image/jpeg or image/png | |
| audio_base64 | No | optional: base64-encoded audio to attach, at most 16 MiB decoded; audio has no caption | |
| image_base64 | No | optional: base64-encoded JPEG or PNG to attach, at most 5 MiB decoded; when set, text becomes the caption | |
| audio_seconds | No | optional: the audio's duration in seconds | |
| document_mime | No | optional: the document's mime type, e.g. application/pdf | |
| document_base64 | No | optional: base64-encoded document/file to attach, at most 20 MiB decoded; when set, text is the caption | |
| document_filename | No | optional: the filename shown to the recipient, e.g. report.pdf |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | sent (delivered), queued (accepted but unconfirmed - do NOT re-send), or refused (not attempted) | |
| refusal | No | present only when status is refused | |
| message_id | No | WhatsApp's id for the message, present only when status is sent | |
| request_id | No | correlation id; a queued message appears in wa_list_messages under this id once it settles |