Skip to main content
Glama
clidey

whodb-cli

Official
by clidey

whodb_platform_ontology_aggregate

Read-onlyIdempotent

Compute exact COUNT, SUM, AVG, MIN, or MAX over an ontology to get grouped or filtered totals instead of raw rows.

Instructions

Compute exact SQL aggregates (COUNT, SUM, AVG, MIN, MAX) over one ontology, optionally grouped and filtered.

Pass group_by for one row per group and metrics for the values; omit group_by for a single total row. where uses the same grammar as whodb_platform_ontology_query (for example {"status":"open","amount":{"gte":100}}); a raw platform WhereCondition object is also accepted. Prefer this over whodb_platform_ontology_query when exact totals matter or the entity is large. Results are capped by limit and the MCP --max-rows setting. Accepts workspace {host, org, project} for per-call targeting without changing defaults.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesOntology id
sortNoResult ordering by group column or metric alias
limitNoMaximum groups to return
whereNoFilter object using the same grammar as whodb_platform_ontology_query: {prop: value}, {prop: {op: value}}, _and/_or lists. Ops: eq, neq, gt, gte, lt, lte, contains, icontains, startswith, in, nin, between, isnull. A raw platform WhereCondition object is also accepted.
fieldsNoOptional top-level output fields to include
offsetNoGroup offset
metricsYesAt least one metric: COUNT, SUM, AVG, MIN, MAX
group_byNoProperties to group by; empty for a single-row total
workspaceNoOptional target for this call only. Omit to use the session default set by whodb_platform_session_use, then process/saved defaults. Discover targets with whodb_platform_hosts, whodb_platform_orgs and whodb_platform_projects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.135.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld, so the safety profile is covered. The description adds genuinely useful behavior beyond that: results are capped by limit and the MCP --max-rows setting, and the workspace object targets only this call without changing session defaults. It stops short of describing return shape or error behavior, so not a 5.

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, then scoping, filter grammar, sibling preference, limits, and workspace targeting in a tight sequence. Dense but each sentence carries distinct information; the lightly list-like middle clause keeps it from a 5.

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

Completeness4/5

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

For a 9-parameter tool with nested objects and no output schema, the description covers grouping behavior, filtering grammar, result caps, and workspace targeting well enough to call correctly. Only the exact return/labeling shape is left implicit, so slightly under full 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 coverage is 100%, so the schema already documents each parameter, giving a baseline of 3. The description goes beyond that by giving a concrete where example ({"status":"open","amount":{"gte":100}}) and clarifying the interplay of group_by and metrics, which encode the tool's row-shaping semantics rather than just restating field names.

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 specific verb and resource ('Compute exact SQL aggregates ... over one ontology') and names the exact operations supported. It is immediately distinguishable from read-oriented siblings like whodb_platform_ontology_query because it emphasizes exact aggregates.

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 tells the agent how to shape the call (group_by for per-group rows, omit for a single total) and names the alternative: 'Prefer this over whodb_platform_ontology_query when exact totals matter or the entity is large.' Both the when and the alternative are stated without inference.

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

Deploy Server

Other Tools