执行 JS
run_jsExecute JavaScript in a browser tab and retrieve serializable results. Use as an expression or function body to return data.
Instructions
在标签页中执行 JavaScript 并返回结果(可 JSON 序列化的部分)。
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": {
"script": "<script>"
},
"name": "run_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | JS 代码;as_expr=False 时作为函数体执行(可用 return),True 时作为表达式求值 | |
| tab_id | No | 标签页 id,省略时用最新标签页 | |
| as_expr | No | 是否按表达式求值 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |