search_ingredients
Find ingredients by searching across name, description, SKU, and barcode to quickly locate products in inventory management systems.
Instructions
Search for ingredients using full-text search across name, description, SKU, and barcode
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Related entities to include | |
| limit | No | Maximum number of results (default: 25) | |
| query | Yes | Search query string |
Implementation Reference
- src/handlers/product-handlers.js:83-96 (handler)Implements the core logic of the 'search_ingredients' tool by performing a smart search via the InflowClient's listProducts method, with validation for required query parameter.async searchProducts(client, args) { if (!args.query) { return { success: false, error: 'query is required' }; } return await client.listProducts({ smart: args.query, limit: args.limit || 25, include: args.include }); },
- index.js:130-151 (registration)Registers the 'search_ingredients' tool with MCP server, including input schema definition and the wrapper handler that calls productHandlers.searchProducts.server.registerTool( 'search_ingredients', { description: 'Search for ingredients using full-text search across name, description, SKU, and barcode', inputSchema: { query: z.string().describe('Search query string'), limit: z.number().optional().describe('Maximum number of results (default: 25)'), include: z.string().optional().describe('Related entities to include') } }, async (args) => { const result = await productHandlers.searchProducts(inflowClient, args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } );