sumif_records
Conditionally sum, count, or average a field in records where a specified condition matches, using operators such as equals, greater than, or contains.
Instructions
Conditional aggregation — like Excel SUMIF/COUNTIF/AVERAGEIF. Sum, count, or average a field where a condition matches. Operators: eq, neq, gt, gte, lt, lte, contains, startswith, in.
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": {
"records": "<records>",
"sum_field": "<sum_field>",
"condition_field": "<condition_field>",
"operator": "<operator>",
"condition_value": "<condition_value>"
},
"name": "sumif_records"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | Array of record objects. | |
| operator | Yes | Comparison operator. | |
| operation | No | Aggregation on matched records (default: sum). | sum |
| sum_field | Yes | Field to aggregate. | |
| decimal_places | No | ||
| condition_field | Yes | Field to test the condition against. | |
| condition_value | Yes | Value to compare against. Use an array for 'in' operator. |