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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search text (min 2 chars) | |
| type | No | "city" or "query" | query |
| country | No | ISO country code to filter | |
| limit | No | Max suggestions |
Implementation Reference
- server.ts:126-141 (handler)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}`)); } );