Skip to main content
Glama
WhenYouAreStrange

goodbook-mcp

get_section_content

Retrieve specific content sections from food standards documents to access preparation guidelines and service requirements.

Instructions

Get content from a specific section of the food standards document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes
section_nameYesName of the section to retrieve content from

Implementation Reference

  • The core handler function that implements the get_section_content tool logic: retrieves content from the specified section using the PDF parser, handles errors, and formats the response as MCP content.
    async function getSectionContent(section_name, limit) { const content = pdfParser.getContent(section_name, limit); if (content.error) { return { content: [{ type: "text", text: `Error: ${content.error}` }] }; } return { content: [{ type: "text", text: `Content from section "${content.section}":\n\n${content.content}` }] }; }
  • Zod schema defining the input parameters for the get_section_content tool: section_name (required string) and limit (optional number, default 1000).
    const getSectionContentSchema = z.object({ section_name: z.string().describe("Name of the section to retrieve content from"), limit: z.number().default(1000).describe("Maximum number of characters to return"), });
  • src/index.js:187-190 (registration)
    Tool registration in the list_tools response: defines name, description, and converts Zod schema to JSON schema for MCP protocol.
    name: "get_section_content", description: "Get content from a specific section of the food standards document", inputSchema: zodToJsonSchema(getSectionContentSchema) },
  • Dispatch handler in the main CallToolRequestSchema switch statement that validates input with the schema and invokes the getSectionContent function.
    case "get_section_content": { const { section_name, limit } = getSectionContentSchema.parse(args); return await getSectionContent(section_name, limit); }
  • Alternative class-based handler method in GoodbookTools class with identical logic, possibly for a different usage or refactored version.
    async getSectionContent(sectionName, limit = 1000) { const content = this.pdfParser.getContent(sectionName, limit); if (content.error) { return { content: [{ type: "text", text: `Error: ${content.error}` }] }; } return { content: [{ type: "text", text: `Content from section "${content.section}":\n\n${content.content}` }] }; }

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