search_menu_items
Find menu items by name or category to quickly locate specific drinks and food offerings from For Five Coffee café.
Instructions
Search for specific menu items by name or category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search term to find in menu items (name, description, or category) |
Implementation Reference
- server.js:1019-1046 (handler)Core handler function for 'search_menu_items' tool. Fetches menu data, filters items matching the query in name, description, or category, and returns structured JSON response.async searchMenuItems(query) { const menuData = await this.fetchMenuData(); const searchTerm = query.toLowerCase(); const results = menuData.items.filter( item => item.name.toLowerCase().includes(searchTerm) || item.description.toLowerCase().includes(searchTerm) || item.category.toLowerCase().includes(searchTerm) ); return { content: [ { type: 'text', text: JSON.stringify( { query, resultsFound: results.length, items: results, }, null, 2 ), }, ], }; }
- server.js:54-63 (schema)Input schema validation for the tool, requiring a 'query' string parameter.inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term to find in menu items (name, description, or category)', }, }, required: ['query'], },
- server.js:51-64 (registration)Registration of the 'search_menu_items' tool in the MCP ListToolsRequestSchema handler, including name, description, and schema.{ name: 'search_menu_items', description: 'Search for specific menu items by name or category', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term to find in menu items (name, description, or category)', }, }, required: ['query'], }, },
- server.js:105-106 (registration)Dispatch/registration case in the CallToolRequestSchema handler that invokes the searchMenuItems method.case 'search_menu_items': return await this.searchMenuItems(args.query);
- server.js:278-288 (registration)Secondary registration of the tool in the HTTP JSON-RPC /mcp tools/list response.{ name: 'search_menu_items', description: 'Search for specific menu items by name or category', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term to find in menu items' }, }, required: ['query'], }, },