suggest-metadata
Get autocomplete suggestions for OpenMetadata entity names based on query text. Improve search efficiency by narrowing down results to specific entity types.
Instructions
Get autocomplete suggestions for OpenMetadata entity names
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Query text for autocomplete suggestions | |
| index | No | Restrict suggestions to a specific entity index | |
| size | No | Number of suggestions to return | |
| field | No | Field for suggestions (e.g. 'name') |
Implementation Reference
- src/tools/search.ts:59-66 (handler)The handler function that executes the suggest-metadata tool logic. Makes a GET request to /search/suggest on the OpenMetadata API with query, index, size, and field parameters.
export async function suggestMetadata(params: z.infer<typeof suggestMetadataSchema>) { return omClient.get("/search/suggest", { q: params.q, index: params.index, size: Math.min(params.size ?? 10, 25), field: params.field, }); } - src/tools/search.ts:47-57 (schema)Zod schema defining input parameters for suggest-metadata: q (required query), index (optional entity type), size (default 10, max enforced to 25), and field (optional suggestion field).
export const suggestMetadataSchema = z.object({ q: z.string().describe("Query text for autocomplete suggestions"), index: z.enum([ "table_search_index", "topic_search_index", "dashboard_search_index", "pipeline_search_index", "mlmodel_search_index", "container_search_index", "query_search_index", "user_search_index", "team_search_index", "glossary_term_search_index", "tag_search_index", "data_product_search_index", ]).optional().describe("Restrict suggestions to a specific entity index"), size: z.coerce.number().optional().default(10).describe("Number of suggestions to return"), field: z.string().optional().describe("Field for suggestions (e.g. 'name')"), }); - src/index.ts:170-170 (registration)Registration of the suggest-metadata tool on the MCP server under the 'search' category, using the schema shape and handler wrapped with error handling.
tool("suggest-metadata", "Get autocomplete suggestions for OpenMetadata entity names", suggestMetadataSchema.shape, wrapToolHandler(suggestMetadata)); - src/index.ts:159-164 (helper)Helper registration function that registers the tool in the registry with its category, and conditionally registers on the MCP server if the category is enabled.
function tool(name: string, description: string, schema: any, handler: any): void { registry.register(name, description, currentCategory); if (registry.isEnabled(currentCategory)) { server.tool(name, description, schema, handler); } }