Skip to main content
Glama
kennyckk

KMB Bus MCP Server

find_buses_to_destination

Search for KMB and Long Win bus routes that travel to a specific destination in Hong Kong, such as Central, Mong Kok, or Airport.

Instructions

Find bus routes that go to a specified destination.

Args:
    destination: The destination to search for (e.g., "Central", "Mong Kok", "Airport")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'find_buses_to_destination' tool. Decorated with @mcp.tool() for automatic registration in the MCP server. Uses type hints and docstring for schema. Calls helper function to fetch routes and formats output.
    @mcp.tool()
    async def find_buses_to_destination(destination: str) -> str:
        """Find bus routes that go to a specified destination.
        
        Args:
            destination: The destination to search for (e.g., "Central", "Mong Kok", "Airport")
        """
        matching_routes = await find_routes_by_destination(destination)
        
        if not matching_routes:
            return f"Could not find any routes going to '{destination}'"
        
        # Group routes by origin for better readability
        routes_by_origin = {}
        
        for route in matching_routes:
            origin = route.get("orig_en", "Unknown")
            if origin not in routes_by_origin:
                routes_by_origin[origin] = []
            
            routes_by_origin[origin].append({
                "route": route["route"],
                "destination": route.get("dest_en", "Unknown"),
                "bound": "Inbound" if route["bound"] == "I" else "Outbound"
            })
        
        # Format the results
        results = [f"Bus routes going to '{destination}':"]
        
        for origin, routes in routes_by_origin.items():
            results.append(f"\nFrom {origin}:")
            for route_info in routes:
                results.append(f"- Route {route_info['route']} to {route_info['destination']} ({route_info['bound']})")
        
        return "\n".join(results)
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 states the action ('Find bus routes') but lacks details on traits like response format, pagination, rate limits, error conditions, or whether it's a read-only operation. This is a significant gap 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.

Conciseness4/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 parameter details. The two sentences are efficient and focused, with no wasted words, though the structure is simple without explicit sections.

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 tool's moderate complexity (1 parameter, no annotations, but with an output schema), the description is partially complete. It covers the purpose and parameter semantics adequately, but lacks behavioral context and usage guidelines. The presence of an output schema reduces the need to explain return values, but more guidance is still warranted.

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 context beyond the input schema, which has 0% description coverage. It explains the 'destination' parameter with examples ('Central', 'Mong Kok', 'Airport'), clarifying the expected input format and scope. This compensates well for the schema's lack of documentation.

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 ('Find') and resource ('bus routes'), and specifies the target ('to a specified destination'). It doesn't explicitly differentiate from sibling tools like 'get_all_routes_at_stop' or 'get_route_stops_info', but the destination-focused search is reasonably distinct.

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. It doesn't mention sibling tools like 'find_stop_by_name' or 'get_all_routes_at_stop', nor does it specify prerequisites or exclusions (e.g., whether it requires real-time data or works with schedules only).

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/kennyckk/mcp_hkbus'

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