Skip to main content
Glama

cities_distance

Calculate the distance in kilometers between two cities given their unique identifiers.

Instructions

Calculate the distance in kilometres between two cities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
city1YesFirst city UUID
city2YesSecond city UUID

Implementation Reference

  • Handler for the 'cities_distance' tool. Accepts two city UUIDs (city1, city2), calls client.cities.distance(city1, city2) to compute the distance in km, and returns the raw result as JSON text.
    server.tool(
      'cities_distance',
      'Calculate the distance in kilometres between two cities.',
      {
        city1: z.string().describe('First city UUID'),
        city2: z.string().describe('Second city UUID'),
      },
      async ({ city1, city2 }) => {
        const result = await client.cities.distance(city1, city2);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      },
    );
  • Input schema for cities_distance: two required string parameters (city1 and city2), each representing a city UUID.
    {
      city1: z.string().describe('First city UUID'),
      city2: z.string().describe('Second city UUID'),
    },
  • src/server.ts:99-110 (registration)
    Registration of the tool named 'cities_distance' on the McpServer instance, within the createServer function.
    server.tool(
      'cities_distance',
      'Calculate the distance in kilometres between two cities.',
      {
        city1: z.string().describe('First city UUID'),
        city2: z.string().describe('Second city UUID'),
      },
      async ({ city1, city2 }) => {
        const result = await client.cities.distance(city1, city2);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      },
    );
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It does not mention whether the distance is as the crow flies or driving distance, what happens if a city UUID is invalid, or any authentication or rate-limiting considerations.

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, clear sentence that is front-loaded with the core function. It is concise but could benefit from additional context without being verbose.

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?

The description lacks critical context for an agent: there is no output schema to describe the return format, no mention of error handling, and no indication of how the distance is calculated. For a tool with sibling tools offering richer data, this is insufficient.

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 for both parameters. The description adds no additional meaning beyond what the schema already provides, such as example values or format hints. Baseline 3 is appropriate.

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 uses a specific verb 'calculate' and resource 'distance between two cities' with the unit 'kilometres'. It is distinct from sibling tools like 'compare_cities' or 'get_city', which serve different purposes.

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?

No guidance is provided on when to use this tool versus alternatives, nor are there any exclusions or context for when not to use it. The agent is left to infer usage without explicit instructions.

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/930m310n/geomelon-mcp'

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