Skip to main content
Glama

send_message

Destructive

Send a message to ONE contact right now, outside any flow. For reaching many contacts use a broadcast instead. Target the contact with contactId (globally unique — preferred), or with platformId (the platform-side id, e.g. the Telegram user id). platformId is NOT globally unique: it is unique only per bot, so the same Telegram user talking to two of your bots is two contacts sharing one platformId. Pass botId alongside it whenever the application has more than one bot; without botId the call succeeds only if exactly one contact in the application matches, and otherwise fails listing the candidate bots. {{var|name}} placeholders in the text resolve against that contact's variable context. Requires the manage_broadcasts permission. Formatting: plain text by default, so tags arrive exactly as written. Pass parseMode "HTML" to send Telegram HTML (, , , , , , , , ; escape a literal <, > or & as &lt; &gt; &amp;); the flow tokens [[b]]…[[/b]], [[i]], [[u]] and [[a|url]]…[[/a]] work too. Values filled in from what people typed are escaped, so they show as text and never add formatting. HTML that Telegram cannot parse is sent once more as plain text with the tags removed. Telegram bots and web chat only (web chat: not with media); refused for Instagram, mail, Telegram user accounts and SDK bots. Markdown is never rendered. Media: pass up to 10 attachments as publicly reachable http(s) URLs; the text becomes the caption (max 1024 characters) and may be empty. Several attachments send as one album. The kind is inferred from the URL's file extension — override with type when the URL has none. Not supported for SDK bots or for Telegram user-account bots (telegram_mtproto, text only) — the call is rejected and nothing is sent. Buttons: up to 8, each carrying EXACTLY ONE destination — a url (http(s) or tg://) the recipient opens, or a flowId, an already-applied INTERACTIVE flow that runs for that recipient when they tap it. The two kinds mix freely in one keyboard, so a custom text with flow-wired buttons needs no wrapper flow. A flow button starts its flow from the start block with the recipient's own variable context, and re-runs on every tap. Broadcast and operation flows are rejected, as are flow buttons on SDK bots (taps never reach the runtime there). Buttons of either kind are rejected for telegram_mtproto bots: a user account cannot send buttons, so put the link in the text. To send a WHOLE flow as the message instead of wiring one behind a button, use send_flow_to_contacts. Buttons cannot be combined with media; send those as two messages. Delivery is asynchronous: a successful response means the bot accepted the send, not that the platform delivered it. A send that fails afterwards (a broken media URL, a contact that blocked the bot, a chat not found) is not returned here: it is written to the flow logs as an error row for that contact with action direct_message (read it with query_flow_logs or get_contact_activity), and no outgoing message is added to the transcript. Unsubscribed contacts and inactive bots are rejected. A telegram_mtproto bot (a Telegram user account) sends nothing until its owner turns on "Sending from this account" in the dashboard (Bot settings → Account). It is OFF for every newly connected account and no tool changes it. While it is off the call is rejected, except to the account's own Saved Messages (platformId "me"). Hand-off: pass expectReply true when a PERSON on the team wants the contact's answer, not the bot. The contact becomes a lead Waiting on them (a closed lead reopens) and their next messages go to Live Chat instead of the bot until the lead closes — by hand, or by the workspace's quiet close — and then the bot answers again. Needs leads switched on for the workspace; with leads off the call is rejected and nothing is sent. The result has handedToPerson and handoffNote; group and channel contacts are sent the message but stay with the bot. Omit it for messages the bot should keep handling. NOT idempotent and not reversible — each call sends another message to a real person, and a sent message cannot be recalled. Confirm the recipient and text with the user before calling, and never retry a timed-out call blindly.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "send_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoMessage body. Required unless media is passed; with media it becomes the caption (max 1024 characters) and may be omitted. `{{var|name}}` placeholders resolve against the recipient's variable context. Plain text unless parseMode is "HTML".
botIdNoBot to send from. Required in practice when targeting by platformId in a multi-bot application; without it the call succeeds only if exactly one contact matches, and otherwise fails listing the candidate bots.
mediaNoUp to 10 attachments. Several items send as one album with `text` as the shared caption.
buttonsNoUp to 8 buttons, rendered one per row under the message. Each needs exactly one of url or flowId; the two kinds may be mixed. Rejected together with media.
contactIdNoPreferred way to target the recipient: the globally unique FlowCastle contact id. Supply either this or platformId.
parseModeNoSet to "HTML" to send the text (or caption) as Telegram HTML. Omit for plain text.
platformIdNoPlatform-side user id (e.g. the Telegram user id). NOT globally unique — unique only per bot — so pass botId alongside it when the application has more than one bot.
expectReplyNoSet true to hand the conversation to a person: the contact's answer goes to Live Chat, not the bot, until their lead closes. Needs leads on; rejected (nothing sent) when they are off.
applicationIdNoApplication (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / expectReply
      Added value: +{
      +  "description": "Set true to hand the conversation to a person: the contact's answer goes to Live Chat, not the bot, until their lead closes. Needs leads on; rejected (nothing sent) when they are off.",
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / media / items / properties / type / description
      Previous value: -"Attachment kind. Inferred from the URL's file extension when omitted; unrecognized extensions fall back to DOCUMENT."New value: +"Attachment kind. Inferred from the URL's file extension when omitted (.mp3/.m4a/.aac/.wav/.flac → AUDIO, a music track; .ogg/.oga/.opus → VOICE, a voice note); unrecognized extensions fall back to DOCUMENT."
    • changedInput schema / properties / media / items / properties / type / enum
      Previous value: -[
      -  "IMAGE",
      -  "IMAGE_URL",
      -  "VIDEO",
      -  "VIDEO_NOTE",
      -  "DOCUMENT",
      -  "VOICE",
      -  "STICKER"
      -]New value: +[
      +  "IMAGE",
      +  "IMAGE_URL",
      +  "VIDEO",
      +  "VIDEO_NOTE",
      +  "DOCUMENT",
      +  "VOICE",
      +  "AUDIO",
      +  "STICKER"
      +]
  3. Changed2 schema fields changed
    • addedInput schema / properties / parseMode
      Added value: +{
      +  "description": "Set to \"HTML\" to send the text (or caption) as Telegram HTML. Omit for plain text.",
      +  "enum": [
      +    "HTML"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / text / description
      Previous value: -"Message body. Required unless media is passed; with media it becomes the caption (max 1024 characters) and may be omitted. `{{var|name}}` placeholders resolve against the recipient's variable context."New value: +"Message body. Required unless media is passed; with media it becomes the caption (max 1024 characters) and may be omitted. `{{var|name}}` placeholders resolve against the recipient's variable context. Plain text unless parseMode is \"HTML\"."
  4. Changed4 schema fields changed
    • changedInput schema / properties / buttons / description
      Previous value: -"Up to 8 URL buttons, rendered one per row under the message. Rejected together with media."New value: +"Up to 8 buttons, rendered one per row under the message. Each needs exactly one of url or flowId; the two kinds may be mixed. Rejected together with media."
    • addedInput schema / properties / buttons / items / properties / flowId
      Added value: +{
      +  "description": "Id of an already-applied INTERACTIVE flow to run for the recipient when they tap the button (from apply_actions' idRemap or get_application_context). Broadcast and operation flows are rejected. Set this OR url, never both.",
      +  "type": "string"
      +}
    • changedInput schema / properties / buttons / items / properties / url / description
      Previous value: -"Required. Where the button leads — http(s) or tg:// only. There is no callback/flow-wired button here; use send_flow_to_contacts for those."New value: +"Where the button leads — http(s) or tg:// only. Set this OR flowId, never both."
    • changedInput schema / properties / buttons / items / required
      Previous value: -[
      -  "text",
      -  "url"
      -]New value: +[
      +  "text"
      +]
  5. Changed1 schema field changed
    • addedInput schema / properties / buttons
      Added value: +{
      +  "description": "Up to 8 URL buttons, rendered one per row under the message. Rejected together with media.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "text": {
      +        "description": "Required. Label shown on the button.",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Required. Where the button leads — http(s) or tg:// only. There is no callback/flow-wired button here; use send_flow_to_contacts for those.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "text",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 8,
      +  "type": "array"
      +}
  6. Changed4 schema fields changed
    • addedInput schema / properties / media
      Added value: +{
      +  "description": "Up to 10 attachments. Several items send as one album with `text` as the shared caption.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "filename": {
      +        "description": "Filename shown for DOCUMENT sends. Defaults to the URL's basename.",
      +        "type": "string"
      +      },
      +      "type": {
      +        "description": "Attachment kind. Inferred from the URL's file extension when omitted; unrecognized extensions fall back to DOCUMENT.",
      +        "enum": [
      +          "IMAGE",
      +          "IMAGE_URL",
      +          "VIDEO",
      +          "VIDEO_NOTE",
      +          "DOCUMENT",
      +          "VOICE",
      +          "STICKER"
      +        ],
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Required. Publicly reachable http(s) URL of the file; the platform downloads it from there.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • changedInput schema / properties / text / description
      Previous value: -"Required. Plain-text message body, must be non-empty. `{{var|name}}` placeholders resolve against the recipient's variable context."New value: +"Message body. Required unless media is passed; with media it becomes the caption (max 1024 characters) and may be omitted. `{{var|name}}` placeholders resolve against the recipient's variable context."
    • removedInput schema / properties / text / minLength
      Removed value: -1
    • removedInput schema / required
      Removed value: -[
      -  "text"
      -]
  7. Changed5 schema fields changed
    • addedInput schema / properties / applicationId / description
      Added value: +"Application (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id."
    • addedInput schema / properties / botId / description
      Added value: +"Bot to send from. Required in practice when targeting by platformId in a multi-bot application; without it the call succeeds only if exactly one contact matches, and otherwise fails listing the candidate bots."
    • addedInput schema / properties / contactId / description
      Added value: +"Preferred way to target the recipient: the globally unique FlowCastle contact id. Supply either this or platformId."
    • addedInput schema / properties / platformId / description
      Added value: +"Platform-side user id (e.g. the Telegram user id). NOT globally unique — unique only per bot — so pass botId alongside it when the application has more than one bot."
    • addedInput schema / properties / text / description
      Added value: +"Required. Plain-text message body, must be non-empty. `{{var|name}}` placeholders resolve against the recipient's variable context."
  8. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive and non-idempotent, but the description adds substantial context beyond them: asynchronous delivery semantics ('a successful response means the bot accepted the send'), post-accept failures landing in flow logs with action `direct_message` rather than the response, the manage_broadcasts permission requirement, rejection of unsubscribed contacts and inactive bots, and the mtproto 'Sending from this account' toggle that no tool can flip. It also covers silent degradation (unparseable HTML resent as plain text) and the leads-off rejection.

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

Conciseness3/5

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

Front-loaded with scope and the sibling routing, which is good, but the body is one very long block where formatting, media, buttons, delivery, permissions, and hand-off are all crammed into prose paragraphs rather than separated. Nearly every sentence carries information, yet the parseMode/HTML token inventory and escaping rules are disproportionately verbose relative to their selection value.

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 9-parameter, high-blast-radius send tool with no output schema, the description covers targeting ambiguity, formatting fallback, media inference and limits, button constraints, channel support matrix, permission and account-state requirements, delivery reporting, and hand-off side effects. Nothing an agent needs to avoid a harmful call appears missing.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds operational meaning the schema cannot express: why platformId is not globally unique across bots and the exact failure mode without botId, that `{{var|name}}` resolves against the recipient's context, that typed-in values are escaped and never add formatting, that parseMode HTML has a plain-text fallback, and that buttons cannot be combined with media. This is semantics, not restatement.

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?

The opening sentence states a specific verb, resource, and cardinality ('Send a message to ONE contact right now, outside any flow') and immediately names the sibling it is not ('For reaching many contacts use a broadcast instead', plus send_flow_to_contacts later). An agent can distinguish this from every listed sibling 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?

Explicit routing is given for each alternative: broadcast for many contacts, send_flow_to_contacts when a whole flow is the message, omission of expectReply when the bot should keep handling, and confirm-with-user-before-calling guidance. Exclusions (Instagram, mail, Telegram user accounts, SDK bots, buttons+media) are stated, not implied.

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.