write_file
Create or update files by writing content to specified paths, enabling data storage and configuration management within protected environments.
Instructions
Write content to a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to write | |
| content | Yes | Content to write |
Implementation Reference
- src/demo-server.ts:37-48 (registration)The 'write_file' tool registration in the demo server.
{ name: 'write_file', description: 'Write content to a file', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'File path to write' }, content: { type: 'string', description: 'Content to write' }, }, required: ['path', 'content'], }, }, - src/demo-server.ts:117-119 (handler)The handler logic for the 'write_file' tool in the demo server.
case 'write_file': resultText = `[demo] Wrote ${String(args.content || '').length} bytes to ${args.path || '/example.txt'}`; break;