Skip to main content
Glama

query_result

Read-onlyIdempotent

Filter, sort, limit, select, aggregate, paginate, explain, or compare a stored command result by ID without re-executing the command.

Instructions

Read a kept result again WITHOUT re-running the command: filter, sort, limit, pick fields or aggregate the full rows; or explain a value (pointer), read the next page (cursor), or compare with another result (compare_with). An expired or unknown id is an error and is never re-executed.

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": {
      "result_id": "<result_id>"
    },
    "name": "query_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
whereNo[{field, op: eq|ne|prefix|contains|gt|gte|lt|lte, value}]
cursorNocontinuation.cursor: next page
selectNo
optionsNoarray, budget, keys, ignore_fields, strict
pointerNoJSON Pointer: where did this value come from
sort_byNo
aggregateNo
result_idYes
compare_withNoAnother result_id: what changed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.3

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description earns credit for the error contract ('An expired or unknown id is an error and is never re-executed'), which is genuinely new information. Beyond that it says nothing about size limits, budget behavior, or how cursor/compare_with results are shaped, so it adds value but not rich behavioral context.

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?

A single front-loaded sentence leads with the core constraint (no re-execution) before enumerating modes, ending with the error contract. No filler and no restatement of the name or title.

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 10-parameter, nested-schema tool with no output schema, the description covers the main invocation modes and the failure mode, which is most of what an agent needs. Missing: what a successful response looks like (rows vs. aggregate vs. diff shape) and what the 'options' budget/keys/strict knobs do, but these are secondary for correct tool selection.

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 50% across 10 params (including a free-form 'options' object), so the description carries real weight. It maps nearly every parameter to a purpose — where/select/sort_by/limit for shaping, aggregate, pointer for provenance, cursor for paging, compare_with for diffing — filling gaps that the bare schema leaves, especially the undescribed 'options' and 'aggregate' objects. It stops short of explaining the 'op' operators or budget/keys options, keeping it below a 5.

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 states a specific verb and resource — read a kept/persisted result — and immediately distinguishes it from re-running a command ('WITHOUT re-running the command'), which separates it from the sibling 'run'. An agent knows exactly what this tool does without opening the schema.

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?

It enumerates the concrete use cases: filter, sort, limit, pick fields, aggregate, explain a value via pointer, page via cursor, and diff via compare_with. That is strong positive guidance, though it never states an exclusion (e.g. 'do not use this on a live/uncaptured result — use run instead').

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