global_search
Search across countries, states, and cities simultaneously to find geographic entities matching your query. Returns top results from all location types in a single request.
Instructions
Search across countries, states, and cities in a single query. Returns the best matches from all geographic entity types.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Search term (e.g. "Buenos Aires", "Pampas", "Cordoba") | |
| limit | No | Max results (default: 10) |
Implementation Reference
- src/tools/search.ts:6-19 (handler)Implementation of the global_search tool, including registration and the execution handler logic.
server.tool( 'global_search', 'Search across countries, states, and cities in a single query. Returns the best matches from all geographic entity types.', { q: z.string().min(1).describe('Search term (e.g. "Buenos Aires", "Pampas", "Cordoba")'), limit: z.number().int().min(1).max(20).optional().describe('Max results (default: 10)'), }, async ({ q, limit }) => { const params = new URLSearchParams({ q }); if (limit) params.set('limit', String(limit)); const data = await apiGet(`/v1/api/geo/search?${params}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } ); - src/tools/search.ts:5-20 (registration)Function responsible for registering the search tools (including global_search) with the MCP server.
export function registerSearchTools(server: McpServer) { server.tool( 'global_search', 'Search across countries, states, and cities in a single query. Returns the best matches from all geographic entity types.', { q: z.string().min(1).describe('Search term (e.g. "Buenos Aires", "Pampas", "Cordoba")'), limit: z.number().int().min(1).max(20).optional().describe('Max results (default: 10)'), }, async ({ q, limit }) => { const params = new URLSearchParams({ q }); if (limit) params.set('limit', String(limit)); const data = await apiGet(`/v1/api/geo/search?${params}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } ); }