Skip to main content
Glama

Kepler CRM

Aggregate Records

aggregate_records
Read-onlyIdempotent

Computes counts, sums, averages, minimums, or maximums over one record type, optionally grouped by a field or a date bucket, with the same filters as list_records. Use for "how many", "per stage", "average fee", "placements per month". Returns exact figures from the database, never estimates. Placement consultant attribution groups count each placement by its percentage share; fee metrics are net of credited rebates and money is returned per currency without conversion. For pipeline questions aggregate applications, not candidates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYes
filtersYes
group_byYes
date_bucketYes
metric_fieldYes
resource_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "groups": {
      -        "anyOf": [
      -          {
      -            "items": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "count": {
      -                  "maximum": 9007199254740991,
      -                  "minimum": -9007199254740991,
      -                  "type": "integer"
      -                },
      -                "key": {
      -                  "anyOf": [
      -                    {
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ]
      -                },
      -                "label": {
      -                  "anyOf": [
      -                    {
      -                      "type": "string"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ]
      -                },
      -                "value": {
      -                  "anyOf": [
      -                    {
      -                      "type": "number"
      -                    },
      -                    {
      -                      "type": "null"
      -                    }
      -                  ]
      -                }
      -              },
      -              "required": [
      -                "key",
      -                "label",
      -                "value",
      -                "count"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "metric": {
      -        "enum": [
      -          "count",
      -          "sum",
      -          "avg",
      -          "min",
      -          "max"
      -        ],
      -        "type": "string"
      -      },
      -      "metric_field": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "resource_type": {
      -        "enum": [
      -          "candidate",
      -          "contact",
      -          "company",
      -          "job",
      -          "application",
      -          "placement",
      -          "task"
      -        ],
      -        "type": "string"
      -      },
      -      "rows_with_value": {
      -        "anyOf": [
      -          {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "total": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "truncated": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "resource_type",
      -      "metric",
      -      "metric_field",
      -      "total",
      -      "rows_with_value",
      -      "groups",
      -      "truncated"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "error": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "details": {
      -            "additionalProperties": {},
      -            "propertyNames": {
      -              "type": "string"
      -            },
      -            "type": "object"
      -          },
      -          "message": {
      -            "type": "string"
      -          },
      -          "request_id": {
      -            "type": "string"
      -          },
      -          "type": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type",
      -          "message",
      -          "request_id"
      -        ],
      -        "type": "object"
      -      }
      -    },
      -    "required": [
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "groups": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "count": {
      +                  "type": "number"
      +                },
      +                "key": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                },
      +                "label": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                },
      +                "value": {
      +                  "anyOf": [
      +                    {
      +                      "anyOf": [
      +                        {
      +                          "type": "number"
      +                        },
      +                        {
      +                          "additionalProperties": {
      +                            "anyOf": [
      +                              {
      +                                "type": "number"
      +                              },
      +                              {
      +                                "type": "null"
      +                              }
      +                            ]
      +                          },
      +                          "propertyNames": {
      +                            "type": "string"
      +                          },
      +                          "type": "object"
      +                        }
      +                      ]
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                }
      +              },
      +              "required": [
      +                "key",
      +                "label",
      +                "value",
      +                "count"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "metric": {
      +        "enum": [
      +          "count",
      +          "sum",
      +          "avg",
      +          "min",
      +          "max"
      +        ],
      +        "type": "string"
      +      },
      +      "metric_field": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "resource_type": {
      +        "enum": [
      +          "candidate",
      +          "contact",
      +          "company",
      +          "job",
      +          "application",
      +          "placement",
      +          "task"
      +        ],
      +        "type": "string"
      +      },
      +      "rows_with_value": {
      +        "anyOf": [
      +          {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "total": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "truncated": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "resource_type",
      +      "metric",
      +      "metric_field",
      +      "total",
      +      "rows_with_value",
      +      "groups",
      +      "truncated"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "details": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "request_id": {
      +            "type": "string"
      +          },
      +          "type": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "message",
      +          "request_id"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses meaningful behavioral nuances: returns exact figures, never estimates; placement consultant attribution groups by percentage share; fee metrics are net of credited rebates; and money is returned per currency without conversion. These are non-obvious traits the agent could not infer from annotations alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, all dense with useful information and no filler. The core computation is front-loaded, followed by usage examples, then caveats and domain rules. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 6 required parameters and an output schema, so return-value details are not needed in the description. The description covers the essential decision factors: what metrics are available, how grouping works, filter reuse, exactness guarantees, attribution semantics, fee adjustments, currency behavior, and a pipeline-specific rule. This is complete for an agent deciding whether and how to invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the burden. It maps well to most parameters: 'one record type' implies resource_type, 'grouped by a field or a date bucket' covers group_by and date_bucket, the metric list covers metric, and 'same filters as list_records' covers filters. However, metric_field is only indirectly implied via 'average fee' and 'fee metrics', so the agent still has some ambiguity about which parameter denotes the numeric field being aggregated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Computes'), a precise resource ('one record type'), and the exact operations ('counts, sums, averages, minimums, or maximums'). It goes beyond the tool name by explaining optional grouping and filtering, and the examples ('how many', 'per stage', 'average fee') make the tool's role unmistakable relative to list_records and search_records.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit use cases ('Use for "how many", "per stage", "average fee", "placements per month"') and even provides a domain rule ('For pipeline questions aggregate applications, not candidates'). It also references list_records for filter compatibility, giving the agent clear context for when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources