perch_eval
Evaluate a JavaScript expression in a Perchance generator's preview or editor frame and return its value.
Instructions
Run a JS expression and return its value. Default frame is the running generator ('preview'); use frame:'editor' for the editor page.
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": {
"js": "<js>"
},
"name": "perch_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes | JS expression to evaluate | |
| frame | No | Default preview |