Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

write_file

Create or update files on Windows systems by specifying a path and content. This tool enables automated file management within the Windows Automation MCP Server environment.

Instructions

写入文件内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes文件路径
contentYes文件内容

Implementation Reference

  • The core handler function that executes the file writing logic using fs.promises.writeFile, with error handling.
    async writeFile(filePath, content) { try { await fs.writeFile(filePath, content, 'utf-8'); return { success: true, path: filePath, message: '文件写入成功' }; } catch (error) { return { success: false, error: error.message }; } }
  • The tool definition including name, description, and input schema (path and content required strings).
    { name: 'write_file', description: '写入文件内容', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '文件路径' }, content: { type: 'string', description: '文件内容' }, }, required: ['path', 'content'], }, },
  • Dispatches write_file calls to the writeFile handler in the executeTool switch statement.
    case 'write_file': return await this.writeFile(args.path, args.content);
  • src/server.js:44-44 (registration)
    Instantiates the FileSystemTools class, which provides the write_file tool, and registers it in the server's tools map.
    filesystem: new FileSystemTools(),
  • Includes 'write_file' in the list of supported tools for the canHandle method.
    const tools = ['read_file', 'write_file', 'list_directory', 'create_directory', 'delete_file', 'copy_file', 'move_file', 'search_files'];

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