Skip to main content
Glama
grammy-mcp
by louietyj

answerCallbackQuery

Sends responses to inline keyboard callback queries, displaying a notification or alert to the user and optionally redirecting them to a Game URL.

Instructions

Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.

Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via

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": {
      "callback_query_id": "<callback_query_id>"
    },
    "name": "answerCallbackQuery"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL that will be opened by the user's client. If you have created a Game and accepted the conditions via `@BotFather`, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
textNoText of the notification. If not specified, nothing will be shown to the user, 0-200 characters.
cache_timeNoThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
show_alertNoIf True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to False.
callback_query_idYesUnique identifier for the query to be answered

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is partly covered. The description adds genuine value beyond that by disclosing the user-visible effect (notification at the top of the screen versus an alert) and the success return value of True, which an agent needs to reason about outcomes.

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?

The purpose and display behavior are front-loaded in two efficient sentences, but the trailing sentence is truncated mid-clause ('you must first create a game for your bot via'), leaving an incomplete thought that wastes space and signals a copy defect.

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

Completeness4/5

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

With only one required parameter, full schema coverage and no output schema, the description supplies enough to call the tool correctly and even notes the True return. The main shortfall is the cut-off Game URL sentence and the absence of any note on error behavior for invalid or expired callback query IDs.

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 including the Game URL precondition, text length limit, cache_time and show_alert behavior is already documented in the schema. The description only echoes the url option, adding no meaning beyond what those structured fields provide, so the baseline of 3 applies.

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

Purpose4/5

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

The opening states a specific verb and resource: 'send answers to callback queries sent from inline keyboards.' That is clearly distinguishable from siblings like answerInlineQuery or answerWebAppQuery, though the description never names those alternatives explicitly.

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

Usage Guidelines3/5

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

It establishes the context (a callback query originating from an inline keyboard) and describes one alternative path (redirecting the user to a Game URL). There is no explicit when-not guidance, no mention of what happens with a stale or already-answered callback_query_id, and no comparison to other answer* tools.

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

Deploy Server

Other Tools