Skip to main content
Glama

search_cities

Read-onlyIdempotent

Find a municipality's IBGE code from its name.

Issuing resolves city_code from city and state by itself, so this is for the name that matches more than one city, or an address the API answered CITY_NOT_FOUND for. Returns at most 20, each with its code, name and state; ask the user which one when more than one fits. Read-only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "search_cities"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe start of the city's name, accents optional, e.g. santa rita.
stateNoNarrows to one UF, e.g. SP.
countryNoISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess.BR

Output Schema

NameRequiredDescriptionDefault
citiesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, non-destructive, closed-world behavior. The description adds genuinely useful detail beyond them: a hard cap of 20 results, the shape of each result (code, name, state), and the disambiguation protocol when more than one fits. The trailing 'Read-only' restates the annotation but does no harm.

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?

Front-loaded with the core purpose, then the routing condition, then the return contract. The hard line breaks are slightly awkward but the content is dense and nearly every clause earns its place; the closing 'Read-only' is redundant with annotations.

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?

An output schema exists, so return-field detail is optional, yet the description still communicates the result cap and the disambiguation step an agent must perform. Combined with the fallback trigger, an agent has everything needed to call it and interpret results correctly.

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 coverage is 100%, so name prefix semantics, UF narrowing, and the ISO country code with BR default are already documented. The description only alludes to 'city and state' and adds no format or edge-case detail beyond the schema, so baseline 3 applies.

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?

States a specific verb and resource: resolve a municipality's IBGE code from its name. It also indirectly distinguishes itself from the issuing flow by noting that issuing resolves city_code from city and state on its own, so this tool is the fallback. Not fully explicit about how it differs from sibling lookups like lookup_fiscal_code or lookup_taxpayer, but the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use conditions: a name that matches more than one city, or an address that returned CITY_NOT_FOUND. It also implies the primary alternative (issuing, which resolves city_code itself) and tells the agent what to do when multiple results come back — ask the user to disambiguate. Nothing is left to inference.

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.