Skip to main content
Glama

messages_press_button

Destructive

Press a button under a message in a Telegram chat, as the connected Telegram account: the inline menus bots such as @BotFather reply with. Name the button by its exact label.

Returns the message as it looks after the press (bots usually edit it into the next menu) and anything the bot sent after it, each with its own buttons and a message_id you can pass back to press the next one.

Mini Apps: a button of kind web_app is opened in the workspace's hosted browser, signed in as the connected account; the result is {opened, page_id, title, host} and you continue with browser.snapshot, browser.click and browser.type on that page_id. Some settings of a bot exist only in its Mini App (for example @BotFather's Bot Settings): in that bot's thread pass open_main_app=true, with no message_id or button_text, to open the bot's main app (the Open button beside the input). The address of the app is a login and is never shown.

Refused: buttons that need the account's cloud password (the owner confirms those in the Telegram app), and buttons that share a phone number or location or pay. A link button is not pressed; its URL is returned. A label that matches no button returns the buttons that exist.

Get the message_id from messages.read_history. Telegram user accounts only; a bot account cannot press buttons.

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": {
      "thread_id": "<thread_id>"
    },
    "name": "messages_press_button"
  }
}

Input Schema

NameRequiredDescriptionDefault
thread_idYesThread containing the message (numeric DB id or channel_ref like 'telegram:123456789').
message_idNoMessage the button is under: a DB id from messages.read_history, or a 'telegram:<id>' returned by a previous press. Not needed with open_main_app.
button_textNoThe button's label, exactly as shown (case is ignored if nothing matches exactly). Not needed with open_main_app.
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.
open_main_appNotrue = open the main Mini App of the bot this thread is with (no button needed) in the hosted browser. OMIT to press a button.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / button_text / description
      Previous value: -"The button's label, exactly as shown (case is ignored if nothing matches exactly)."New value: +"The button's label, exactly as shown (case is ignored if nothing matches exactly). Not needed with open_main_app."
    • changedInput schema / properties / message_id / description
      Previous value: -"Message the button is under: a DB id from messages.read_history, or a 'telegram:<id>' returned by a previous press."New value: +"Message the button is under: a DB id from messages.read_history, or a 'telegram:<id>' returned by a previous press. Not needed with open_main_app."
    • addedInput schema / properties / open_main_app
      Added value: +{
      +  "description": "true = open the main Mini App of the bot this thread is with (no button needed) in the hosted browser. OMIT to press a button.",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "thread_id",
      -  "message_id",
      -  "button_text"
      -]New value: +[
      +  "thread_id"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations (destructiveHint, openWorldHint, idempotentHint=false) by describing what actually comes back: the post-press message, any follow-up bot messages, each with buttons and a reusable message_id. It also discloses refusals (cloud-password buttons, phone/location/pay buttons), that link buttons are returned rather than pressed, and that Mini Apps open in a hosted browser signed in as the connected account.

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?

Information is front-loaded with the core action first, then return shape, then Mini Apps, then refusals and prerequisites. It is on the long side with a paragraph break labelled 'Mini Apps' and 'Refused', but nearly every sentence carries operational meaning; only the repeated exact-label wording is mildly redundant with the schema.

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 non-idempotent, destructive, open-world mutation with no output schema, the description covers return values, the follow-up message_id chain, Mini App session handoff, refusal cases, and account-type prerequisites ('Telegram user accounts only; a bot account cannot press buttons'). Nothing an agent needs before invoking it is missing.

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 the schema already explains thread_id, message_id, button_text, in_workspace and open_main_app in detail. The description only reinforces label-exactness and the no-params-for-open_main_app case, which is largely restating structured data, so the baseline of 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: 'Press a button under a message in a Telegram chat', and immediately scopes it to inline keyboard menus bots reply with. That distinguishes it from siblings like messages_send, messages_react or browser_press_key without the agent needing to open anything else.

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: get message_id from messages.read_history, use open_main_app=true (with no message_id or button_text) for settings that only exist inside a bot's Mini App, and continue with browser.snapshot/click/type on the returned page_id. It even specifies the fallback when a label matches nothing, so there is no ambiguity about when this tool applies.

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.