Save script
write_scriptSave Python source as a named script for later execution, replacing any existing script with the same name. Use it to create or update scripts run via run_script.
Instructions
Save Python source as a named script, replacing one of that name. Use when: creating or changing a script for run_script. Instead: write_file for files under the MCP root. Requires: --mcp-allow-scripts (stdio only); not in paranoid mode. Behavior: destructive for a script of that name. Atomic, mode 0600, in the script folder. Over 1 MiB of UTF-8 fails. Runs nothing. Time limit: 15 s. Returns: {name, path, size (bytes)}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"source": "<source>"
},
"name": "write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The script's name: letters, digits, '_' and '-', at most 80 characters, without '.py', e.g. 'disk_report'. | |
| source | Yes | The complete Python source; it runs with the module axross already imported. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | Yes | ||
| size | Yes |