Skip to main content
Glama
WhenYouAreStrange

goodbook-mcp

get_section_content

Retrieve specific food standards and preparation guidelines from PDF documents by section name, enabling targeted access to regulatory content.

Instructions

Get content from a specific section of the food standards document

Input Schema

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

Implementation Reference

  • The handler function that executes the get_section_content tool. It calls the PDF parser's getContent method and formats the response as MCP content blocks.
    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 input schema validation for the get_section_content tool parameters.
    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:186-190 (registration)
    Tool registration in the MCP server's tool definitions array, including name, description, and input schema.
    {
      name: "get_section_content",
      description: "Get content from a specific section of the food standards document",
      inputSchema: zodToJsonSchema(getSectionContentSchema)
    },
  • Core helper method in PDFParser class that retrieves the actual content from a named section or all content, limiting by character count.
    getContent(sectionName = null, limit = 1000) {
      if (!this.parsedContent) {
        return { error: 'PDF content not loaded' };
      }
    
      if (sectionName) {
        const section = this.sections[sectionName];
        if (!section) {
          return { error: `Section '${sectionName}' not found` };
        }
        return {
          section: sectionName,
          content: section.join('\n').substring(0, limit)
        };
      }
    
      return {
        section: 'all',
        content: this.parsedContent.substring(0, limit)
      };
    }
  • Alternative class-based handler for get_section_content tool in GoodbookTools class, similar logic delegating to PDF parser.
    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}`
        }]
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get content') but doesn't reveal any behavioral traits such as whether this is a read-only operation, potential rate limits, error conditions, or the format of returned content. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly, though it could benefit from additional context for completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, usage guidelines, and parameter nuances, making it inadequate for an agent to fully understand how to invoke the tool correctly or interpret results, especially without an output schema to clarify return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, with 'section_name' documented but 'limit' lacking a description. The description adds minimal value beyond the schema by implying content retrieval but doesn't clarify parameter semantics, such as what 'section_name' refers to (e.g., exact match vs. substring) or how 'limit' affects results. It partially compensates but doesn't fully address the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('content from a specific section of the food standards document'), making the purpose evident. However, it doesn't explicitly distinguish this tool from sibling tools like 'list_sections' or 'search_food_standards', which might also retrieve content or sections, leaving some ambiguity about its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing to know the section name beforehand, or compare it to siblings like 'list_sections' for browsing sections or 'search_food_standards' for broader searches, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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