Skip to main content
Glama

Filesystem MCP Server

write_file

Create or overwrite files by writing content to specified paths. Automatically generates missing directories to ensure file creation. Supports relative and absolute paths for flexible file management.

Instructions

Writes content to a specified file. Creates the file (and necessary directories) if it doesn't exist, or overwrites it if it does. Accepts relative or absolute paths (resolved like readFile).

Input Schema

NameRequiredDescriptionDefault
contentYesThe content to write to the file. If the file exists, it will be overwritten.
pathYesThe path to the file to write. Can be relative or absolute. If relative, it resolves against the path set by `set_filesystem_default`. If absolute, it is used directly. Missing directories will be created.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "content": { "description": "The content to write to the file. If the file exists, it will be overwritten.", "type": "string" }, "path": { "description": "The path to the file to write. Can be relative or absolute. If relative, it resolves against the path set by `set_filesystem_default`. If absolute, it is used directly. Missing directories will be created.", "minLength": 1, "type": "string" } }, "required": [ "path", "content" ], "type": "object" }

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

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