read_file
Read file contents to analyze project structure and generate comprehensive README documentation with proper formatting and sections.
Instructions
Read the contents of a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The absolute path to the file to read |
Implementation Reference
- src/index.ts:486-497 (handler)The handler function for the 'read_file' tool. It extracts the 'path' from arguments, reads the file content using Node.js fs/promises readFile, and returns it formatted as MCP tool content.case "read_file": { const { path } = args as { path: string }; const content = await readFile(path, "utf-8"); return { content: [ { type: "text", text: content, }, ], }; }
- src/index.ts:413-422 (schema)Input schema definition for the 'read_file' tool, specifying a required 'path' parameter of type string with description.inputSchema: { type: "object", properties: { path: { type: "string", description: "The absolute path to the file to read", }, }, required: ["path"], },
- src/index.ts:410-423 (registration)The tool registration object for 'read_file' provided in the ListTools response, including name, description, and input schema.{ name: "read_file", description: "Read the contents of a file", inputSchema: { type: "object", properties: { path: { type: "string", description: "The absolute path to the file to read", }, }, required: ["path"], }, },