call_function
Execute any registered StatsPAI function by name with keyword arguments to access functions not exposed as individual tools; pass dataset handles and chain results via result IDs.
Instructions
Run ANY registered StatsPAI function by name with keyword arguments -- the escape hatch for the ~1,200 functions that are not individually listed as tools. arguments follows the parameter schema from describe_function; column names refer to the dataset passed as data_id / data_path. An argument the function does not accept refuses the call (error_kind unknown_argument, with did_you_mean). Supports as_handle / result_id chaining like every other tool.
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": {
"function": "<function>"
},
"name": "call_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | Payload depth; agent is the fullest. | agent |
| data_id | No | Data handle (d_...) from load_data; replaces data_path. | |
| data_csv | No | Small inline table as CSV text. | |
| function | Yes | Registered function name (sp.<name>). | |
| arguments | No | Keyword arguments for the function (JSON object). | |
| as_handle | No | Cache the fit and return its result_id. | |
| data_path | No | Absolute path of a data file on the server. | |
| result_id | No | Handle of an earlier fit made with as_handle=true. | |
| data_columns | No | Load only these columns. | |
| data_records | No | Small inline table as row objects. | |
| data_sample_n | No | Uniform random subsample of this many rows (seed 0). | |
| max_output_bytes | No | Result byte budget (default 262144; 0 = none). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||