Skip to main content
Glama

send_location

Send geographic coordinates to a Telegram chat. Specify latitude, longitude, chat ID, and optionally disable notification.

Instructions

Send a location to a Telegram chat.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesTarget chat ID.
latitudeYesLatitude of the location.
longitudeYesLongitude of the location.
disable_notificationNoSend silently.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
message_idNo
chat_idNo

Implementation Reference

  • The handler function that implements the send_location tool. It validates the chat, calls ctx.bot.send_location(), and returns a SendMediaResult.
    if allowed_tools is None or "send_location" in allowed_tools:
    
        @mcp.tool
        async def send_location(
            chat_id: int,
            latitude: float,
            longitude: float,
            disable_notification: bool = False,
        ) -> SendMediaResult:
            """Send a location to a Telegram chat.
    
            Args:
                chat_id: Target chat ID.
                latitude: Latitude of the location.
                longitude: Longitude of the location.
                disable_notification: Send silently.
            """
            if not ctx.is_chat_allowed(chat_id):
                result = SendMediaResult(ok=False, error=f"Chat {chat_id} is not allowed.")
                if ctx.audit_logger:
                    ctx.audit_logger.log(
                        "send_location",
                        {"chat_id": chat_id, "latitude": latitude, "longitude": longitude},
                        result.ok,
                        result.error,
                    )
                return result
    
            try:
                if ctx.rate_limiter:
                    await ctx.rate_limiter.acquire()
                msg = await ctx.bot.send_location(
                    chat_id=chat_id,
                    latitude=latitude,
                    longitude=longitude,
                    disable_notification=disable_notification,
                )
                result = SendMediaResult(ok=True, message_id=msg.message_id, chat_id=msg.chat.id)
            except (TelegramBadRequest, TelegramForbiddenError) as exc:
                result = SendMediaResult(ok=False, error=str(exc))
    
            if ctx.audit_logger:
                ctx.audit_logger.log(
                    "send_location",
                    {"chat_id": chat_id, "latitude": latitude, "longitude": longitude},
                    result.ok,
                    result.error,
                )
            return result
  • Schema for the return type of send_location (and other media tools).
    class SendMediaResult(ToolResponse):
        message_id: int | None = None
        chat_id: int | None = None
  • The registration function that conditionally registers send_location (and other media tools) on the FastMCP instance based on allowed_tools.
    def register_media_tools(
        mcp: FastMCP, ctx: BotContext, allowed_tools: set[str] | None = None
    ) -> None:
  • Import of register_media_tools in the server module.
    from .tools.media import register_media_tools
  • Call site where register_media_tools is invoked during server setup.
    register_media_tools(self._mcp, self._ctx, allowed_tools=at)
Behavior2/5

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

With no annotations, the description carries full burden. It only states the basic action, omitting behavioral details such as whether the message replaces previous locations, required bot permissions, or if live location is supported.

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?

The description is a single sentence with no wasted words. However, it could be improved by adding brief context about the tool's role among siblings.

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

Completeness3/5

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

Given the existence of an output schema, return values need not be explained. The description covers the core function but lacks details on parameter semantics and behavioral context, leaving it minimally complete.

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?

Schema coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions. It does not clarify usage of parameters like disable_notification.

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?

The description clearly states the verb 'send' and the resource 'location to a Telegram chat', distinguishing it from sibling tools like send_photo or send_message. The purpose is unambiguous.

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 offers no guidance on when to use this tool versus alternatives (e.g., send_location vs. send_venue). No context about prerequisites or typical usage scenarios is provided.

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/Py2755/aiogram-mcp'

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