Skip to main content
Glama
grammy-mcp
by louietyj

setWebhook

Destructive

Specify an HTTPS URL to receive Telegram bot updates via outgoing webhook, with optional secret token, certificate, allowed update types, and pending-update handling.

Instructions

Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.

Notes

  1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.

  2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.

  3. Ports currently supported for Webhooks: 443, 80, 88, 8443.

If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.

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": {
      "url": "<url>"
    },
    "name": "setWebhook"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesHTTPS url to send updates to. Use an empty string to remove webhook integration.
ip_addressNoThe fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
certificateNoUpload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
secret_tokenNoA secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
allowed_updatesNoA list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
max_connectionsNoThe maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
drop_pending_updatesNoPass True to drop all pending updates

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds real behavior beyond them: retry-and-give-up semantics on failed deliveries, the X-Telegram-Bot-Api-Secret-Token header used for verification, and the getUpdates conflict. It does not spell out that an existing webhook is replaced or how pending updates are handled outside the schema.

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?

Front-loaded purpose statement followed by a clearly numbered Notes block, which is easy to scan. The closing line recommending a guide to webhooks is filler that earns little place.

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?

Covers return value ('Returns True on success'), network constraints, and configuration interplay for a 7-parameter mutation tool with no output schema. Minor gaps remain on webhook replacement semantics and update backlog behavior, though drop_pending_updates partially covers the latter in the schema.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds value by warning that certificate must be uploaded as an InputFile and that sending a String will not work, plus the secret_token verification purpose. Other parameters are largely restated from the schema.

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 ('specify a URL and receive incoming updates via an outgoing webhook') and describes the resulting behavior (HTTPS POST with a JSON-serialized Update). An agent can distinguish this from getUpdates because note 1 explicitly names the mutual exclusion.

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

Usage Guidelines4/5

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

Gives concrete conditions: getUpdates stops working while a webhook is set, self-signed certs require uploading the certificate parameter, and only ports 443/80/88/8443 are supported. It does not explicitly route the agent to deleteWebhook or getWebhookInfo as alternatives, so it falls short of a full 5.

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