Skip to main content
Glama

local.descriptions

Fetch detailed descriptions for local businesses and points of interest using location IDs to support research and decision-making.

Instructions

Brave Local Search AI descriptions: fetch descriptions for up to 20 location ids

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYes

Implementation Reference

  • The async handler function for the 'local.descriptions' tool. It constructs a URLSearchParams from the input ids array and fetches AI descriptions from the Brave Local Search API endpoint, returning the JSON response as text content.
    async handler(args) {
      const usp = new URLSearchParams();
      for (const id of args.ids as string[]) usp.append('ids', id);
      const data = await braveGet('https://api.search.brave.com/res/v1/local/descriptions', Object.fromEntries(usp.entries()));
      return { content: [{ type: 'text', text: JSON.stringify(data) }] };
    },
  • Input schema definition for the 'ids' array parameter, requiring 1-20 string location IDs. Shared with 'local.pois' tool.
    const idsArraySchema = {
      type: 'object',
      properties: {
        ids: {
          type: 'array',
          items: { type: 'string' },
          minItems: 1,
          maxItems: 20,
        },
      },
      required: ['ids'],
      additionalProperties: false,
    } as const;
  • src/index.ts:111-121 (registration)
    The tool definition object registered in the toolDefs array, including name, description, inputSchema reference, and inline handler.
    {
      name: 'local.descriptions',
      description: 'Brave Local Search AI descriptions: fetch descriptions for up to 20 location ids',
      inputSchema: idsArraySchema,
      async handler(args) {
        const usp = new URLSearchParams();
        for (const id of args.ids as string[]) usp.append('ids', id);
        const data = await braveGet('https://api.search.brave.com/res/v1/local/descriptions', Object.fromEntries(usp.entries()));
        return { content: [{ type: 'text', text: JSON.stringify(data) }] };
      },
    },
  • Utility function to make authenticated fetch requests to Brave Search APIs, handling params, API key from env, and error cases. Used by all tool handlers including 'local.descriptions'.
    async function braveGet(url: string, params: Record<string, string | number | boolean | undefined>) {
      const apiKey = process.env.EARCH_MCP_API_KEY || process.env.BRAVE_API_KEY || process.env.BRAVE_SEARCH_API_KEY;
      if (!apiKey) {
        throw new Error('Missing API key. Set EARCH_MCP_API_KEY or BRAVE_API_KEY.');
      }
      const headers: Record<string, string> = {
        Accept: 'application/json',
        'Accept-Encoding': 'gzip',
        'X-Subscription-Token': apiKey,
      };
    
      const usp = new URLSearchParams();
      for (const [k, v] of Object.entries(params)) {
        if (v === undefined) continue;
        usp.set(k, String(v));
      }
      const endpoint = `${url}?${usp.toString()}`;
      const res = await fetch(endpoint, { headers });
      if (!res.ok) {
        const body = await res.text().catch(() => '');
        throw new Error(`Brave API error ${res.status}: ${body}`);
      }
      return res.json();
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions fetching descriptions for location IDs with a limit of 20, but doesn't specify what 'descriptions' contain (e.g., text, metadata), how results are returned, error handling, or any rate limits. This leaves significant gaps for a tool with one required parameter.

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?

The description is a single, efficient sentence that front-loads the key action ('fetch descriptions') and constraint ('up to 20'). There's no wasted verbiage, though it could be slightly more structured (e.g., separating purpose from limitations).

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

Completeness2/5

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

Given no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what 'descriptions' entail (e.g., text summaries, attributes), how results are formatted, or any behavioral nuances. For a tool fetching data with a required parameter, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must compensate. It only implies that 'ids' are 'location ids' and there's a limit of 20, but doesn't explain what format these IDs should be (e.g., numeric, alphanumeric), where they come from, or what happens if invalid IDs are provided. This adds minimal value beyond the schema's structural constraints.

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 verb 'fetch' and the resource 'descriptions for location ids', specifying the scope 'up to 20'. It distinguishes from siblings like 'local.pois' (likely points of interest) and web tools by focusing on descriptions for location IDs. However, it doesn't explicitly differentiate from all siblings (e.g., 'web.rich' might also provide descriptions).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'local.pois' (which might return different location data) or 'web.search' (which might search more broadly). There's no context about prerequisites, limitations, or typical use cases.

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/nanameru/search-mcp'

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