Skip to main content
Glama
kingdee-k3cloud-mcp

kingdee-k3cloud-mcp

query_bill_to_file

Export large Kingdee K3Cloud bill datasets to local NDJSON or CSV files by paging results and streaming writes without memory buildup, then return the file path and row statistics.

Instructions

自动翻页并流式写入本地文件,适合大数据量导出(万行以上)。

不在内存中累积数据,写入完成后返回文件路径和统计信息。 仅接受文件名,保存到 KD_EXPORT_DIR 或本实例的独立临时目录,不覆盖已有文件。 使用返回的 path 通过 Read 工具抽检,或交由 pandas/polars 处理。

返回格式: {"path": "...", "row_count": N, "bytes": M, "format": "ndjson"} 若中途出错:{"error": "...", "path": "...", "row_count": <已写入>, "bytes": M}

Args: form_id: 表单ID。如 SAL_SaleOrder、PUR_PurchaseOrder、BD_MATERIAL 等 field_keys: 查询字段,逗号分隔。如 "FBillNo,FDate,FAmount" filter_string: 过滤条件。如 "FDate >= '2025-01-01'" output_path: 输出文件名,如 "orders.ndjson";不可包含目录,不覆盖已有文件 format: 输出格式,ndjson(每行一个 JSON 对象)或 csv,默认 ndjson page_size: 每页行数,默认 2000 max_rows: 最大写入行数,默认 500000;超过则截断并正常返回

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": {
      "form_id": "<form_id>",
      "field_keys": "<field_keys>"
    },
    "name": "query_bill_to_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNondjson
form_idYes
max_rowsNo
page_sizeNo
field_keysYes
output_pathNo
filter_stringNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.2

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations to lean on, the description carries the full behavioral load and does so: no in-memory accumulation, writes confined to KD_EXPORT_DIR or an instance-scoped temp dir, filename-only with no directory components, no overwriting of existing files, and max_rows truncation returns normally rather than erroring. The error shape even discloses that partial row_count/bytes are preserved on mid-run failure.

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 core purpose and safety constraints, then a scannable Args block — good structure. The explicit return-format block is largely redundant given the tool already ships an output schema, which is minor waste rather than noise.

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 7-parameter file-writing export tool with no annotations, this covers purpose, constraints, per-parameter meaning, defaults, truncation policy, and failure behavior. Nothing an agent needs in order to invoke it correctly is missing.

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 description coverage is 0%, so the description must supply all parameter meaning, and it does: every one of the 7 parameters is documented with type expectations, format examples (form_id values, comma-separated field_keys, filter syntax), defaults, and constraints such as 'output_path 不可包含目录' and the ndjson/csv format choice.

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?

The opening line states a specific verb chain and resource: auto-paginate and stream-write query results to a local file, targeted at large exports (10k+ rows). Combined with '不在内存中累积数据', an agent can infer this is the streaming counterpart to in-memory query tools, though no sibling is named outright.

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?

It gives a clear selection condition — use for large data volumes (万行以上) where accumulating in memory is undesirable — and suggests follow-up handling (inspect the returned path with Read, or hand it to pandas/polars). No explicit when-not or named alternative, so it stops short of the top band.

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