Skip to main content
Glama

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) }] };
        }
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden of behavioral disclosure. It mentions the tool returns 'best matches' but doesn't explain ranking criteria, error conditions, rate limits, authentication needs, or what happens with ambiguous queries. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste - first explains what the tool does, second explains what it returns. Perfectly front-loaded and appropriately sized for the functionality.

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

Completeness3/5

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

For a search tool with no annotations and no output schema, the description provides basic functionality but lacks details about result format, ranking methodology, error handling, or performance characteristics. It's minimally adequate but has clear gaps given the tool's complexity.

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 the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the tool searches across multiple geographic entity types (countries, states, cities) and returns best matches, which is a specific verb+resource combination. However, it doesn't explicitly differentiate from siblings like 'search_countries' or 'get_cities' that might search specific entity types.

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?

The description implies this tool should be used for cross-type geographic searches, but doesn't provide explicit guidance on when to choose this versus alternatives like 'search_countries' or 'get_cities'. No when-not-to-use scenarios or prerequisites are mentioned.

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

Install Server

Other Tools

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