Skip to main content
Glama

條件查詢與群體聚合(query)

data_query

對一個母體下條件篩出一組標的,並對整組計算聚合統計(count/coverage/min/max/mean/median/sum),如「費用率 0.4% 以下的被動 ETF,其費用率中位數」。where 語法為「欄位 運算子 值」以 and 連接(例 fee<=0.4 and type=passive)。回應必附母體大小 population 與欄位覆蓋率 coverage(有幾檔真的有這個欄位)。注意:績效欄位可用於 where 篩選與聚合統計,但不得作為排序鍵——排序即排名,本站不對個別商品做推薦。Filter a universe and aggregate over the matched set.

Input Schema

NameRequiredDescriptionDefault
sortNo排序鍵,只接受中性鍵 code/name/holders(規模/受益人數),不接受績效欄位
limitNosample 回列數,預設 10、上限 20
whereNo條件式,如 fee<=0.4 and type=passive;省略=全母體
universeYes母體,如 etf.tw(見 data_catalog)
aggregateNo聚合,如 median:fee,count(逗號分隔、最多 4 個)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / sort / description
      Previous value: -"排序鍵,只接受中性鍵 code/name/holders(規模/人氣),不接受績效欄位"New value: +"排序鍵,只接受中性鍵 code/name/holders(規模/受益人數),不接受績效欄位"
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real behavior: the response always includes population size and field coverage, and sorting on performance fields is prohibited for a policy reason (no product recommendation). It does not cover auth, rate limits, or error behavior, but the key output-shape and constraint traits are surfaced.

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?

Content is front-loaded: purpose first, then where syntax, then response guarantees, then the sort caveat. The bilingual restatement at the end is mildly redundant but short, and every other sentence carries information.

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?

No output schema exists, and the description compensates by stating that responses always carry population and coverage. Combined with the aggregate function list and where grammar, an agent has enough to call it correctly; only pagination/limit behavior is 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 100%, so baseline is 3; the description adds genuine value by explaining the where grammar ('欄位 運算子 值' joined by and), listing the aggregate functions available, and giving the rationale behind the sort restriction rather than merely restating it.

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 two-part verb (filter a universe + aggregate over the matched set) with a concrete worked example ('費用率 0.4% 以下的被動 ETF,其費用率中位數') that makes the group-level nature unmistakable. This distinguishes it from single-record siblings like data_point and row-returning ones like data_table.

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

Usage Guidelines3/5

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

The example conveys the intended usage context, and the sort restriction ('績效欄位…不得作為排序鍵——排序即排名') gives a clear do-not rule for one parameter. However, it never says when to pick this over data_point, data_series, or data_table, leaving the sibling routing 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