list_sections
Retrieve all available sections from food service standards documents to navigate content structure and access preparation guidelines efficiently.
Instructions
List all available sections in the food service standards document
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.js:371-387 (handler)The core handler function that implements the 'list_sections' tool logic. It fetches sections from the PDF parser and formats a numbered list with details.async function listSections() { const sections = pdfParser.getSections(); let response = "Available sections in the food standards document:\n\n"; sections.forEach((section, index) => { response += `${index + 1}. ${section.name}\n`; response += ` Content length: ${section.contentLength} items\n`; response += ` Preview: ${section.preview}\n\n`; }); return { content: [{ type: "text", text: response }] }; }
- src/index.js:232-234 (registration)Tool dispatch/registration in the MCP CallToolRequestSchema handler switch statement.case "list_sections": { return await listSections(); }
- src/index.js:177-184 (schema)Tool definition registration in the toolDefinitions array used for ListToolsRequestSchema, including name, description, and input schema.{ name: "list_sections", description: "List all available sections in the food service standards document", inputSchema: { type: "object", properties: {}, required: [] }
- src/tools.js:307-323 (handler)Alternative class-based handler for 'list_sections' in GoodbookTools class (used in tests).async listSections() { const sections = this.pdfParser.getSections(); let response = "Available sections in the food standards document:\n\n"; sections.forEach((section, index) => { response += `${index + 1}. ${section.name}\n`; response += ` Content length: ${section.contentLength} items\n`; response += ` Preview: ${section.preview}\n\n`; }); return { content: [{ type: "text", text: response }] }; }
- src/tools.js:55-63 (schema)Tool schema definition in GoodbookTools.getToolDefinitions() method.{ name: "list_sections", description: "List all available sections in the food service standards document", inputSchema: { type: "object", properties: {}, required: [] } },