Skip to main content
Glama

Windows Automation MCP Server

read_file

Read file contents from specified paths to access text, configuration files, or document data for Windows automation workflows.

Instructions

读取文件内容

Input Schema

NameRequiredDescriptionDefault
pathYes文件路径

Input Schema (JSON Schema)

{ "properties": { "path": { "description": "文件路径", "type": "string" } }, "required": [ "path" ], "type": "object" }

Implementation Reference

  • The main handler function that implements the read_file tool logic by reading the file content using fs.promises.readFile and returning structured success/error response.
    async readFile(filePath) { try { const content = await fs.readFile(filePath, 'utf-8'); return { success: true, content, path: filePath }; } catch (error) { return { success: false, error: error.message }; } }
  • Input schema definition for the read_file tool, requiring a 'path' string parameter.
    { name: 'read_file', description: '读取文件内容', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '文件路径' }, }, required: ['path'], }, },
  • Dispatch/registration of the read_file tool within the executeTool method's switch statement, calling the handler.
    case 'read_file': return await this.readFile(args.path);
  • Tool capability check that includes 'read_file' for routing from the main server handler.
    canHandle(toolName) { const tools = ['read_file', 'write_file', 'list_directory', 'create_directory', 'delete_file', 'copy_file', 'move_file', 'search_files']; return tools.includes(toolName); }
  • src/server.js:97-102 (registration)
    Top-level tool dispatch logic in the MCP server that routes read_file calls to FileSystemTools based on canHandle.
    for (const [category, toolModule] of Object.entries(this.tools)) { if (toolModule.canHandle(name)) { result = await toolModule.executeTool(name, args); break; } }

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/eva-wanxin-git/windows-automation-mcp'

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