Skip to main content
Glama

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
NameRequiredDescriptionDefault
pathYesThe absolute path to the file to read

Implementation Reference

  • 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, }, ], }; }
  • 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"], }, },

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/JojoSlice/README-Gen-MCP-Server'

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