Skip to main content
Glama
rootSunc

CNEquity — China A-Share Data Lake for AI Agents

run_sql

Read-only

Execute a single read-only SQL SELECT across all China A-share datasets to compute rankings, aggregations, percentiles, and joins directly, avoiding row paging.

Instructions

One read-only DuckDB SELECT over every dataset, each exposed as a view under its own name. Use this for ranking, aggregation, percentiles and joins across datasets — computing them here is both correct and far cheaper than paging thousands of rows back and adding them up. daily_bars_adj is a ready-made view carrying hfq_open/high/low/close and open-lake qfq_* beside the raw columns; for a bounded historical qfq window use daily_bars_qfq(start_date, end_date) so the anchor matches that window. Prefer these over joining adj_factors yourself. Single SELECT only: no writes, DDL or multiple statements. For one symbol's bars use query_bars, and for plain dataset reads query_dataset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single DuckDB SELECT. Table names are dataset names (see describe_lake).
limitNoMax rows to return (default 200, cap 2000). Responses always report the true total and set `truncated`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.2
    • changedInput schema / properties / sql / description
      Previous value: -"A single SELECT statement."New value: +"A single DuckDB SELECT. Table names are dataset names (see describe_lake)."
  2. First observedv0.17.1

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint=true, it discloses a hard constraint not visible in annotations: single SELECT only, no writes, DDL, or multiple statements. It also explains the pre-built view semantics (daily_bars_adj columns, daily_bars_qfq window anchoring) and warns to prefer them over manual adj_factors joins.

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?

Front-loads the core action and constraint, and the alternative-tool routing lands at the end. It is dense with backticked identifiers and multi-clause sentences, but nearly every clause carries actionable information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-query tool with no output schema and fully described parameters, the description covers scope, constraints, view semantics, and sibling routing. Nothing critical for a correct invocation is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so both parameters are already documented, including the limit default/cap and truncated flag. The description adds view/table-name context implicitly but no syntax or format detail for the sql or limit arguments themselves, so the baseline 3 applies.

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 verb and resource: a read-only DuckDB SELECT executed over every dataset, each exposed as a view under its own name. It also names the sibling tools it is not (query_bars, query_dataset), so an agent can route without opening another 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?

Gives explicit when-to-use ('ranking, aggregation, percentiles and joins across datasets') with a rationale (cheaper than paging rows), plus explicit alternatives for the two adjacent cases: query_bars for one symbol's bars and query_dataset for plain reads.

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