Skip to main content
Glama
grammy-mcp
by louietyj

answerInlineQuery

Sends results to a Telegram inline query, returning up to 50 items with optional button and caching controls so bots can respond to user searches.

Instructions

Use this method to send answers to an inline query. On success, True is returned. No more than 50 results per query are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.

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": {
      "inline_query_id": "<inline_query_id>",
      "results": "<results>"
    },
    "name": "answerInlineQuery"
  }
}

Input Schema

NameRequiredDescriptionDefault
buttonNoAn object describing a button to be shown above inline query results
resultsYesAn Array of results for the inline query
cache_timeNoThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalNoPass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.
next_offsetNoPass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
inline_query_idYesUnique identifier for the answered query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/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 mutation/network profile is covered by structured data. The description adds two genuinely useful facts beyond that: success returns True, and no more than 50 results per query are allowed. It omits rate limiting and answer expiration, which are the main behavioral risks for this endpoint.

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

Conciseness2/5

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

The core constraints are front-loaded in the first three lines, which is good. The remaining multi-sentence YouTube example is documentation boilerplate about bot UX and consumes roughly half the text without helping an agent construct a call.

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

Completeness3/5

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

With six parameters, nested objects and no output schema, the well-covered schema carries most of the load and the description supplies the result cap and return value. Still missing are error behavior for invalid/expired query IDs and any note that the answer is a one-shot response, which an agent needs to avoid mis-sequencing calls.

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 coverage is 100%, so every parameter, including the nested InlineQueryResult and button objects, is already documented. The description's only added meaning is the 50-result ceiling that constrains the 'results' array, which is helpful but limited; nothing is said about the interaction between cache_time, is_personal and next_offset.

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 sentence names a specific verb and resource ('send answers to an inline query'), and the term 'inline query' cleanly separates it from siblings such as answerCallbackQuery or answerWebAppQuery. It stops just short of explicitly naming those alternatives.

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

Usage Guidelines2/5

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

There is no guidance on when to call this versus the other answer* methods, nor any note about the lifetime of an inline_query_id or the expectation of a single response per query. The second paragraph describes inline-bot UX design (connect buttons, switch_inline_query) rather than steering an agent toward correct invocation.

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