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

TableJSON 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 個)

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It reveals that responses always include population and coverage, defines coverage semantics, and explicitly prohibits performance fields as sort keys because '排序即排名'. It could also state read-only guarantees or error behavior, but the non-obvious contract is well covered.

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 purpose and a worked example, then moves to syntax, output guarantees, and constraints. The final English sentence is somewhat redundant with the Chinese opening, but the overall structure is efficient and readable.

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?

Given there is no output schema, the description documents the key return fields (population, coverage), the supported aggregate functions, and an important ranking-policy constraint. It is complete enough for typical calls, though the exact response shape for aggregate results is left implicit.

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 the baseline is 3, but the description adds real value beyond the schema by explaining where syntax ('field operator value' joined by 'and'), the aggregate vocabulary, and the meaning of population/coverage. Some details like limit and universe sourcing are left to the schema, but the added semantics justify a score above baseline.

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?

States a clear action ('Filter a universe and aggregate over the matched set') and enumerates the supported aggregate functions, so an agent can tell this is a grouped-query tool. It does not explicitly distinguish itself from sibling tools like data_point or data_series, which keeps it from a 5.

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?

Provides a concrete worked example ('fee<=0.4 and type=passive' with median fee) and explains the where grammar and the sort restriction on performance fields. It gives clear context for when the tool is appropriate, though it does not explicitly describe when to prefer an alternative sibling.

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.

TDQS

A3.6/5.0
Disambiguation3/5

Most tools have clear boundaries, but there is notable overlap between data_series and etf_price_history/fund_nav_history, since all three can provide time-series data. market_sentiment and taiwan_market_overview also both expose Taiwan sentiment, creating potential selection ambiguity.

Naming Consistency3/5

The data_* tools follow a clear prefix pattern, but the rest mix noun-style names (fx_rates, market_sentiment), object-action names (etf_lookup, fund_lookup), and generic verbs (search, fetch). The names are readable and understandable, but the overall convention is inconsistent.

Tool Count4/5

At 15 tools, the count is at the upper edge of the ideal range and mostly reasonable for a Taiwan finance data server. However, several domain-specific wrappers duplicate capabilities already available through the generic data_* tools, so the set feels slightly heavier than necessary.

Completeness4/5

The generic data catalog plus data_point/data_query/data_series/data_table provides broad coverage for read-only financial data, and the domain tools cover ETFs, funds, FX, market overview, sentiment, and climate indicators. Minor gaps remain, such as no explicit Taiwan stock-specific lookup or price history tool, but the search and generic data layers partially compensate.

Resources