Skip to main content
Glama
Telegram Ads MCP

Telegram Ads MCP

Upload ad media

tg_upload_media

Upload a local image or video to Telegram Ads and return its media ID for use in ad or website placements. Supports ad_photo, ad_video, and website_photo with defined size limits.

Instructions

Upload a local file to Telegram Ads and return its media ID. Limits: ad_photo JPEG/PNG up to 5 MiB and at least 640px wide; ad_video MP4 up to 20 MiB, 16:9, 3-60 seconds; website_photo JPEG/PNG up to 1 MiB and at least 150x150. Requires confirm: true and TG_ADS_MODE=write.

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": {
      "kind": "<kind>",
      "path": "<path>"
    },
    "name": "tg_upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
pathYesAbsolute path, or a path relative to the server process.
confirmNo
account_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag a non-read-only, open-world, non-destructive write; the description goes further by disclosing the exact format, size and dimension limits per kind, and the write-mode gate. It does not say whether uploads are idempotent or what happens on validation failure, so it stops short of full disclosure.

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?

Front-loads the action and return value, then packs the constraints into one tight limits sentence and one preconditions sentence. No filler or redundancy.

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?

For a mutation tool with no output schema, the description supplies the return value, the preconditions and the per-kind validation rules an agent needs to avoid a failed call. Only the account_id semantics and error/idempotency behavior are left unaddressed.

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?

With schema coverage at 25%, the description carries most of the weight for the kind enum, spelling out the per-value constraints for ad_photo, ad_video and website_photo, and it names the required confirm flag. The account_id parameter is never explained anywhere, leaving a real gap.

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 ("Upload a local file to Telegram Ads") plus the return value (media ID). No sibling tool performs uploads, so the purpose is unambiguous without needing an explicit contrast.

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?

Useful preconditions are given ("Requires confirm: true and TG_ADS_MODE=write"), which tells the agent when the call will succeed. However, it never states the workflow context - that this must run before tg_create_ad and that the returned media ID is the input to it - nor any when-not-to-use case.

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