Skip to main content
Glama

Query records

query_records
Read-onlyIdempotent

Filter, sort, group, and summarize records in CSV, JSON, JSONL, or NDJSON files to inspect evaluation outputs, compute pass rates, and extract statistics.

Instructions

Filter, sort, group and summarise records in a tabular data file.

    Useful for evaluation outputs such as results.jsonl: e.g. filter
    passed == false, group_by task category, or get the mean of a score.
    Booleans average as 0/1, so stats_field on a pass/fail flag gives the
    pass rate.
    

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": {
      "path": "<path>"
    },
    "name": "query_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesA .csv, .tsv, .json, .jsonl or .ndjson file.
limitNoMax records returned.
fieldsNoFields to return; dotted paths allowed.
filtersNoAll filters must match (logical AND).
sort_byNoField to sort matches by.
group_byNoCount matches per distinct value of this field.
descendingNo
stats_fieldNoNumeric field to summarise (count/mean/min/max) over matches.

Output Schema

NameRequiredDescriptionDefault
pathYes
statsNo
fieldsYesTop-level fields seen in the file.
matchedYes
recordsYes
truncatedYes
group_countsNo
total_recordsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and closed-world behavior, so the safety profile is covered. The description adds genuinely new behavioral detail: booleans are averaged as 0/1, so stats_field on a pass/fail flag yields a pass rate — a non-obvious semantic the annotations and schema do not convey.

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?

The capability statement is front-loaded in a single sentence, followed by a compact example block and one behavioral nugget. Every sentence carries information an agent can act on; nothing is redundant.

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?

With 8 parameters, a present output schema and full annotation coverage, the definition supplies enough to call the tool correctly, including the key aggregation nuance. Only the file-format and size limitations (implied by the path description) are left entirely to the schema.

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 88%, so the baseline would be 3, and the description earns the extra point by explaining how stats_field interacts with boolean fields and the pass-rate use case. It does not add detail on fields, sort_by or descending, but those are already well documented in the schema.

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

Purpose4/5

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

The first line names specific verbs (filter, sort, group, summarise) and a concrete resource (records in a tabular data file), which is far more than a restatement of the name. It does not explicitly distinguish itself from the sibling sqlite_query, so an agent must infer that this tool targets files rather than a database.

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

Usage Guidelines4/5

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

The description supplies concrete usage context — evaluation outputs like results.jsonl, filtering on passed == false, grouping by task category, averaging a score. That is clear guidance on when the tool fits, but it offers no explicit exclusions or named alternatives for the database-style case.

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