# write_file

Write content to a file. Creates the file if it doesn't exist, overwrites if it does.

Agent View of the PolicyLayer registry record for `write_file`. HTML page: https://policylayer.com/tools/deep-ai-kr-dev-mcp/write-file

## Facts

- Tool: `write_file`
- Server: Dev (`deep-ai-kr/dev-mcp`) — https://policylayer.com/tools/deep-ai-kr-dev-mcp.md
- Homepage: https://github.com/deep-ai-kr/dev-mcp
- Risk category: Write (Medium risk)
- Registry record: grade C, identity unverified
- Server rate-limited: no
- Parameters: 2
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `path` | string | no | Path to the file to write (relative to root) |
| `content` | string | no | Content to write to the file |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "write_file",
    "arguments": {}
  }
}
```

## Why write_file is rated Medium

The tool modifies data reversibly by creating or overwriting files. It is not destructive in the sense that the operation is reversible (files can be re-written or restored), and it does not delete data.

From the tool's own definition: "Tool description states 'Write content to a file. Creates the file if it doesn't exist, overwrites if it does.' This is explicitly a write/create/overwrite operation on files."

Risk signals: Accepts file system path (path) · Accepts raw HTML/template content (content)

## Use case

AI agents use write_file to create or update resources in Dev, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Dev environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Dev:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "write_file": {
      "limits": [
        {
          "counter": "write_file_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Dev (6)

- `get_file_info` — Read — https://policylayer.com/tools/deep-ai-kr-dev-mcp/get-file-info.md
- `list_directory` — Read — https://policylayer.com/tools/deep-ai-kr-dev-mcp/list-directory.md
- `read_text_file` — Read — https://policylayer.com/tools/deep-ai-kr-dev-mcp/read-text-file.md
- `search_files` — Read — https://policylayer.com/tools/deep-ai-kr-dev-mcp/search-files.md
- `create_directory` — Write — https://policylayer.com/tools/deep-ai-kr-dev-mcp/create-directory.md
- `move_file` — Write — https://policylayer.com/tools/deep-ai-kr-dev-mcp/move-file.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=deep-ai-kr-dev-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/deep-ai-kr-dev-mcp
