Skip to main content
Glama
ai-yliu

Filesystem MCP Server

by ai-yliu

read_file

Retrieve the complete contents of a specified file by providing its path. Enables Claude AI to access and process file data within allowed filesystem operations.

Instructions

Read complete contents of a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to read

Implementation Reference

  • Handler function for the 'read_file' tool: extracts path, validates access, reads file content with fs.readFile, returns as text content.
    case 'read_file': { const { path: filePath } = request.params.arguments as { path: string }; validatePath(filePath); const content = await fs.readFile(filePath, 'utf8'); return { content: [ { type: 'text', text: content, }, ], }; }
  • Input schema for read_file tool defining the required 'path' parameter.
    inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the file to read', }, }, required: ['path'], },
  • src/index.ts:95-108 (registration)
    Registration of the read_file tool in the ListTools response, including name, description, and schema.
    { name: 'read_file', description: 'Read complete contents of a file', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the file to read', }, }, required: ['path'], }, },

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/ai-yliu/filesystem-mcp-server'

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