Skip to main content
Glama
Inistate

Inistate MCP Server

Official
by Inistate

Aggregate Entries

aggregate_entries
Read-onlyIdempotent

Calculate totals without paging: count, sum, average, min or max of a field, optionally grouped by date or another field. Answers how many, how much, average, top N, per month.

Instructions

Totals without paging rows: count, sum, average (ave), min or max of a field over the entries list_entries would list, optionally grouped by a field (a date by day, week or month) and broken down by a second field. Use it for 'how many / how much / total / average / top N / per month' questions instead of adding up list_entries pages.

The query parameters (module, listing, state, search, filters) ARE list_entries' — same names, same meaning, same access — so pass exactly what you would pass list_entries to read those entries.

The answer: groups [{key, count, value}] (with a breakdown, values [{key, value}] per group), total {count, value} over EVERY matching entry, complete (false: the module's engine read only its first 501 entries, so the figures are partial — narrow the filters, or say they are partial) and groupsTruncated (only the largest top groups, or the latest periods, are listed; total is still whole).

Filter or group by state when Cancelled or Draft entries must not count. What a figure means — signs, which entries belong in it — comes from the module's description and get_module_schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesThe metric
topNoMost groups returned, 1–500. Default 100.
fieldNoField the metric reads (a number for sum/ave; a number or date for min/max). Not needed for count.
stateNo
moduleYesModule name from list_modules
searchNoFree-text search across document ID, state, and text-like fields; supports * and ? wildcards
filtersNo
groupByNoField to group by: a display name, or state, date, createdBy, assignees …
listingNoListing (saved view) name to query, case-insensitive; 'archive' targets archived entries. Defaults to the unfiltered 'Everything' view, which is admin-only on modules with listings — non-admins must name an accessible listing (an access-denied response lists them).
intervalNoOnly when groupBy is a date field. Default day.
breakdownNoSecond field, splitting each group
workspaceIdNoWorkspace ID. Omit if set via env or set_workspace; required in stateless/remote mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already carry readOnly/idempotent, but the description adds substantial behavior beyond them: the `complete` flag semantics (engine reads only first 501 entries), `groupsTruncated` meaning vs whole `total`, and the admin-only default 'Everything' listing constraint. These are non-obvious operational traits an agent needs.

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?

Front-loaded with the core purpose and the routing sentence; the query-parameter equivalence paragraph is slightly longer than needed but earns its place by reducing invocation errors. Generally efficient, though dense across four paragraphs.

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?

With no output schema, the description compensates fully by describing the return shape (groups, values, total, complete, groupsTruncated) and where figure semantics come from (get_module_schema). Nothing essential to calling or interpreting it is missing.

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 coverage is 83%, so baseline 3, but the description adds real value: it declares the query params (module, listing, state, search, filters) are identical in name/meaning/access to list_entries', telling the agent how to populate them. It doesn't detail `top`/`breakdown` interaction beyond the schema.

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?

States a precise verb+resource: aggregation (count/sum/ave/min/max) over 'the entries list_entries would list', immediately disambiguating scope against a specific sibling. The 'Totals without paging rows' opening makes the operation's nature unmistakable.

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?

Explicitly routes intent: 'Use it for how many / how much / total / average / top N / per month questions instead of adding up list_entries pages.' Names the alternative and the condition that selects this tool, clearly a strong when-to-use directive.

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