Skip to main content
Glama

read_doc

Access and read documentation files from a project directory to enable updates. Input project path and file name to retrieve the required document for modification or review.

Instructions

Read a documentation file (required before updating)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docFileYesName of the documentation file to read
projectPathYesPath to the project root directory

Implementation Reference

  • The handler function for the 'read_doc' tool. It reads the specified documentation file from the .handoff_docs directory, updates the global state with the file content and metadata, and returns the file content as text.
    case "read_doc": {
      const { projectPath, docFile } = request.params.arguments as {
        projectPath: string;
        docFile: string;
      };
    
      try {
        const filePath = `${projectPath}/.handoff_docs/${docFile}`;
        const content = await fs.readFile(filePath, "utf8");
    
        state.lastReadFile = docFile;
        state.lastReadContent = content;
        state.currentFile = docFile;
        state.inProgress = true;
    
        return {
          content: [
            {
              type: "text",
              text: content
            }
          ]
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(
          ErrorCode.InternalError,
          `Error reading documentation: ${errorMessage}`
        );
      }
    }
  • src/index.ts:432-449 (registration)
    The registration of the 'read_doc' tool in the listTools response, including its name, description, and input schema definition.
    {
      name: "read_doc",
      description: "Read a documentation file (required before updating)",
      inputSchema: {
        type: "object",
        properties: {
          projectPath: {
            type: "string",
            description: "Path to the project root directory"
          },
          docFile: {
            type: "string",
            description: "Name of the documentation file to read"
          }
        },
        required: ["projectPath", "docFile"]
      }
    },
  • The input schema definition for the 'read_doc' tool, specifying parameters projectPath and docFile as required strings.
    inputSchema: {
      type: "object",
      properties: {
        projectPath: {
          type: "string",
          description: "Path to the project root directory"
        },
        docFile: {
          type: "string",
          description: "Name of the documentation file to read"
        }
      },
      required: ["projectPath", "docFile"]
    }
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 of behavioral disclosure. It mentions the tool reads a file and is a prerequisite for updating, but doesn't describe what 'read' entails (e.g., returns content, metadata, or structure), any permissions needed, error handling, or side effects. For a tool with no annotations, this leaves significant behavioral gaps.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Read a documentation file') and adds a useful constraint ('required before updating'). There's no wasted text, and it's appropriately sized for the tool's complexity. It could be slightly more structured but is highly concise.

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

Completeness3/5

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

Given the tool has no annotations, no output schema, and moderate complexity (2 parameters), the description is minimally adequate. It covers the purpose and a usage hint but lacks details on behavior, return values, or error conditions. It's complete enough for basic understanding but leaves gaps that could hinder 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 schema description coverage is 100%, with both parameters ('docFile' and 'projectPath') clearly documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, such as file formats or path conventions. This meets the baseline of 3 since 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 clearly states the tool's purpose as 'Read a documentation file' with a specific verb and resource. It distinguishes itself from siblings like 'get_doc_content' by implying a prerequisite action ('required before updating'), though it doesn't explicitly differentiate from all similar tools. The purpose is specific but could be more distinct.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'required before updating', suggesting this tool should be used as a prerequisite for 'update_doc'. However, it doesn't explicitly state when to use this versus alternatives like 'get_doc_content' or 'search_docs', and offers no exclusions or broader context. The guidance is useful but incomplete.

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

Related 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/ryanjoachim/mcp-rtfm'

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