Skip to main content
Glama
Kingdee MCP Unified

Kingdee MCP Unified

by sclyxnet

kingdee_get_fields

Read-onlyIdempotent

Retrieve complete field definitions, required fields, entries, and business rules for a specified Kingdee form to know what to query or how to build a valid save payload.

Instructions

获取指定表单的完整字段信息和业务规则。

不知道查询哪些字段时,或需要了解表单的业务限制时,先调用此工具。 本工具会调用金蝶 QueryBusinessInfo 接口拉取真实字段定义(带缓存)。

返回内容:

  • name/db_tables: 来自 QueryBusinessInfo 元数据(服务端权威);desc/business_rules/recommended_fields 为本地语义补充

  • metadata.fields: 所有主表字段(含 caption/type/must/参照对象)

  • metadata.entries: 所有分录子表及其字段、物理表名

  • metadata.required_fields: 主表必填字段列表

  • save_template: 由元数据动态生成的最小可保存 model 骨架(仅含必填字段)

元数据来源:DynamicFormService.QueryBusinessInfo 返回 Result.NeedReturnData (Entrys[].Key / TableName / Fields[].Key / Name[{Key:2052}] / MustInput / LookUpObjectFormId), 即服务端 T_META_OBJECTTYPE + FKERNELXML 的结构化输出,等价于内部 FormMetaDataCache.GetCachedFormMetaData(ctx, formId) 的 WebAPI 版本。

字段格式说明:

  • FXxx 是普通字段

  • FXxx.FName 是关联字段取名称(例:FSupplierId.FName)

  • FXxx.FNumber 是关联字段取编码(例:FSupplierId.FNumber)

Returns: str: JSON 格式的字段信息

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_get_fields"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.11

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so safety is covered. The description usefully adds the backing interface (QueryBusinessInfo), the existence of caching, and a provenance split between server-authoritative metadata and local semantic supplements. It does not disclose latency, cache invalidation, or failure modes when a form_id is unknown.

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?

It is front-loaded (purpose → when to use → return shape → field naming conventions) and every section is scannable. The paragraph about T_META_OBJECTTYPE, FKERNELXML and GetCachedFormMetaData is internal implementation detail that adds length without helping an agent choose or call the tool.

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 one-parameter read tool with an output schema and full annotations, the description covers the essentials, including the FXxx / FName / FNumber field-reference conventions that an agent needs to consume the result. The one gap is the verbose/entry_key filtering interaction, which the description never reconciles with its 'all main table fields' claim.

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?

The schema's own field descriptions cover form_id, verbose and entry_key in detail, so the description does not need to restate them. However, the description's claim that metadata.fields contains 所有主表字段 conflicts in spirit with verbose=false returning only required plus base fields, leaving the agent's expectation of what comes back ambiguous.

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 opening sentence names a specific verb (获取) and resource (指定表单的完整字段信息和业务规则), and the return-content list (metadata.fields, metadata.entries, metadata.required_fields, save_template) precisely delineates scope. An agent can distinguish this full-metadata dump from search/discovery 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 Guidelines4/5

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

It gives an explicit trigger: call this first when you do not know which fields exist or need to learn a form's business restrictions, which implies the counterpart case (querying known fields) belongs elsewhere. It stops short of naming an alternative tool or stating when not to use it.

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