Skip to main content
Glama
APOGEOAPI
by APOGEOAPI

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
NameRequiredDescriptionDefault
qYesSearch term (e.g. "Buenos Aires", "Pampas", "Cordoba")
limitNoMax results (default: 10)

Implementation Reference

  • 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) }] };
      }
    );
  • 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) }] };
        }
      );
    }

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/APOGEOAPI/apogeoapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server