Skip to main content
Glama

open深楼市 · Shenzhen Real Estate Open Data

sz_stats_aggregate

Read-onlyIdempotent

通用只读统计。可在全量数据上按白名单字段分组、筛选并汇总,适合回答“今年哪个小区二手卖得最多”“宝安 90 平以下小区排行”“全市二手按月均价和套数”这类需要全量计算的问题,不必先拉明细。dataset:resale=二手成交样本(中原/Q房/房天下等平台样本,不是住建局全量网签;全市网签请用 sz_market_overview);new_home_deals=新房认购/网签,默认 source=project_snapshot 为 2026-10-04 起的一房一价快照比对(不能代表全年),source=official 为住建局官方分区面积段网签;inventory=最新新房可售库存快照,默认剔除历史遗留,日期按预售证批准日。group_by 可多选:community(小区/项目)、plate(片区/板块)、district(区)、year、month、week(周一日期)、area_band、total_price_band、unit_price_band、layout、source。面积段(左闭右开):60㎡以下、60–90㎡、90–110㎡、110–140㎡、140㎡以上。总价段(万元,左闭右开):200以下、200–300、300–500、500–800、800–1200、1200以上。单价段(元/㎡,左闭右开):3万以下、3–5万、5–8万、8–12万、12万以上。官方新房网签面积段只有 90㎡以下、90~144㎡、144㎡以上三档。metrics 白名单:deal_count 套数、avg_unit_price 按面积加权成交均价、median_unit_price 单价中位数、avg_total_price 总价均值、total_area 总面积、max_price/min_price 最高/最低总价(万元)。库存和单盘快照通常只有套数。filters 白名单:date_from/date_to、district、plate、q(名称关键词)、area_min/area_max、total_price_min/total_price_max、unit_price_min/unit_price_max、source、deal_kind(新房快照:signed/subscription/filing,默认 signed)。top_n 默认 20、最大 200。返回分组总数和数据最新日期。字段名与计算均走白名单映射,查询限时 10 秒。

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": {
      "dataset": "<dataset>",
      "group_by": "<group_by>"
    },
    "name": "sz_stats_aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderNo排序方向,默认 desc
top_nNo返回前 N 组,默认 20,最大 200
datasetYes数据集:resale 二手平台成交样本;new_home_deals 新房认购或网签;inventory 新房可售库存
filtersNo
metricsNo指标,默认套数和面积加权均价
sort_byNo排序字段,须为已选指标或分组字段,默认套数
group_byYes分组字段,可多选

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description adds real behavioral context beyond them: a 10-second query time limit, whitelist-only field mapping, top_n default 20 / max 200, that only group totals and the latest data date are returned, that inventory and single-project snapshots typically only support deal counts, and that official new-home area bands have just three tiers.

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?

Purpose and the key alternative are front-loaded, and nearly every clause carries needed information (band cutoffs, dataset caveats, defaults). The downside is that it is one dense run-on block rather than separated sections, which makes the band definitions and whitelists harder to scan than they need to be.

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 high-complexity, seven-parameter aggregation tool with no output schema, the description covers datasets, grouping options, band semantics, metric definitions, filters, limits and the timeout. It only partially describes the shape of the returned grouped result, so an agent knows what it gets in general terms but not the per-group field names.

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 coverage is already 86%, but the description goes well beyond it by defining every enum bucket with explicit left-closed/right-open boundaries for area, total-price and unit-price bands, defining each metric (avg_unit_price is area-weighted), listing the filter whitelist, and adding the sort_by constraint that the field must be a selected metric or group field.

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 opens with a specific verb+resource ("通用只读统计" over full data with group/filter/aggregate), then enumerates the three datasets and names the sibling to use instead for city-wide 网签 (sz_market_overview). An agent can distinguish this aggregation tool from detail-pulling siblings 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 Guidelines5/5

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

It gives concrete question archetypes ("今年哪个小区二手卖得最多", "全市二手按月均价和套数") that tell the agent when this tool applies, plus the explicit exclusion "不必先拉明细" steering away from detail queries and the routing "全市网签请用 sz_market_overview". Dataset-level caveats (new_home_deals snapshot cannot represent a full year; use source=official for official data) further constrain correct use.

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