Skip to main content
Glama

Lookup City

lookup_city
Read-onlyIdempotent

Get all postal codes (ZIP codes) for a city, given its country and state or province. Country and state may be written as names or codes, "California" and "CA" both work, as do "United States" and "US".

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "city": "beverly hills",
      "state": "ca",
      "country": "us"
    },
    "name": "lookup_city"
  }
}

Input Schema

NameRequiredDescriptionDefault
cityYesCity name, e.g. "beverly hills". Spaces are fine, pass the name as written.
stateYesState, province or UK region, by name or abbreviation, "California" or "CA", "Ontario" or "ON", "England" or "eng".
countryYesCountry name or ISO 3166-1 alpha-2 code, "United States", "US", "Germany", "DE" all work.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / city / description
      Previous value: -"City name, e.g. \"beverly hills\". Spaces are fine — pass the name as written."New value: +"City name, e.g. \"beverly hills\". Spaces are fine, pass the name as written."
    • changedInput schema / properties / country / description
      Previous value: -"Country name or ISO 3166-1 alpha-2 code — \"United States\", \"US\", \"Germany\", \"DE\" all work."New value: +"Country name or ISO 3166-1 alpha-2 code, \"United States\", \"US\", \"Germany\", \"DE\" all work."
    • changedInput schema / properties / state / description
      Previous value: -"State, province or UK region, by name or abbreviation — \"California\" or \"CA\", \"Ontario\" or \"ON\", \"England\" or \"eng\"."New value: +"State, province or UK region, by name or abbreviation, \"California\" or \"CA\", \"Ontario\" or \"ON\", \"England\" or \"eng\"."
  2. Changed3 schema fields changed
    • addedOutput schema / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "country": {
      +        "description": "Full country name",
      +        "type": "string"
      +      },
      +      "country_abbreviation": {
      +        "description": "ISO 3166-1 alpha-2 country code",
      +        "type": "string"
      +      },
      +      "found": {
      +        "description": "Present and true on an answer; a miss is the found:false branch.",
      +        "enum": [
      +          true
      +        ],
      +        "type": "boolean"
      +      },
      +      "places": {
      +        "description": "List of postal codes in the city",
      +        "items": {
      +          "properties": {
      +            "lat": {
      +              "description": "Latitude coordinate",
      +              "type": "number"
      +            },
      +            "lon": {
      +              "description": "Longitude coordinate",
      +              "type": "number"
      +            },
      +            "name": {
      +              "description": "Place name (city)",
      +              "type": "string"
      +            },
      +            "post_code": {
      +              "description": "ZIP or postal code",
      +              "type": "string"
      +            },
      +            "state": {
      +              "description": "State or province name",
      +              "type": "string"
      +            },
      +            "state_abbreviation": {
      +              "description": "State or province abbreviation",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "post_code",
      +            "name",
      +            "lat",
      +            "lon"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "state": {
      +        "description": "State or province name",
      +        "type": "string"
      +      },
      +      "state_abbreviation": {
      +        "description": "State or province abbreviation",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "country",
      +      "country_abbreviation",
      +      "state",
      +      "state_abbreviation",
      +      "places"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "A miss or an unavailable upstream: found:false with a reason and a hint (the shape check-found-false-schemas.mjs expects).",
      +    "properties": {
      +      "found": {
      +        "enum": [
      +          false
      +        ],
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "found"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties
      Removed value: -{
      -  "country": {
      -    "description": "Full country name",
      -    "type": "string"
      -  },
      -  "country_abbreviation": {
      -    "description": "ISO 3166-1 alpha-2 country code",
      -    "type": "string"
      -  },
      -  "places": {
      -    "description": "List of postal codes in the city",
      -    "items": {
      -      "properties": {
      -        "lat": {
      -          "description": "Latitude coordinate",
      -          "type": "number"
      -        },
      -        "lon": {
      -          "description": "Longitude coordinate",
      -          "type": "number"
      -        },
      -        "name": {
      -          "description": "Place name (city)",
      -          "type": "string"
      -        },
      -        "post_code": {
      -          "description": "ZIP or postal code",
      -          "type": "string"
      -        },
      -        "state": {
      -          "description": "State or province name",
      -          "type": "string"
      -        },
      -        "state_abbreviation": {
      -          "description": "State or province abbreviation",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "post_code",
      -        "name",
      -        "lat",
      -        "lon"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "state": {
      -    "description": "State or province name",
      -    "type": "string"
      -  },
      -  "state_abbreviation": {
      -    "description": "State or province abbreviation",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "country",
      -  "country_abbreviation",
      -  "state",
      -  "state_abbreviation",
      -  "places"
      -]
  3. Changed1 schema field changed
    • changedOutput schema / properties / places / items / required
      Previous value: -[
      -  "post_code",
      -  "name",
      -  "state",
      -  "state_abbreviation",
      -  "lat",
      -  "lon"
      -]New value: +[
      +  "post_code",
      +  "name",
      +  "lat",
      +  "lon"
      +]
  4. Changed2 schema fields changed
    • changedInput schema / properties / city / description
      Previous value: -"City name (e.g. \"beverly+hills\" or \"beverly hills\")."New value: +"City name, e.g. \"beverly hills\". Spaces are fine — pass the name as written."
    • changedInput schema / properties / state / description
      Previous value: -"State or province, by name or abbreviation — \"California\" or \"CA\", \"Ontario\" or \"ON\"."New value: +"State, province or UK region, by name or abbreviation — \"California\" or \"CA\", \"Ontario\" or \"ON\", \"England\" or \"eng\"."
  5. Changed2 schema fields changed
    • changedInput schema / properties / country / description
      Previous value: -"ISO 3166-1 alpha-2 country code (e.g. \"us\", \"gb\")."New value: +"Country name or ISO 3166-1 alpha-2 code — \"United States\", \"US\", \"Germany\", \"DE\" all work."
    • changedInput schema / properties / state / description
      Previous value: -"State or province abbreviation (e.g. \"ca\" for California)."New value: +"State or province, by name or abbreviation — \"California\" or \"CA\", \"Ontario\" or \"ON\"."
  6. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "country": {
      +      "description": "Full country name",
      +      "type": "string"
      +    },
      +    "country_abbreviation": {
      +      "description": "ISO 3166-1 alpha-2 country code",
      +      "type": "string"
      +    },
      +    "places": {
      +      "description": "List of postal codes in the city",
      +      "items": {
      +        "properties": {
      +          "lat": {
      +            "description": "Latitude coordinate",
      +            "type": "number"
      +          },
      +          "lon": {
      +            "description": "Longitude coordinate",
      +            "type": "number"
      +          },
      +          "name": {
      +            "description": "Place name (city)",
      +            "type": "string"
      +          },
      +          "post_code": {
      +            "description": "ZIP or postal code",
      +            "type": "string"
      +          },
      +          "state": {
      +            "description": "State or province name",
      +            "type": "string"
      +          },
      +          "state_abbreviation": {
      +            "description": "State or province abbreviation",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "post_code",
      +          "name",
      +          "state",
      +          "state_abbreviation",
      +          "lat",
      +          "lon"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "state": {
      +      "description": "State or province name",
      +      "type": "string"
      +    },
      +    "state_abbreviation": {
      +      "description": "State or province abbreviation",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "country",
      +    "country_abbreviation",
      +    "state",
      +    "state_abbreviation",
      +    "places"
      +  ],
      +  "type": "object"
      +}
  7. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "city": "beverly hills",
      +    "country": "us",
      +    "state": "ca"
      +  },
      +  {
      +    "city": "london",
      +    "country": "gb",
      +    "state": "england"
      +  }
      +]
  8. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds the plural scope ("all" codes) and input-normalization behavior (names or codes accepted), but says nothing about match failure, partial results, or ambiguity handling for a read tool with an open-world hint.

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?

Two front-loaded sentences with the core behavior first and the normalization rule second; every sentence carries content. Minor redundancy with the schema's own parameter descriptions keeps it from a 5.

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?

With three required, fully described parameters and an output schema that covers return values, the description needs only to state the operation and input flexibility, which it does. Only the sibling relationship to lookup_zipcode is left unaddressed.

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 description coverage is 100%, so all three parameters are already documented with examples and name/code flexibility. The description restates the name-or-code acceptance for country and state rather than adding meaning beyond the schema, which lands it at the baseline 3.

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 gives a specific verb and resource ("Get all postal codes") plus the required inputs (city, country, state/province), which is enough to distinguish it from the reverse-direction sibling lookup_zipcode. It stops short of naming that sibling, so the differentiation is inferred rather than stated.

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?

Usage is implied: you have a city and want its postal codes. There is no explicit statement about when to prefer this over lookup_zipcode (the reverse lookup), nor any note about ambiguous or missing results.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.