Inject code into editor
set_codeWrites code directly into browser-based code editors, bypassing paste blocking and verifying the inserted content by reading it back so the code is confirmed in place.
Instructions
Write code into the page's code editor, bypassing paste blocking. Tries the editor's own API first, then falls back to IME-style typing (insertText, never a paste event). The result is verified by reading the editor back, so 'verified: exact' means the code really is in the editor.
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": {
"code": "<code>"
},
"name": "set_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The complete source code to place in the editor | |
| mode | No | Replace the editor contents, or append to them | replace |
| modelIndex | No | Which editor if the page has several |