Skip to main content
Glama
leshchenko1979

Fast MCP Telegram

Invoke MTProto

invoke_mtproto
Destructive

Call any Telegram API method directly using MTProto. Handles functions not wrapped by other tools, with safety checks for destructive actions.

Instructions

Low-level Telegram API (MTProto) invoke for methods not wrapped by other tools. Dangerous methods require allow_dangerous=true. Success: API result dict or normalized error. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
method_full_nameYesTelegram API method, e.g. "messages.GetHistory" or "users.GetFullUser" (normalization applied).
params_jsonYesJSON object string of TL parameters as in Telegram API docs; nested TL uses "_": "typeName" discriminator.
allow_dangerousNoIf false, destructive methods (e.g. deletes) are blocked. Set true only when intended.
resolveNoIf true, resolve string/int peer-like fields to TL Input* entities before invoke.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
errorNo
operationNo
codeNo
paramsNo
exceptionNo
actionNo
error_codeNo
_No
idNo
dateNo
usersNo
chatsNo
messagesNo
resultNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.36.0
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / description
      Added value: +"Return type for ``invoke_mtproto``.\n\nThe success payload is a JSON-safe dict whose shape depends on the\nTelegram API method invoked.  Common top-level fields are listed here;\neverything else passes through as-is."
    • addedOutput schema / properties
      Added value: +{
      +  "_": {
      +    "type": "string"
      +  },
      +  "action": {
      +    "type": "string"
      +  },
      +  "chats": {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "code": {
      +    "type": "integer"
      +  },
      +  "date": {
      +    "type": "integer"
      +  },
      +  "error": {
      +    "type": "string"
      +  },
      +  "error_code": {
      +    "type": "string"
      +  },
      +  "exception": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "id": {
      +    "type": "integer"
      +  },
      +  "messages": {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "operation": {
      +    "type": "string"
      +  },
      +  "params": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "result": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "users": {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
  2. First observedv0.21.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already indicate openWorldHint and destructiveHint. The description adds useful behavioral context: destructive methods are blocked unless allow_dangerous=true, and success returns either an API result dict or normalized error. No contradiction with annotations.

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

Conciseness5/5

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

Three concise sentences, each earning its place: purpose, safety/success behavior, and a documentation link. Information is front-loaded and free of fluff.

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?

With an output schema present and annotations covering open-world/destructive traits, the description fully addresses necessary context for a low-level fallback tool. It clearly states the tool's scope, safety guardrail, and result format, plus a link to full docs.

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 already covers all parameters with descriptions, so baseline is 3. The description adds context beyond the schema by connecting allow_dangerous to the dangerous-methods mechanism, enhancing the agent's understanding of when and how to set it.

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?

Description clearly states it invokes low-level Telegram MTProto methods not wrapped by other tools, distinguishing it from the sibling high-level tools. The verb 'invoke' and resource 'MTProto' are specific and unambiguous.

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?

Explicitly says to use for methods not wrapped by other tools, positioning it as a fallback. It also provides critical guidance about dangerous methods requiring allow_dangerous=true, which helps the agent decide when this tool is appropriate versus safer alternatives.

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