Skip to main content
Glama
Kingdee MCP Unified

Kingdee MCP Unified

by sclyxnet

kingdee_query_stock_report

Read-onlyIdempotent

Queries paginated Kingdee inventory stock reports—including stock ledger, material receipt/dispatch details, summary statistics, and aging analysis—using a required form ID and filter scheme.

Instructions

通过库存分页报表专用接口取报表数据(区别于单据 ExecuteBillQuery 与通用 GetSysReportData)。

端点:Kingdee.K3.SCM.WebApi.ServicesStub.StockReportQueryService.GetReportData,Kingdee.K3.SCM.WebApi.ServicesStub (金蝶社区 kb 384025718453622528;版本要求 >= PT-146906 [8.0.0.202203])。

与其它接口的关键差异(全部实测 2026-10-19):

  1. HTTP 层是 raw JSON body {"parameters": ["<内层JSON字符串>"]},不是 form-urlencoded; 用 form 方式一律返回「参数错误,请检查!」。

  2. FSCHEMEID 必录且不能用默认方案(先用 kingdee_list_filter_schemes 查)。

  3. 返回 {"success":true,"CurQueryId":"...","data":[...行对象...]}; 翻页时传回 CurQueryId,此时过滤条件不再应用。

适用报表:物料收发明细/汇总、库存台账、库存汇总统计、库存账龄分析等分页账表 (官方声明以库存报表验证为主,其他模块分页账表大多也适用)。 财务总账类报表请用 kingdee_query_report(GetSysReportData)。

Args: params: StockReportQueryInput

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": {
      "params": "<params>"
    },
    "name": "kingdee_query_stock_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.11

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description adds genuinely new operational context: the HTTP layer must be a raw JSON body rather than form-urlencoded or the call fails with a specific error, FSCHEMEID cannot be the default scheme, and the response shape including CurQueryId. It also discloses the non-obvious paging quirk that filters stop applying once CurQueryId is passed, which is exactly the kind of behavior an agent cannot learn from 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?

Front-loaded with the endpoint identity and the sibling contrast, then numbered differences that are each actionable. Slightly heavy with the version requirement and the KB article reference, which are useful but secondary; no sentence is filler, though the numbering could give the paging note more prominence.

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?

Even though an output schema exists and return values need not be explained, the description still summarizes the success/CurQueryId/data envelope because paging depends on it. For a tool with a nested input object, a required non-default scheme, and an unusual transport requirement, nothing an agent needs to call it correctly is missing.

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?

Reported schema coverage is 0% at the top level (the sole param is a $ref), so the description must carry the load: it explains scheme_id's mandatory non-default constraint and where to obtain it, the CurQueryId paging semantics, and enumerates valid form_id values by report name. It adds little for limit, start_row, field_keys, more_condition and quickly_condition, but those are documented in the nested schema.

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: retrieve paginated stock report data through the dedicated StockReportQueryService.GetReportData endpoint, and explicitly contrasts it with the document ExecuteBillQuery and the generic GetSysReportData. The applicable report types (物料收发明细/汇总, 库存台账, 库存汇总统计, 库存账龄分析) make the scope concrete enough to distinguish from siblings without opening a 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 (paginated ledger/stock reports, and most other modules' paginated reports), explicit when-not-to-use (财务总账类报表请用 kingdee_query_report), and a mandatory prerequisite ordering (先用 kingdee_list_filter_schemes 查). Alternatives and exclusions are named rather than inferred.

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

Deploy Server

Other Tools