call_reducer
Executes a named reducer function on a SpacetimeDB database, passing JSON arguments; specify the database when no default is set.
Instructions
Call a reducer function on the database.
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": {
"database": "<database>",
"reducer": "<reducer>",
"args": "<args>"
},
"name": "call_reducer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | Yes | Arguments for the reducer as a JSON array | |
| reducer | Yes | The reducer function name | |
| database | Yes | The database name. Required if no default is set. |