Skip to main content
Glama
WhenYouAreStrange

goodbook-mcp

list_sections

Retrieve all available sections from food service standards documents to quickly navigate preparation guidelines and compliance requirements.

Instructions

List all available sections in the food service standards document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary handler function implementing the list_sections MCP tool. Fetches sections using PDFParser.getSections() and formats a detailed text response listing all available sections with previews.
    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 }] }; }
  • Secondary handler function in GoodbookTools class implementing identical list_sections logic.
    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 }] }; }
  • Core helper method that generates the list of sections from parsed PDF content, providing name, length, and preview for each section.
    getSections() { return Object.keys(this.sections).map(name => ({ name, contentLength: this.sections[name].length, preview: this.sections[name].slice(0, 3).join(' ').substring(0, 200) + '...' })); }
  • JSON schema definition for the list_sections tool, specifying no input parameters are required.
    name: "list_sections", description: "List all available sections in the food service standards document", inputSchema: { type: "object", properties: {}, required: [] }
  • src/index.js:204-210 (registration)
    Registration handler for list_tools MCP request, which returns the toolDefinitions array including list_sections.
    server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received list_tools request"); await ensureInitialized(); return { tools: toolDefinitions }; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/WhenYouAreStrange/goodbook-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server