query_dataset
Run pandas code on a loaded dataset in a sandboxed subprocess to answer data questions and return the computed result.
Instructions
Run pandas code against a dataset in a restricted subprocess.
df, pd and np are preloaded. Do not import anything. Put the answer, as a string, in a variable called result.
Use f-strings (str.format is blocked). Example:
result = df.groupby('channel')['revenue'].sum().sort_values(ascending=False).head(5).to_string()
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": {
"name": "<name>",
"code": "<code>"
},
"name": "query_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| name | Yes | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |