Skip to main content
Glama

selectrole

Count and aggregate roles

aggregate-jobs
Read-onlyIdempotent

Count and summarize live roles with the selectrole SQL dialect: COUNT, AVG, MEDIAN, MIN and MAX, with GROUP BY and ORDER BY. Use it for market questions such as how many roles match or median pay by seniority; use query-jobs to list the roles themselves. Every row includes count, its number of roles. Pay needs one currency. Returns at most 50 rows. For pay percentiles use salary-benchmark. jobs://dialect has the rules.

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": {
      "sql": "<sql>"
    },
    "name": "aggregate-jobs"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesAggregate query, e.g. SELECT seniority, COUNT(*), MEDIAN(salary) WHERE currency = 'EUR' GROUP BY seniority

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description adds real constraints: a hard 50-row return cap, the rule that pay aggregation requires a single currency, and that every row carries a count. It does not say whether exceeding 50 rows truncates silently or errors, which is the remaining gap.

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?

Capability, use cases, alternatives, output shape, constraints, and the docs pointer are each delivered in one terse sentence, with the core purpose front-loaded. No filler and no restating of the title.

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 still covers the return shape (rows include count and the aggregate values) and the row cap, and it flags the two constraints most likely to cause a wrong query (currency and dialect). An agent can call this correctly without further lookups.

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

Parameters3/5

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

Schema coverage is 100% and the single sql param already has an inline example, so the schema does the heavy lifting. The description does add meaning beyond it by naming the selectrole dialect, the permitted aggregate functions, and the single-currency constraint for pay columns, but it defers detailed grammar to jobs://dialect rather than spelling it out.

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 (count/summarize live roles) and enumerates the supported aggregates (COUNT, AVG, MEDIAN, MIN, MAX) plus GROUP BY/ORDER BY, so the agent knows exactly what class of query it can run. It explicitly distinguishes itself from query-jobs (lists roles) and salary-benchmark (pay percentiles).

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?

Gives concrete use cases (how many roles match, median pay by seniority) and names two alternatives with the exact condition that routes to each: query-jobs to list the roles themselves, salary-benchmark for pay percentiles. Nothing is left to inference.

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