query_bill_range
Query bills by date range, auto-slicing into chunks for efficient pagination. Supports large cross-month/year datasets, optionally streaming results to disk.
Instructions
按日期自动切片 + 翻页,适合跨月/跨年查询。
将 [date_from, date_to) 按 chunk 切成 N 段,每段独立翻页拉取。 output_path 为空时内联返回(受 MCP 1 MB 限制,适合小跨度); 非空时流式落盘,适合大跨度(年级)查询。
返回格式(内联): {"rows": [...], "row_count": N, "chunks": K, "exhausted": true} 返回格式(落盘): {"path": "...", "row_count": N, "bytes": M, "chunks": K, "format": "ndjson"} 若中途出错:{"error": "...", "path": "...", "row_count": <已写入>, "bytes": M}
Args: form_id: 表单ID。如 SAL_SaleOrder、PUR_PurchaseOrder 等 field_keys: 查询字段,逗号分隔 date_field: 日期字段名。通常是 FDate 或 FCreateDate date_from: 起始日期(含),YYYY-MM-DD date_to: 结束日期(不含),YYYY-MM-DD extra_filter: 额外过滤条件(与日期条件 AND 拼接) chunk: 切片粒度,month(默认)/ week / day output_path: 落盘路径(绝对路径)。空=内联返回 page_size: 每页行数,默认 2000
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chunk | No | month | |
| date_to | Yes | ||
| form_id | Yes | ||
| date_from | Yes | ||
| page_size | No | ||
| date_field | Yes | ||
| field_keys | Yes | ||
| output_path | No | ||
| extra_filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |