RunScript
Runs JavaScript in QuickJS with access to session MCP tools, enabling scripts to call tools via mcp.call and return results.
Instructions
Runs JavaScript in QuickJS with access to the session's MCP tools, including resource tools when available. In the program, mcp.call(name, args) calls a tool and resolves to its result; every tool of the session is callable but the session-bound ones (long and leftover sessions, batch mode, recorded reads, the debugger), the background-run tools and the script tools.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "RunScript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | No | The program's body, run as an async function: mcp.call(name, args) calls a tool of this session and resolves to the tool's result; the value the body gives back with return is the run's result. | |
| script_uri | No | The URI of a resource of kind script. Supply either script or script_uri. |