script_call
Invoke a method from a loaded script's RPC exports, passing JSON arguments and returning the result or error.
Instructions
Call method on a loaded script's exports.
Args:
session: session id
name: script name (from script_load)
method: the JS-side export to call. Scripts declare
exports via rpc.exports = { myFn(arg) { ... } }.
args: JSON-serialisable positional arguments
timeout_s: RPC timeout (default 10s)
Returns the return value, or the error string when the JS side threw.
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": {
"session": "<session>",
"name": "<name>",
"method": "<method>"
},
"name": "script_call"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | Yes | ||
| name | Yes | ||
| method | Yes | ||
| args | No | ||
| timeout_s | No |