Skip to main content
Glama

city_context

Retrieve a city together with its full country and region details in one call. Supports multilingual names for city, country, and region.

Instructions

Get a city together with its full country and region details in one call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCity UUID
preferredLanguagesNoComma-separated BCP 47 language tags

Implementation Reference

  • src/server.ts:230-246 (registration)
    Registration of the 'city_context' tool via server.tool() with its schema and handler.
    server.tool(
      'city_context',
      'Get a city together with its full country and region details in one call.',
      {
        id: z.string().describe('City UUID'),
        preferredLanguages: z.string().optional().describe('Comma-separated BCP 47 language tags'),
      },
      async ({ id }) => {
        const city = await client.cities.get(id);
        const [country, region] = await Promise.all([
          client.countries.get(city.countryId),
          city.regionId ? client.regions.get(city.regionId) : Promise.resolve(null),
        ]);
        const result = { city, country, region };
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      },
    );
  • Input schema for the 'city_context' tool: expects a required 'id' (City UUID string) and an optional 'preferredLanguages' string.
    {
      id: z.string().describe('City UUID'),
      preferredLanguages: z.string().optional().describe('Comma-separated BCP 47 language tags'),
    },
  • Handler function for 'city_context': fetches the city by UUID, then concurrently fetches the country and (optionally) region, returning all combined.
      async ({ id }) => {
        const city = await client.cities.get(id);
        const [country, region] = await Promise.all([
          client.countries.get(city.countryId),
          city.regionId ? client.regions.get(city.regionId) : Promise.resolve(null),
        ]);
        const result = { city, country, region };
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      },
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool returns combined data (city, country, region), but does not mention potential behavior like error handling if the city ID is invalid, or whether the operation is read-only (likely it is). Adequate but could be more explicit about side effects or assumptions.

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 sentence of 12 words, front-loading the verb 'Get' and clearly stating the combined result. No extraneous words; every word serves a purpose.

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 no output schema and no annotations, the description gives a good picture of what the tool returns (city, country, region). It lacks details on error cases or structure of the response, but for a simple retrieval tool with 2 parameters, it is mostly 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?

Input schema covers 100% of parameters with descriptions. The tool description does not add extra meaning beyond the schema; it doesn't explain how 'preferredLanguages' affects results or format of UUID. Baseline 3 is appropriate as schema already provides basic info.

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 tool's purpose: retrieving a city along with its country and region details in a single call. This is specific (verb 'get', resource 'city', scope 'full country and region') and distinguishes it from siblings like 'get_city', 'get_country', or 'get_region' which would require multiple calls.

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 use when you need all three pieces of data together, but does not explicitly say when to use versus alternatives like calling 'get_city', 'get_country', and 'get_region' separately. No guidance on when not to use or prerequisites.

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