Surgically replace text in a computer file
filesystem_replace_textReplaces exact text in one authorized file. For .docx, edits exact visible text across XML runs and paragraphs while preserving paragraph count, run styles and other package entries. Rejects ambiguous counts, crossing table cells or changing paragraph count. Atomically replaces with a unique backup; structural layout edits are unsupported. For UTF-8 text files the existing exact-replace behavior remains, including a .ailinkany.backup and 64 MiB limit. Mutating and not safe to retry blindly. The client trust root under %APPDATA%\ailinkany.com is not remotely writable. Select this tool from the user's intent when it is the best match. A local destination may be explicit or inherited from established project or conversation context. The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name.
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": {
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "filesystem_replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute UTF-8 text file path. | |
| new_text | Yes | Replacement text; may be empty. | |
| old_text | Yes | Exact existing text fragment to replace. | |
| device_id | No | Target computer device_id. Omit when only one computer is paired. | |
| device_name | No | Computer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer. | |
| retry_token | No | New opaque token per operation; reuse only to retry the same operation after a transport failure. No user content. | |
| workflow_id | No | Optional workflow id; pass together with ai_session_id. | |
| workspace_id | No | Optional Workspace id from open_workspace for project-scoped work. | |
| ai_session_id | No | Optional Session id. Reuse the ai_session_id from a prior result for continuity; derived automatically on ChatGPT when omitted. Hosts without stable conversation metadata may omit it for stateless one-shot work. | |
| expected_matches | No | Required exact match count. Defaults to 1; mismatch aborts without modifying the file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||