Skip to main content
Glama
secure-telegram-mcp

secure-telegram-mcp

Prepare media for sending

prepare_media

Stage a local media file and receive an opaque, time-limited handle for send_media, while the server confines paths to the permitted upload area and enforces size limits.

Instructions

Phase 1 of the two-phase media send. Stage a local file and receive an opaque, time-limited handle bound to this session and endpoint scope. The server confines the path to the permitted upload area and caps its size; files in the downloads directory are refused. Pass the returned handle to send_media; you never re-supply the raw path.

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": {
      "localPath": "<localPath>"
    },
    "name": "prepare_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
localPathYesLocal filesystem path to the media file to stage for upload. Accepted ONLY here (phase 1); the server confines it to the allowed upload area, size-caps it, and returns an opaque, time-limited handle. You never pass a raw path to send_media.

Output Schema

NameRequiredDescriptionDefault
handleYesOpaque, time-limited media handle bound to this session and scope; pass it to send_media verbatim.
mime_typeYesLocally sniffed MIME type (trusted; not Telegram-originated).
expires_atYesInstant the handle expires (TTL).
size_bytesYesStaged file size in bytes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing server-side enforcement: the path is confined to a permitted upload area, size is capped, the downloads directory is refused, and the handle is opaque, time-limited, and scoped to this session and endpoint. These are exactly the operational constraints an agent needs before calling a mutating, open-world tool.

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 tight sentences, front-loaded with the phase framing, then the behavioral guarantees, then the handoff instruction. Nothing is redundant and the ordering matches the order an agent needs the information.

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 one parameter, full schema coverage, an output schema, and annotations present, the remaining burden is behavioral disclosure and pipeline routing — both covered. Nothing an agent needs to call this correctly and follow up with send_media is missing.

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 would be 3, but the description adds real meaning about the single parameter: it is accepted only in phase 1, is confined to the allowed upload area, and must never be re-supplied later. The only minor gap is no mention of path format conventions.

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 ('Stage a local file') plus its position in a pipeline ('Phase 1 of the two-phase media send'), which cleanly separates it from send_media (phase 2) and download_media. The agent knows exactly what this does without opening the schema.

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?

Explicitly routes the agent forward: 'Pass the returned handle to send_media; you never re-supply the raw path' tells it this must precede send_media and that send_media does not take paths. It also states one exclusion (files in the downloads directory are refused). It stops short of a fully explicit when-not-to-use statement, so a 4 rather than a 5.

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