Skip to main content
Glama

search_cities

Read-only

Case-insensitive substring search over the global cities catalog. Useful to resolve a human-readable location into a numeric city_id before creating an offline or mixed event.

Each result is preloaded with its region and country to avoid N+1 queries on the caller side.

Behavior:

  • Matches name LIKE "%q%" (substring, case-insensitive in MySQL utf8_general_ci).

  • Wildcards % and _ in q are escaped — no client-side wildcard matching.

  • Optional country_iso_code narrows results to a single country (case-insensitive).

  • Results are ordered by name ASC.

  • Capped at 20 results (no pagination — refine the query instead).

  • Response is cacheable for 30 minutes (Cache-Control: public, max-age=1800).

Rate limit: 100 requests/minute per IP (600 for whitelisted IPs).

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": {
      "q": "<q>"
    },
    "name": "search_cities"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesSubstring to search for in the city name. Must be non-blank. Wildcards `%` and `_` are escaped before matching.
country_iso_codeNoOptional ISO 3166-1 alpha-2 country code to narrow results (case-insensitive).

Output Schema

NameRequiredDescriptionDefault
dataYes
statusYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/destructive annotations, it discloses matching semantics (LIKE '%q%' under utf8_general_ci), wildcard escaping, ordering, a hard 20-result cap with no pagination, a 30-minute cache directive, and per-IP rate limits. These are exactly the non-obvious constraints an agent needs before calling.

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?

Purpose is front-loaded in the first sentence, then a clearly delimited Behavior block. The bold markdown and section headers are slightly heavier than necessary, but every bullet (escaping, cap, cache, rate limit) carries operational weight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description needn't enumerate return fields, yet it still mentions that results are preloaded with `region` and `country`. Combined with the result cap, ordering, and rate limits, nothing material is missing for a two-parameter lookup tool.

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%, and the schema already documents substring matching, wildcard escaping, and the ISO code. The description largely restates those semantics plus behavioral traits (ordering, cap) rather than adding new per-parameter meaning, so the baseline 3 applies.

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 opens with a specific verb and resource ('Case-insensitive substring search over the global `cities` catalog') and states the downstream intent (resolve a location into a `city_id` before creating an event). No sibling tool in the list performs catalog search, so there is nothing to confuse it with.

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

Usage Guidelines4/5

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

It gives an explicit use case: resolve a human-readable location into a numeric `city_id` before creating an offline or mixed event. It does not name an alternative or a when-not-to-use case, but the sibling list contains no competing search tool, so the guidance is clear in context.

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.

Resources