Skip to main content
Glama

read_query_result

Read-onlyIdempotent

Paginate through a stored query result by handle and optionally filter entries by a case-insensitive substring pattern to locate specific records in large game metadata result sets.

Instructions

按句柄翻页读取之前某次查询的完整结果;给了 pattern 就在结果内再过滤。

列表类工具单次只返回一页,但完整结果留在句柄里。 (原先独立的 search_query_result 已按契约第 3 条合并进来 —— 它就是本工具在 pattern="" 时的特例。) 两个用途共用本工具:

  • 只看第 500~550 条 → 只给 offset/limit;

  • 在这一批结果里再找含某子串的 → 再加 pattern(大小写不敏感)。

两者的成本不一样:纯翻页只解析取到的那一页(结果集是惰性物化的, 见 engine/index.py 的 _RowSource);而 pattern 要看每条的值才能 过滤,必须把整个结果集解析一遍。所以在几万条的句柄上, 纯翻页是毫秒级,带 pattern 会明显更慢 —— 缩小范围优先用 search_* 的参数(pattern / subtype_of / owner / assembly)。

原先另有一个 search_query_result,实测它在 pattern="" 时与本工具 输出完全相同 —— 它就是本工具的特例。按契约第 3 条(单一职责: 一个是另一个的特例就合并)已删除,并入 pattern 参数。

句柄有两个来源,本工具都能读:search_* 这类静态查询登记的索引句柄, 以及响应超限被截断时登记的 cap- 句柄(那种句柄可能在没有索引时也存在)。 句柄只在它所属的那一个会话内有效;过期时返回 available_handles 列出当前还能用的,绝不静默换成另一个结果集。

Args: handle: search_classes 等返回的 handle。 offset: 起始位置。 limit: 本页条数(上限 2000)。 pattern: 在结果集内二次过滤的子串;留空表示不过滤(纯翻页)。

Input Schema

NameRequiredDescriptionDefault
limitNo
handleYes
offsetNo
patternNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (`readOnlyHint`, `idempotentHint`, `destructiveHint: false`), the description discloses that pure pagination is lazy and fast while `pattern` forces full result-set parsing, and that handles are session-scoped and return `available_handles` on expiry rather than silently switching results. These are meaningful operational behaviors not captured in the annotations.

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?

The description is front-loaded with the core operation and uses clear chunks for usage modes, cost, and handle validity. It is somewhat repetitive: the merged `search_query_result` history is explained twice, which slightly dilutes conciseness.

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 read tool with no output schema and no structured parameter descriptions, the description is largely complete: it covers operation, usage modes, cost, handle validity, and expiry behavior. The remaining gap is that it does not explicitly describe the returned page shape or pagination metadata.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does so: `handle` comes from `search_classes`-type tools, `offset` is the start position, `limit` is page size with an upper bound of 2000, and `pattern` is a case-insensitive substring filter where empty means no filtering. It also explains the two handle sources (`search_*` indexes and `cap-` truncated-result handles).

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 first sentence states a specific verb and resource: paginated reading of a prior query's complete result by handle, plus optional in-result filtering. It distinguishes the two modes and references the removed sibling `search_query_result` as a special case, so the agent can tell what this tool is for.

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?

The description explicitly separates two usage modes: pure pagination with `offset`/`limit`, versus filtering with an added `pattern`. It also explains the cost difference and advises narrowing with `search_*` parameters before using `pattern`, which is exactly the routing guidance an agent needs.

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