Skip to main content
Glama
discava

discava – Business Directory for AI

suggest

Provides autocomplete suggestions for cities or business categories to help users quickly find relevant local businesses in the discava directory.

Instructions

Autocomplete for cities or categories/business names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch text (min 2 chars)
typeNo"city" or "query"query
countryNoISO country code to filter
limitNoMax suggestions

Implementation Reference

  • The 'suggest' tool is registered using `server.tool` and handles the request by building URL parameters and calling the `api` function with the `/suggest` endpoint.
    server.tool(
      'suggest',
      'Autocomplete for cities or categories/business names.',
      {
        query: z.string().describe('Search text (min 2 chars)'),
        type: z.enum(['city', 'query']).optional().default('query').describe('"city" or "query"'),
        country: z.string().optional().describe('ISO country code to filter'),
        limit: z.number().optional().default(10).describe('Max suggestions'),
      },
      async ({ query, type, country, limit }) => {
        const params = new URLSearchParams({ q: query, type });
        if (country) params.set('country', country);
        if (limit) params.set('limit', String(limit));
        return jsonContent(await api(`/suggest?${params}`));
      }
    );

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/discava/mcp-server'

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