Skip to main content
Glama

read_doc

Access Laravel documentation files to retrieve specific implementation details, coding rules, or design system guides for development tasks.

Instructions

Read a specific documentation file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the documentation file relative to docs root

Implementation Reference

  • The read_doc tool handler function that reads a specific documentation file. It takes a file_path parameter, validates the file exists, reads its content using fs.readFileSync, and returns it as text content.
    async ({ file_path }) => {
      const filePath = path.join(DOCS_PATH, file_path);
    
      if (!fs.existsSync(filePath)) {
        throw new Error(`Documentation file not found: ${file_path}`);
      }
    
      const content = fs.readFileSync(filePath, 'utf-8');
    
      return {
        content: [{
          type: 'text',
          text: content,
        }],
      };
    }
  • index.js:97-121 (registration)
    Complete registration of the read_doc tool with the MCP server, including the tool name, description, input schema, and handler function.
    server.registerTool(
      'read_doc',
      {
        description: 'Read a specific documentation file',
        inputSchema: {
          file_path: z.string().describe('Path to the documentation file relative to docs root'),
        },
      },
      async ({ file_path }) => {
        const filePath = path.join(DOCS_PATH, file_path);
    
        if (!fs.existsSync(filePath)) {
          throw new Error(`Documentation file not found: ${file_path}`);
        }
    
        const content = fs.readFileSync(filePath, 'utf-8');
    
        return {
          content: [{
            type: 'text',
            text: content,
          }],
        };
      }
    );
  • Input schema definition for the read_doc tool, specifying that it requires a file_path string parameter.
    inputSchema: {
      file_path: z.string().describe('Path to the documentation file relative to docs root'),
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool reads a file but doesn't disclose behavioral traits such as what happens if the file doesn't exist (e.g., error handling), whether it requires authentication, rate limits, or the format of the returned content (e.g., plain text, structured data). This leaves significant gaps for a tool that interacts with files.

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 with no wasted words. It is front-loaded with the core action and resource, making it easy to scan. Every word earns its place by conveying essential information without redundancy.

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 simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It lacks details on error handling, return format, or operational context (e.g., file system access, permissions). For a read operation, this minimal description leaves too many unknowns for effective use by an AI agent.

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?

The input schema has 100% description coverage, with the parameter 'file_path' documented as 'Path to the documentation file relative to docs root'. The description adds no additional meaning beyond this, such as examples of valid paths or constraints. With high schema coverage, the baseline is 3, as the schema does the heavy lifting.

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 'Read a specific documentation file' clearly states the action (read) and resource (documentation file). It distinguishes from siblings like 'search_docs' (searching) and 'get_doc_structure' (structural overview), but doesn't explicitly contrast with 'get_domain_examples' or 'get_templates' which might also read files. The purpose is specific but could be more precise about what distinguishes it from all siblings.

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 (e.g., needing a valid file path), exclusions (e.g., not for searching or listing), or comparisons to siblings like 'search_docs' for broader queries or 'get_doc_structure' for metadata. Usage is implied by the name but not explicitly stated.

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/pujandan/mcp-laravel'

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