Test a function
test_functionRun a function's current code once in a temporary sandbox with request_body as the request, and return its status code, time and response. A form on the site sends its fields under "data", so to test as a page would, send { "data": { "": "" } }. as_contact_id runs it as that customer (env.caller.contactId), as if they pressed the button while signed in. The run is real: the code has the function's env vars and data access, so anything it writes or calls happens, journeys it starts included.
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": {
"site_id": "<site_id>",
"function": "<function>"
},
"name": "test_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | The site, from list_sites | |
| function | Yes | The function's name (slug), display name or id, from list_functions | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| request_body | No | The JSON request body to send (default {}) | |
| as_contact_id | No | Run as this contact of the site (list_contacts), e.g. to test a button for signed-in customers |