Skip to main content
Glama
bobidk91-ops

Telegram MCP Server

by bobidk91-ops

send_photo

Send photos to Telegram channels using a URL or file path, with optional caption formatting in HTML or Markdown for automated bot messaging.

Instructions

Send a photo to the Telegram channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
captionNoPhoto caption
parse_modeNoParse mode for caption
photoYesPhoto URL or file path

Implementation Reference

  • The handler function for the 'send_photo' tool. It extracts photo_url, caption, and parse_mode from arguments, sends the photo to the Telegram channel using bot.sendPhoto, and returns a success message with details.
    case 'send_photo': {
      const { photo_url, caption, parse_mode = 'HTML' } = args as {
        photo_url: string;
        caption?: string;
        parse_mode?: string;
      };
      
      const result = await bot.sendPhoto(CHANNEL_ID, photo_url, {
        caption,
        parse_mode: parse_mode as any,
      });
      
      return {
        content: [
          {
            type: 'text',
            text: `āœ… Photo sent successfully!\n\nšŸ“± Channel: ${CHANNEL_ID}\nšŸ“ Message ID: ${result.message_id}\nšŸ“· Photo: ${result.photo?.[0]?.file_id}\nšŸ“„ Caption: ${caption || 'No caption'}`,
          },
        ],
      };
    }
  • src/index.ts:80-102 (registration)
    Registers the 'send_photo' tool in the list of available tools, including its description and input schema definition.
    {
      name: 'send_photo',
      description: 'Send a photo to the Telegram channel',
      inputSchema: {
        type: 'object',
        properties: {
          photo_url: {
            type: 'string',
            description: 'URL of the photo to send',
          },
          caption: {
            type: 'string',
            description: 'Photo caption',
          },
          parse_mode: {
            type: 'string',
            enum: ['HTML', 'Markdown'],
            description: 'Parse mode for the caption',
          },
        },
        required: ['photo_url'],
      },
    },
  • Defines the input schema for the 'send_photo' tool, specifying photo_url as required, and optional caption and parse_mode.
    inputSchema: {
      type: 'object',
      properties: {
        photo_url: {
          type: 'string',
          description: 'URL of the photo to send',
        },
        caption: {
          type: 'string',
          description: 'Photo caption',
        },
        parse_mode: {
          type: 'string',
          enum: ['HTML', 'Markdown'],
          description: 'Parse mode for the caption',
        },
      },
      required: ['photo_url'],
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Send') but doesn't cover critical aspects like required permissions, rate limits, error conditions, or what happens on success (e.g., message ID returned). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse for an AI agent.

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

Completeness2/5

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

Given this is a mutation tool (sending data) with no annotations and no output schema, the description is incomplete. It doesn't explain behavioral traits, error handling, or return values, which are crucial for safe and effective tool invocation in this context.

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?

The input schema has 100% description coverage, so parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying 'photo' is required (matching the schema's required field). This meets the baseline for high schema coverage without adding extra value.

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 description clearly states the action ('Send') and resource ('a photo to the Telegram channel'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'send_message' or 'send_poll', which would require mentioning it's specifically for photos rather than text or other media types.

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?

The description provides no guidance on when to use this tool versus alternatives like 'send_message' or other send_* siblings. It lacks context about prerequisites (e.g., channel access), exclusions, or comparative use cases, leaving the agent to infer usage from the tool name alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bobidk91-ops/telegram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server