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
| Name | Required | Description | Default |
|---|---|---|---|
| docFile | Yes | Name of the documentation file to read | |
| projectPath | Yes | Path to the project root directory |
Implementation Reference
- src/index.ts:922-952 (handler)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"] } },
- src/index.ts:435-448 (schema)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"] }