Skip to main content
Glama

aggregate

Compute aggregations like COUNT, SUM, MIN, MAX, and AVG over matching facts to analyze data patterns and extract insights from structured information.

Instructions

Compute aggregations over matching facts. Supports COUNT (number of matches), SUM, MIN, MAX, and AVG over a numeric argument at a specified position. Example: COUNT all score(player, ?) facts, or AVG scores at argIndex=1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
predicateYesThe predicate to aggregate over
argsYesPattern arguments — use ?x as wildcards, concrete values to constrain
operationYesAggregation operation: COUNT, SUM, MIN, MAX, or AVG
argIndexNo0-based argument position to aggregate for SUM/MIN/MAX/AVG (ignored for COUNT)
scopeNoOptional scope filter
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: it computes aggregations, supports specific operations, and uses patterns with wildcards. However, it lacks details on error handling, performance, or output format (e.g., what the result looks like), which are important for a tool with no output schema.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: the first states the purpose and supported operations, and the second gives examples. It is front-loaded with key information, though the example could be slightly more concise. Every sentence adds value without redundancy.

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

Completeness3/5

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

Given the complexity (5 parameters, no annotations, no output schema), the description is moderately complete. It covers the tool's function and parameters but lacks details on output format, error cases, or integration with sibling tools. For a tool with no output schema, more information on what to expect from results would improve completeness.

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 100%, so the baseline is 3. The description adds value by explaining the purpose of 'argIndex' (e.g., '0-based argument position to aggregate for SUM/MIN/MAX/AVG') and providing concrete examples that clarify how parameters interact, such as using '?x' as wildcards in 'args'. This enhances understanding beyond the schema's technical definitions.

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 clearly states the tool's purpose with specific verbs ('compute aggregations') and resources ('matching facts'), and distinguishes it from siblings by focusing on aggregation operations (COUNT, SUM, MIN, MAX, AVG) rather than querying, asserting, or managing scopes like other tools.

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

Usage Guidelines3/5

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

The description implies usage through examples (e.g., 'COUNT all score(player, ?) facts'), but does not explicitly state when to use this tool versus alternatives like 'recall' (which might retrieve facts) or 'ask' (which might query without aggregation). No exclusions or prerequisites are mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Auctalis/nocturnusai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server