Skip to main content
Glama
Pranav-Karra-3301

CATA Bus MCP Server

vehicle_positions_tool

Track live bus positions on specific routes to monitor real-time vehicle locations, coordinates, bearing, and speed for CATA transportation services.

Instructions

Get current positions of vehicles on a specific route.

Args: route_id: The route ID to filter by (e.g., "BL" for Blue Loop)

Returns: List of vehicle positions with ID, coordinates, bearing, and speed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
route_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler and registration for vehicle_positions_tool. Includes input schema via type hints and docstring, ensures data initialization, and calls the core vehicle_positions helper function.
    @mcp.tool
    async def vehicle_positions_tool(route_id: str) -> list[dict[str, Any]]:
        """Get current positions of vehicles on a specific route.
    
        Args:
            route_id: The route ID to filter by (e.g., "BL" for Blue Loop)
    
        Returns:
            List of vehicle positions with ID, coordinates, bearing, and speed
        """
        await ensure_initialized()
        return await vehicle_positions(realtime_poller.data, route_id)
  • Core helper function implementing the vehicle positions logic: filters realtime vehicle data by route_id and formats output with vehicle_id, lat, lon, bearing, and speed.
    async def vehicle_positions(realtime_data: RealtimeData, route_id: str) -> list[dict[str, Any]]:
        """
        Get current positions of vehicles on a specific route.
    
        Args:
            realtime_data: The GTFS realtime data.
            route_id: The route ID to filter by.
    
        Returns:
            List of vehicle positions with ID, coordinates, bearing, and speed.
        """
        vehicles = []
    
        for vehicle_id, position in realtime_data.vehicle_positions.items():
            # Filter by route if specified
            if position.route_id == route_id:
                vehicles.append(
                    {
                        "vehicle_id": vehicle_id,
                        "lat": position.latitude,
                        "lon": position.longitude,
                        "bearing": position.bearing,
                        "speed_mps": position.speed,
                    }
                )
    
        return vehicles
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes a read operation ('Get') but does not cover important aspects such as whether this requires authentication, rate limits, data freshness, error handling, or pagination. The description adds minimal behavioral context beyond the basic operation, which is insufficient for a tool with no annotation coverage.

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 appropriately sized and front-loaded, with the core purpose stated first, followed by structured Args and Returns sections. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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?

Given the tool's moderate complexity (single parameter, read-only operation) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers purpose, parameter semantics, and return structure, though it lacks behavioral details like authentication or rate limits. With output schema reducing the need to explain returns, the description is adequate but could be more comprehensive.

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?

The description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains that route_id is 'The route ID to filter by' and provides an example ('e.g., "BL" for Blue Loop'), clarifying its purpose and format. With only one parameter, this compensation is adequate, though not exhaustive (e.g., no validation rules).

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 tool's purpose with a specific verb ('Get') and resource ('current positions of vehicles on a specific route'). It distinguishes from siblings like list_routes_tool (which lists routes) and next_arrivals_tool (which provides arrival times), though it doesn't explicitly name these alternatives. The purpose is not vague or tautological.

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?

The description implies usage context by specifying 'on a specific route' and providing an example route_id, but it does not explicitly state when to use this tool versus alternatives like next_arrivals_tool or trip_alerts_tool. There is no guidance on prerequisites, exclusions, or named alternatives, leaving usage somewhat inferred rather than clearly defined.

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/Pranav-Karra-3301/catabus-mcp'

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