3 コミット 959c39dc98 ... 0c554b042d

作者 SHA1 メッセージ 日付
  jackson 0c554b042d task_7108960482 2 ヶ月 前
  jackson 63c45fb11c task_7109560347 2 ヶ月 前
  jackson 2ff040da13 master_task_7109561841 2 ヶ月 前

ファイルの差分が大きいため隠しています
+ 55 - 0
CONTEXT.md


+ 17 - 7
README.md

@@ -17,7 +17,7 @@ Gateway 保持“薄网关”边界:
 - 支持 Redis token/session 存储。
 - 支持文件 token store 作为开发排障兜底。
 - 不再支持授权码绑定工具;正式接入只使用后台生成的 `GWS_xxx` 设备配置。
-- 本地 stdio 与公网 HTTP 注册同一组 28 个查询、筛选和导出工具。
+- 本地 stdio 与公网 HTTP 注册同一组 34 个查询、筛选和导出工具。
 - 支持客户、订单、订单详情、轨迹、报关资料、排舱列表与详情查询。
 - 支持客户、订单与排舱筛选项,以及未排舱订单和省外进港资料导出。
 - 支持 MCP `initialize`、`tools/list`、`tools/call`。
@@ -25,7 +25,7 @@ Gateway 保持“薄网关”边界:
 
 ## 工具目录
 
-`GatewayApp` 与 `PublicGatewayApp` 当前注册以下 28 个候选工具:
+`GatewayApp` 与 `PublicGatewayApp` 当前注册以下 34 个候选工具:
 
 | MCP 工具 | 用途 | ThinkPHP 路由 | 最终展示 |
 |---|---|---|---|
@@ -45,6 +45,12 @@ Gateway 保持“薄网关”边界:
 | `query_outbound_detail` | 按排舱单号查询排舱汇总与订单明细 | `/mcp/tools/queryOutboundDetail` | 11 项汇总 + 38 项明细 |
 | `query_destination_trailer_list` | 按六个类型查询海外提柜进度或 DO 制作列表 | `/mcp/tools/queryDestinationTrailerList` | 进度 30 列或 DO 11 列安全表格 |
 | `list_destination_trailer_filter_options` | 查询海外提柜七类筛选项 | `/mcp/tools/listDestinationTrailerFilterOptions` | 安全筛选项 |
+| `query_order_abnormal_list` | 按六个页签查询头程问题件列表 | `/mcp/tools/queryOrderAbnormalList` | 固定 9 列安全表格 |
+| `list_order_abnormal_filter_options` | 查询头程问题件六个中文页签 | `/mcp/tools/listOrderAbnormalFilterOptions` | 安全筛选项 |
+| `query_receive_volume_list` | 按入库时间查询收货量已入库订单明细 | `/mcp/tools/queryReceiveVolumeList` | 固定 9 列安全表格 |
+| `list_receive_volume_filter_options` | 查询收货量五类筛选项 | `/mcp/tools/listReceiveVolumeFilterOptions` | 安全筛选项 |
+| `query_container_timeliness_list` | 按柜号、提单号或干线实际出发时间查询柜子时效 | `/mcp/tools/queryContainerTimelinessList` | 固定 54 列安全表格 |
+| `export_container_timeliness_report` | 提交柜子时效统计报表异步导出 | `/mcp/tools/exportContainerTimelinessReport` | 签名任务引用 |
 | `list_outbound_filter_options` | 查询七类排舱筛选项 | `/mcp/tools/listOutboundFilterOptions` | 安全筛选项 |
 | `list_order_filter_options` | 查询精准订单筛选项 | `/mcp/tools/listOrderFilterOptions` | 安全筛选项 |
 | `list_customer_filter_options` | 查询客户列表/客户回款工具共用的客户、事业部、商务经理和客户经理筛选项 | `/mcp/tools/listCustomerFilterOptions` | 安全筛选项 |
@@ -60,7 +66,7 @@ Gateway 保持“薄网关”边界:
 
 **异步导出流程:**
 
-1. 调用五个导出提交工具(包括 `export_pallet_data`)提交任务,返回 `task_ref`
+1. 调用六个导出提交工具(包括 `export_pallet_data` 与 `export_container_timeliness_report`)提交任务,返回 `task_ref`
 2. 等待建议时间(`retry_after_seconds`)后,使用 `query_export_task` 和 `task_ref` 查询状态
 3. 任务完成后从 `query_export_task` 响应获取下载链接(`files[].url`)
 
@@ -70,7 +76,9 @@ Gateway 保持“薄网关”边界:
 先询问用户是柜号还是提单号,不得按格式猜测、跨字段或跨工具试查;不支持入仓单号、
 订单号、打托批次号或内部 ID。
 
-这 28 个名称只是 Gateway 的本地候选集合。员工在 `tools/list` 中实际看到、在 `tools/call` 中实际可调用的工具,始终是“Gateway 本地注册集合”与 fmsoperate 当前动态启用列表的交集;动态列表缺失、格式错误或查询失败时关闭访问,不回退为全量开放。
+`export_container_timeliness_report` 的筛选与查询相同:柜号、提单号可同时传入并按 AND 收窄,合计最多 200 个;没有号码时必须提供最多 31 个起运港当地日历日的干线实际出发时间闭区间。Excel 对齐后台 `OPERATE_REPORT_OUTBOUND`(序号 + 54 列)。看表格改走 `query_container_timeliness_list`。
+
+这 34 个名称只是 Gateway 的本地候选集合。员工在 `tools/list` 中实际看到、在 `tools/call` 中实际可调用的工具,始终是“Gateway 本地注册集合”与 fmsoperate 当前动态启用列表的交集;动态列表缺失、格式错误或查询失败时关闭访问,不回退为全量开放。
 
 MCP 能力声明为 `tools.listChanged=false`。工具名称、Schema、说明或注册集合变化后,必须重启对应 Gateway 进程并让客户端重新连接,客户端才会重新获取工具列表。
 
@@ -79,7 +87,7 @@ MCP 能力声明为 `tools.listChanged=false`。工具名称、Schema、说明
 Gateway 在 `tools/call` 最终边界处理展示字段,不改变 ThinkPHP 内部接口和工具入参:
 
 - `query_order` 保持原有 `columns + records` 结果和文本展示,不参与本次转换。
-- `services/output_presenter.py` 对其余 27 个安全工具执行显式白名单展示。
+- `services/output_presenter.py` 对其余 33 个安全工具执行显式白名单展示。
 - `query_order_exact`、`query_customer_list`、`query_customer_payment_followup`、`query_customer_unverified_bill_details`、`query_customer_payment_records`、`query_receivable_cost_list`、`query_track`、`query_customs_declaration_files`、`query_outbound_list` 对外使用中文 `headers + rows + pagination`,不返回内部字段键。
 - 订单应收费用明细对外使用四项 CNY `summary`(订单总应收、订单总结算、特批金额、结算毛利)加固定 13 列 `headers + rows + pagination`,不返回内部字段键。
 - 客户回款跟进严格校验三字段月份汇总;单个客户的六字段账单明细由独立分页工具返回。未知、缺失、额外字段或畸形分页均返回安全错误,不静默丢弃。
@@ -91,7 +99,7 @@ Gateway 在 `tools/call` 最终边界处理展示字段,不改变 ThinkPHP 内
 - `query_outbound_detail` 使用中文 `summary + details + pagination` 两层结构。
 - `query_order_detail` 按中文详情模块返回固定分组或明细;传入“全部”时一次返回概览和十个明细模块,各明细模块独立分页。附件保留文件名、预览与下载链接;后端机器字段和内部 ID 不进入最终展示。
 - 筛选项工具保留“可传值、显示名称、业务编码”,确保返回值可继续传给查询或导出工具。
-- 五个导出提交工具只返回 `task_ref + queued + retry_after_seconds`。客户端稍后在新的调用中使用 `query_export_task`;完成后才返回 `files[].label + files[].url`。Gateway 不在一次调用内等待或循环轮询。
+- 六个导出提交工具只返回 `task_ref + queued + retry_after_seconds`。客户端稍后在新的调用中使用 `query_export_task`;完成后才返回 `files[].label + files[].url`。Gateway 不在一次调用内等待或循环轮询。
 - `request_id` 位于 MCP 结果 `_meta`;参数错误使用业务名称,未知异常不透传后端细节。
 - stdio 与公网 `tools/call` 缺少有效工具名时返回 JSON-RPC `-32602 Invalid params`,不包装为业务 `isError`。
 - 公网 `tools/list` 在设备会话缺失或 Redis 映射不存在时返回 JSON-RPC `-32001` 和设备失效文案。
@@ -105,12 +113,14 @@ Gateway 在 `tools/call` 最终边界处理展示字段,不改变 ThinkPHP 内
 
 海外提柜列表的 `trailer_stage` 必填六个中文类型之一;用户未说明类型时必须先询问,不得默认或六类一起查,也不得改走 `query_outbound_list`。提单号、柜号、日期和其他筛选均可不传;日期若传入必须成对且最多 31 个目的港当地日历日。fmsoperate 注册 SQL 未执行,不得视为已启用。
 
+头程问题件列表的 `abnormal_status` 必填六个中文页签之一;用户未说明状态时必须先询问,不得默认待处理或六类一起查,也不得改走 `query_order` 或作废审核。订单号可选,仅精确匹配;未标明是订单号时先询问。六个状态固定 9 列。fmsoperate 注册 SQL 用户 2026-09-11 确认已执行,首次关闭,未启用前不得视为已上线。
+
 ## 文档入口
 
 - `AGENTS.md`:项目所有权、红线、协作规则和验证命令。
 - `README.md`:当前工具目录、接入配置、运行方式、运维与排障。
 - [`Y:/all_project_docs/mcp/guides/mcp-team-sharing.md`](../all_project_docs/mcp/guides/mcp-team-sharing.md):面向团队的从 0 到 1 架构、实践与问题复盘分享稿。
-- [`Y:/all_project_docs/mcp/guides/mcp-interface-guide.md`](../all_project_docs/mcp/guides/mcp-interface-guide.md):业务侧 27 个工具的字段说明与使用示例。
+- [`Y:/all_project_docs/mcp/guides/mcp-interface-guide.md`](../all_project_docs/mcp/guides/mcp-interface-guide.md):业务侧 29 个工具的字段说明与使用示例。
 - [`Y:/all_project_docs/mcp/overview.md`](../all_project_docs/mcp/overview.md):当前系统概况与跨仓职责。
 - [`requirements.md`](../all_project_docs/mcp/requirements.md):现行协议、安全、工具选择和输出合同。
 - [`tech-specs.md`](../all_project_docs/mcp/tech-specs.md):组件、会话、展示、限流、追踪与日志设计。

+ 85 - 0
app.py

@@ -57,6 +57,18 @@ from tools.query_destination_trailer_list import QueryDestinationTrailerListTool
 from tools.list_destination_trailer_filter_options import (
     ListDestinationTrailerFilterOptionsTool,
 )
+from tools.query_order_abnormal_list import QueryOrderAbnormalListTool
+from tools.list_order_abnormal_filter_options import (
+    ListOrderAbnormalFilterOptionsTool,
+)
+from tools.query_receive_volume_list import QueryReceiveVolumeListTool
+from tools.list_receive_volume_filter_options import (
+    ListReceiveVolumeFilterOptionsTool,
+)
+from tools.query_container_timeliness_list import QueryContainerTimelinessListTool
+from tools.export_container_timeliness_report import (
+    ExportContainerTimelinessReportTool,
+)
 
 
 def parse_int_list(value):
@@ -145,6 +157,21 @@ class GatewayApp:
             ),
             'list_destination_trailer_filter_options':
                 ListDestinationTrailerFilterOptionsTool(api_client=api_client),
+            'query_order_abnormal_list': QueryOrderAbnormalListTool(
+                api_client=api_client
+            ),
+            'list_order_abnormal_filter_options':
+                ListOrderAbnormalFilterOptionsTool(api_client=api_client),
+            'query_receive_volume_list': QueryReceiveVolumeListTool(
+                api_client=api_client
+            ),
+            'list_receive_volume_filter_options':
+                ListReceiveVolumeFilterOptionsTool(api_client=api_client),
+            'query_container_timeliness_list': QueryContainerTimelinessListTool(
+                api_client=api_client
+            ),
+            'export_container_timeliness_report':
+                ExportContainerTimelinessReportTool(api_client=api_client),
         }
 
     @classmethod
@@ -339,10 +366,16 @@ class GatewayApp:
         call_parser.add_argument('--inbound-date-end', default='')
         call_parser.add_argument('--inbound-time-start', default='')
         call_parser.add_argument('--inbound-time-end', default='')
+        call_parser.add_argument('--departure-time-start', default='')
+        call_parser.add_argument('--departure-time-end', default='')
         call_parser.add_argument('--outbound-date-start', default='')
         call_parser.add_argument('--outbound-date-end', default='')
         call_parser.add_argument('--filter-type', default='')
         call_parser.add_argument('--trailer-stage', default='')
+        call_parser.add_argument('--abnormal-status', default='')
+        call_parser.add_argument('--sales-ids', default='')
+        call_parser.add_argument('--merchandiser-ids', default='')
+        call_parser.add_argument('--packing-types', default='')
         call_parser.add_argument('--providers-id', type=int, default=0)
         call_parser.add_argument('--bill-status', type=int, default=None)
         call_parser.add_argument('--cabinet-type', type=int, default=0)
@@ -756,10 +789,62 @@ class GatewayApp:
                 for field, value in trailer_dates.items():
                     if value:
                         tool_args[field] = value
+            elif args.tool == 'query_order_abnormal_list':
+                if not args.abnormal_status:
+                    raise ValueError(
+                        '--abnormal-status is required for '
+                        'query_order_abnormal_list'
+                    )
+                tool_args['abnormal_status'] = args.abnormal_status
+                if args.order_numbers:
+                    tool_args['order_numbers'] = parse_string_list(
+                        args.order_numbers
+                    )
+            elif args.tool == 'query_receive_volume_list':
+                if not args.inbound_date_start or not args.inbound_date_end:
+                    raise ValueError(
+                        '--inbound-date-start and --inbound-date-end are '
+                        'required for query_receive_volume_list'
+                    )
+                tool_args['inbound_date_start'] = args.inbound_date_start
+                tool_args['inbound_date_end'] = args.inbound_date_end
+                if args.customer_ids:
+                    tool_args['customer_ids'] = parse_int_list(args.customer_ids)
+                if args.sales_ids:
+                    tool_args['sales_ids'] = parse_int_list(args.sales_ids)
+                if args.merchandiser_ids:
+                    tool_args['merchandiser_ids'] = parse_int_list(
+                        args.merchandiser_ids
+                    )
+                if args.packing_types:
+                    tool_args['packing_types'] = parse_string_list(
+                        args.packing_types
+                    )
+                if args.product_ids:
+                    tool_args['product_ids'] = parse_int_list(args.product_ids)
+            elif args.tool in (
+                'query_container_timeliness_list',
+                'export_container_timeliness_report',
+            ):
+                if args.container_codes:
+                    tool_args['container_codes'] = parse_string_list(
+                        args.container_codes
+                    )
+                if args.bl_numbers:
+                    tool_args['bl_numbers'] = parse_string_list(args.bl_numbers)
+                if args.departure_time_start:
+                    tool_args['departure_time_start'] = args.departure_time_start
+                if args.departure_time_end:
+                    tool_args['departure_time_end'] = args.departure_time_end
+                if args.tool == 'export_container_timeliness_report':
+                    tool_args.pop('page', None)
+                    tool_args.pop('limit', None)
             elif args.tool in (
                 'list_order_filter_options', 'list_outbound_filter_options',
                 'list_customer_filter_options',
                 'list_destination_trailer_filter_options',
+                'list_order_abnormal_filter_options',
+                'list_receive_volume_filter_options',
             ):
                 if not args.filter_type:
                     raise ValueError(

+ 27 - 0
public_gateway.py

@@ -43,6 +43,18 @@ from tools.query_destination_trailer_list import QueryDestinationTrailerListTool
 from tools.list_destination_trailer_filter_options import (
     ListDestinationTrailerFilterOptionsTool,
 )
+from tools.query_order_abnormal_list import QueryOrderAbnormalListTool
+from tools.list_order_abnormal_filter_options import (
+    ListOrderAbnormalFilterOptionsTool,
+)
+from tools.query_receive_volume_list import QueryReceiveVolumeListTool
+from tools.list_receive_volume_filter_options import (
+    ListReceiveVolumeFilterOptionsTool,
+)
+from tools.query_container_timeliness_list import QueryContainerTimelinessListTool
+from tools.export_container_timeliness_report import (
+    ExportContainerTimelinessReportTool,
+)
 from utils.security import hash_gateway_session_id
 
 
@@ -112,6 +124,21 @@ class PublicGatewayApp:
             ),
             'list_destination_trailer_filter_options':
                 ListDestinationTrailerFilterOptionsTool(api_client=None),
+            'query_order_abnormal_list': QueryOrderAbnormalListTool(
+                api_client=None
+            ),
+            'list_order_abnormal_filter_options':
+                ListOrderAbnormalFilterOptionsTool(api_client=None),
+            'query_receive_volume_list': QueryReceiveVolumeListTool(
+                api_client=None
+            ),
+            'list_receive_volume_filter_options':
+                ListReceiveVolumeFilterOptionsTool(api_client=None),
+            'query_container_timeliness_list': QueryContainerTimelinessListTool(
+                api_client=None
+            ),
+            'export_container_timeliness_report':
+                ExportContainerTimelinessReportTool(api_client=None),
         }
 
     def registered_tool_names(self):

+ 213 - 0
services/output_presenter.py

@@ -34,6 +34,9 @@ class OutputPresenter:
     PAYABLE_FILTER_TOOLS = frozenset(('list_payable_cost_filter_options',))
     PAYABLE_EXPORT_TOOLS = frozenset(('export_payable_cost_list',))
     DESTINATION_TRAILER_TOOLS = frozenset(('query_destination_trailer_list',))
+    ORDER_ABNORMAL_TOOLS = frozenset(('query_order_abnormal_list',))
+    RECEIVE_VOLUME_TOOLS = frozenset(('query_receive_volume_list',))
+    CONTAINER_TIMELINESS_TOOLS = frozenset(('query_container_timeliness_list',))
     DETAIL_TOOLS = frozenset(('query_outbound_detail',))
     ORDER_DETAIL_TOOLS = frozenset(('query_order_detail',))
     OPTION_TOOLS = frozenset((
@@ -42,12 +45,15 @@ class OutputPresenter:
         'list_pending_outbound_export_filter_options',
         'list_customer_filter_options',
         'list_destination_trailer_filter_options',
+        'list_order_abnormal_filter_options',
+        'list_receive_volume_filter_options',
     ))
     EXPORT_TOOLS = frozenset((
         'export_pending_outbound_orders',
         'export_out_of_province_port_data',
         'export_receivable_cost_list',
         'export_pallet_data',
+        'export_container_timeliness_report',
     ))
     TASK_TOOLS = frozenset(('query_export_task',))
     SAFE_TOOLS = (
@@ -56,6 +62,9 @@ class OutputPresenter:
         | RECEIVABLE_LIST_TOOLS | RECEIVABLE_FILTER_TOOLS
         | PAYABLE_COST_TOOLS | PAYABLE_FILTER_TOOLS | PAYABLE_EXPORT_TOOLS
         | DESTINATION_TRAILER_TOOLS
+        | ORDER_ABNORMAL_TOOLS
+        | RECEIVE_VOLUME_TOOLS
+        | CONTAINER_TIMELINESS_TOOLS
         | OPTION_TOOLS | EXPORT_TOOLS | TASK_TOOLS
     )
 
@@ -547,6 +556,56 @@ class OutputPresenter:
     DESTINATION_TRAILER_PROGRESS_STAGES = frozenset((
         '待安排拖车', '待提柜', '待还柜(海)', '已还柜(海)', '已提货(空)',
     ))
+    ORDER_ABNORMAL_COLUMNS = (
+        ('order_number', '订单号'), ('customer_name', '客户'),
+        ('product_name', '物流产品'), ('abnormal_status', '问题件状态'),
+        ('abnormal_type', '问题件类型'), ('abnormal_desc', '问题件描述'),
+        ('outbound_status', '排舱单状态'), ('inbound_date', '入库时间'),
+        ('marker_name', '标记人'),
+    )
+    ORDER_ABNORMAL_STATUSES = frozenset((
+        '待处理', '放行待审核', '包裹放行', '退件待审核', '退件驳回', '已退件',
+    ))
+    RECEIVE_VOLUME_COLUMNS = (
+        ('order_number', '订单号'), ('customer_name', '客户名称'),
+        ('packing_type', '货物类型'), ('inbound_volume', '入库体积'),
+        ('inbound_date', '入库时间'), ('sales_name', '商务经理'),
+        ('merchandiser_name', '客户经理'), ('department_name', '事业部'),
+        ('product_name', '物流产品'),
+    )
+    CONTAINER_TIMELINESS_COLUMNS = (
+        ('ship_company', '船公司'), ('bl_number', '提单号'),
+        ('container_code', '柜号'), ('container_type', '柜型'),
+        ('is_direct_send_name', '是否直送'), ('shipping_method', '运输方式'),
+        ('route', '航线'), ('vessel_name', '航名航次'),
+        ('wharf_name', '到港码头'), ('providers_name', '拖车行'),
+        ('dt_status_name', '柜子状态'), ('warehouse_name', '交货仓库'),
+        ('order_total', '件数'), ('total_volume', '体积'),
+        ('total_weight', '重量'), ('loading_name', '起运港'),
+        ('destination_name', '目的港'), ('delivery_address', '派送地址'),
+        ('has_throw_off_name', '甩柜'), ('throw_off_time', '甩柜时间'),
+        ('ed_check_name', '报关查验'), ('ed_check_time', '报关查验时间'),
+        ('qg_check_name', '清关查验'), ('check_time', '清关查验时间'),
+        ('in_inspection_site', '进查验场时间'),
+        ('out_inspection_site', '出查验场时间'),
+        ('is_close_area_name', '封闭区'), ('start_close_area', '进封闭区时间'),
+        ('end_close_area', '出封闭区时间'), ('outbound_date', '出库时间'),
+        ('export_release_time', '出口报关放行时间'),
+        ('etd', '干线预计出发时间'), ('eta', '干线预计到达时间'),
+        ('gxyjsx', '干线预计时效'), ('departure_time', '干线实际出发时间'),
+        ('arrival_time', '干线实际到达时间'), ('gxsjsx', '干线实际时效'),
+        ('hcsx', '航程时效'), ('start_clearance_time', '开始清关时间'),
+        ('import_release_time', '海外清关放行时间'),
+        ('wharf_wait_time', '码头等待时间'), ('pickup_time', '码头提柜时间'),
+        ('second_pickup_time', '二次提柜时间'), ('tgsx', '提柜时效'),
+        ('max_appointment_delivery_time', 'APPT时间'),
+        ('delivery_end_time', '卡车实际派送时间'),
+        ('oversea_warehouse_name', '海外仓库名称'),
+        ('inbound_date', '到仓时间'), ('inbound_time', '海外仓入库时间'),
+        ('container_return_date', '还空柜时间'), ('hksx', '还空时效'),
+        ('amazon_wait_time', '亚马逊等待时间'),
+        ('inner_remark', '内部备注'), ('financial_remark', '财务备注'),
+    )
 
     OUTBOUND_DETAIL_SUMMARY = {
         'bl_number': '提单号',
@@ -709,6 +768,20 @@ class OutputPresenter:
             'inbound_time_start': '海外仓入库时间开始',
             'inbound_time_end': '海外仓入库时间结束',
         },
+        'query_container_timeliness_list': {
+            'container_codes': '柜号',
+            'bl_numbers': '提单号',
+            'departure_time_start': '干线实际出发时间开始',
+            'departure_time_end': '干线实际出发时间结束',
+            'page': '页码',
+            'limit': '每页数量',
+        },
+        'export_container_timeliness_report': {
+            'container_codes': '柜号',
+            'bl_numbers': '提单号',
+            'departure_time_start': '干线实际出发时间开始',
+            'departure_time_end': '干线实际出发时间结束',
+        },
         'export_receivable_cost_list': {
             'reference_numbers': '参考号',
             'tracking_numbers': '跟踪号',
@@ -823,6 +896,18 @@ class OutputPresenter:
             return self._present_destination_trailer_list(
                 data, tool_result.get('meta'), meta
             )
+        if tool_name in self.ORDER_ABNORMAL_TOOLS:
+            return self._present_order_abnormal_list(
+                data, tool_result.get('meta'), meta
+            )
+        if tool_name in self.RECEIVE_VOLUME_TOOLS:
+            return self._present_receive_volume_list(
+                data, tool_result.get('meta'), meta
+            )
+        if tool_name in self.CONTAINER_TIMELINESS_TOOLS:
+            return self._present_container_timeliness_list(
+                data, tool_result.get('meta'), meta
+            )
         if tool_name in self.TABLE_TOOLS:
             return self._present_table(
                 tool_name,
@@ -1645,6 +1730,134 @@ class OutputPresenter:
         }
         return self._success_result(content, self._render_table(content), meta)
 
+    def _present_order_abnormal_list(self, data, raw_meta, meta):
+        if set(data) != {'abnormal_status', 'columns', 'records'}:
+            return self._format_error(meta)
+        abnormal_status = data.get('abnormal_status')
+        if abnormal_status not in self.ORDER_ABNORMAL_STATUSES:
+            return self._format_error(meta)
+        expected = list(self.ORDER_ABNORMAL_COLUMNS)
+        pagination = self._customer_pagination(raw_meta)
+        columns = data.get('columns')
+        records = data.get('records')
+        if (
+            not isinstance(columns, list)
+            or not isinstance(records, list)
+            or len(columns) != len(expected)
+            or pagination is None
+        ):
+            return self._format_error(meta)
+        for column, (key, name) in zip(columns, expected):
+            if column != {'key': key, 'name': name}:
+                return self._format_error(meta)
+        rows = []
+        expected_keys = [key for key, _ in expected]
+        for record in records:
+            if not isinstance(record, dict) or set(record) != set(expected_keys):
+                return self._format_error(meta)
+            row = []
+            for key in expected_keys:
+                value = record[key]
+                if not isinstance(value, str):
+                    return self._format_error(meta)
+                row.append(value)
+            rows.append(row)
+        headers = [{'label': name} for _, name in expected]
+        content = {
+            'abnormal_status': abnormal_status,
+            'headers': headers,
+            'rows': rows,
+            'pagination': pagination,
+        }
+        return self._success_result(content, self._render_table(content), meta)
+
+    def _present_receive_volume_list(self, data, raw_meta, meta):
+        if set(data) != {'columns', 'records'}:
+            return self._format_error(meta)
+        expected = list(self.RECEIVE_VOLUME_COLUMNS)
+        pagination = self._customer_pagination(raw_meta)
+        columns = data.get('columns')
+        records = data.get('records')
+        if (
+            not isinstance(columns, list)
+            or not isinstance(records, list)
+            or len(columns) != len(expected)
+            or pagination is None
+        ):
+            return self._format_error(meta)
+        for column, (key, name) in zip(columns, expected):
+            if column != {'key': key, 'name': name}:
+                return self._format_error(meta)
+        rows = []
+        expected_keys = [key for key, _ in expected]
+        for record in records:
+            if not isinstance(record, dict) or set(record) != set(expected_keys):
+                return self._format_error(meta)
+            row = []
+            for key in expected_keys:
+                value = record[key]
+                if key == 'inbound_volume':
+                    if not self._valid_volume_cell(value):
+                        return self._format_error(meta)
+                    row.append(value)
+                    continue
+                if not isinstance(value, str):
+                    return self._format_error(meta)
+                row.append(value)
+            rows.append(row)
+        headers = [{'label': name} for _, name in expected]
+        content = {
+            'headers': headers,
+            'rows': rows,
+            'pagination': pagination,
+        }
+        return self._success_result(content, self._render_table(content), meta)
+
+    def _present_container_timeliness_list(self, data, raw_meta, meta):
+        if set(data) != {'columns', 'records'}:
+            return self._format_error(meta)
+        expected = list(self.CONTAINER_TIMELINESS_COLUMNS)
+        pagination = self._customer_pagination(raw_meta)
+        columns = data.get('columns')
+        records = data.get('records')
+        if (
+            not isinstance(columns, list)
+            or not isinstance(records, list)
+            or len(columns) != len(expected)
+            or pagination is None
+        ):
+            return self._format_error(meta)
+        for column, (key, name) in zip(columns, expected):
+            if column != {'key': key, 'name': name}:
+                return self._format_error(meta)
+        rows = []
+        expected_keys = [key for key, _ in expected]
+        for record in records:
+            if not isinstance(record, dict) or set(record) != set(expected_keys):
+                return self._format_error(meta)
+            row = []
+            for key in expected_keys:
+                value = record[key]
+                if not isinstance(value, str):
+                    return self._format_error(meta)
+                row.append(value)
+            rows.append(row)
+        headers = [{'label': name} for _, name in expected]
+        content = {
+            'headers': headers,
+            'rows': rows,
+            'pagination': pagination,
+        }
+        return self._success_result(content, self._render_table(content), meta)
+
+    @staticmethod
+    def _valid_volume_cell(value):
+        return (
+            not isinstance(value, bool)
+            and isinstance(value, (int, float))
+            and math.isfinite(float(value))
+        )
+
     @staticmethod
     def _valid_amount_cell(value):
         if not isinstance(value, dict) or set(value) != {'amount', 'currency'}:

+ 306 - 0
tests/test_container_timeliness_tools.py

@@ -0,0 +1,306 @@
+import io
+import unittest
+
+from app import GatewayApp
+from public_gateway import PublicGatewayApp
+from services.output_presenter import OutputPresenter
+from tools.query_container_timeliness_list import (
+    COLUMNS,
+    QueryContainerTimelinessListTool,
+)
+from tools.export_container_timeliness_report import (
+    ExportContainerTimelinessReportTool,
+)
+
+
+class RecordingApiClient:
+    def __init__(self):
+        self.calls = []
+
+    def list_enabled_tools(self, request_id=''):
+        return {
+            'code': 'MCP_0000',
+            'data': {
+                'tool_codes': [
+                    'query_container_timeliness_list',
+                    'export_container_timeliness_report',
+                ],
+            },
+        }
+
+    def call_tool(self, tool_code, route_path, payload, request_id):
+        self.calls.append((tool_code, route_path, payload, request_id))
+        return {'code': 'MCP_0000', 'data': {}, 'meta': {}}
+
+
+class ContainerTimelinessToolContractTest(unittest.TestCase):
+    def test_query_schema_is_closed_without_identity_or_page_filters(self):
+        metadata = QueryContainerTimelinessListTool().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('query_container_timeliness_list', metadata['name'])
+        self.assertEqual(
+            '/mcp/tools/queryContainerTimelinessList',
+            QueryContainerTimelinessListTool.route_path,
+        )
+        self.assertFalse(schema['additionalProperties'])
+        self.assertEqual([], schema['required'])
+        self.assertEqual(
+            {
+                'container_codes',
+                'bl_numbers',
+                'departure_time_start',
+                'departure_time_end',
+                'page',
+                'limit',
+            },
+            set(schema['properties']),
+        )
+        for forbidden in (
+            'company_id', 'admin_id', 'is_super', 'outbound_numbers',
+            'ship_company', 'loading_id',
+        ):
+            self.assertNotIn(forbidden, schema['properties'])
+        description = metadata['description']
+        self.assertIn('使用场景:', description)
+        self.assertIn('禁止使用:', description)
+        self.assertIn('admin/Report/outboundReport', description)
+        self.assertIn('query_outbound_list', description)
+        self.assertIn('干线实际出发时间', description)
+        self.assertIn('54列', description)
+        self.assertIn('号码类型不明确时必须先询问用户', description)
+        self.assertIn('不得根据号码格式猜测', description)
+        self.assertIn('不得跨字段或跨工具试查', description)
+
+    def test_query_forwards_numbers_and_optional_departure_window(self):
+        client = RecordingApiClient()
+        QueryContainerTimelinessListTool(client).call(
+            container_codes=['CONT-1', ' CONT-1 '],
+            bl_numbers=['BL-1'],
+            departure_time_start='2026-09-01',
+            departure_time_end='2026-09-30',
+            page=2,
+            limit=10,
+        )
+        self.assertEqual(
+            (
+                'query_container_timeliness_list',
+                '/mcp/tools/queryContainerTimelinessList',
+                {
+                    'container_codes': ['CONT-1'],
+                    'bl_numbers': ['BL-1'],
+                    'departure_time_start': '2026-09-01',
+                    'departure_time_end': '2026-09-30',
+                    'page': 2,
+                    'limit': 10,
+                },
+                'rq_query_container_timeliness_list',
+            ),
+            client.calls[-1],
+        )
+
+    def test_query_rejects_empty_and_oversize_window(self):
+        tool = QueryContainerTimelinessListTool(RecordingApiClient())
+        with self.assertRaisesRegex(ValueError, 'provide'):
+            tool.call()
+        with self.assertRaisesRegex(ValueError, 'departure time range requires both'):
+            tool.call(departure_time_start='2026-09-01')
+        with self.assertRaisesRegex(ValueError, 'departure time window'):
+            tool.call(
+                departure_time_start='2026-08-01',
+                departure_time_end='2026-09-01',
+            )
+        with self.assertRaisesRegex(ValueError, 'is invalid'):
+            tool.call(departure_time_start='09/01/2026', departure_time_end='2026-09-02')
+        with self.assertRaisesRegex(ValueError, 'at most 200'):
+            tool.call(
+                container_codes=['C1'],
+                bl_numbers=['B{0}'.format(i) for i in range(200)],
+            )
+        with self.assertRaisesRegex(ValueError, 'non-empty'):
+            tool.call(container_codes=[])
+        with self.assertRaisesRegex(ValueError, 'strings'):
+            tool.call(container_codes=[1])
+        with self.assertRaisesRegex(ValueError, '1 to 100 chars'):
+            tool.call(container_codes=[''])
+        with self.assertRaisesRegex(ValueError, 'at most 200 container_codes'):
+            tool.call(container_codes=['C{0}'.format(i) for i in range(201)])
+        with self.assertRaisesRegex(ValueError, 'page is invalid'):
+            tool.call(container_codes=['CONT-1'], page=True)
+        with self.assertRaisesRegex(ValueError, 'page is invalid'):
+            tool.call(container_codes=['CONT-1'], page=0)
+        with self.assertRaisesRegex(ValueError, 'limit is invalid'):
+            tool.call(container_codes=['CONT-1'], limit='20')
+        with self.assertRaisesRegex(ValueError, '1 to 100 chars'):
+            tool.call(container_codes=['x' * 101])
+        with self.assertRaisesRegex(ValueError, 'departure time window'):
+            tool.call(
+                departure_time_start='2026-09-30',
+                departure_time_end='2026-09-01',
+            )
+        with self.assertRaisesRegex(RuntimeError, 'api client is required'):
+            QueryContainerTimelinessListTool().call(container_codes=['CONT-1'])
+        with self.assertRaisesRegex(RuntimeError, 'api client is required'):
+            ExportContainerTimelinessReportTool().call(container_codes=['CONT-1'])
+
+    def test_export_schema_forbids_pagination_and_requires_async_follow_up(self):
+        metadata = ExportContainerTimelinessReportTool().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('export_container_timeliness_report', metadata['name'])
+        self.assertFalse(schema['additionalProperties'])
+        self.assertEqual(
+            {
+                'container_codes',
+                'bl_numbers',
+                'departure_time_start',
+                'departure_time_end',
+            },
+            set(schema['properties']),
+        )
+        self.assertNotIn('page', schema['properties'])
+        description = metadata['description']
+        self.assertIn('明确要求导出', description)
+        self.assertIn('柜子时效', description)
+        self.assertIn('异步导出任务', description)
+        self.assertIn('query_export_task', description)
+        self.assertIn('不会在本次调用中等待文件生成', description)
+        self.assertIn('query_container_timeliness_list', description)
+
+    def test_export_forwards_locator_without_page(self):
+        client = RecordingApiClient()
+        ExportContainerTimelinessReportTool(client).call(
+            bl_numbers=['BL-1'],
+        )
+        self.assertEqual(
+            {
+                'bl_numbers': ['BL-1'],
+            },
+            client.calls[-1][2],
+        )
+        self.assertNotIn('page', client.calls[-1][2])
+
+    def test_cli_forwards_query_and_export_filters(self):
+        client = RecordingApiClient()
+        app = GatewayApp(api_client=client)
+        code = app.run_cli([
+            'call', '--tool', 'query_container_timeliness_list',
+            '--container-codes', 'CONT-1',
+            '--departure-time-start', '2026-09-01',
+            '--departure-time-end', '2026-09-14',
+            '--page', '2',
+            '--limit', '10',
+        ], stdout=io.StringIO())
+        self.assertEqual(0, code)
+        self.assertEqual(
+            {
+                'container_codes': ['CONT-1'],
+                'departure_time_start': '2026-09-01',
+                'departure_time_end': '2026-09-14',
+                'page': 2,
+                'limit': 10,
+            },
+            client.calls[-1][2],
+        )
+
+        code = app.run_cli([
+            'call', '--tool', 'export_container_timeliness_report',
+            '--bl-numbers', 'BL-1, BL-2',
+        ], stdout=io.StringIO())
+        self.assertEqual(0, code)
+        self.assertEqual(
+            {'bl_numbers': ['BL-1', 'BL-2']},
+            client.calls[-1][2],
+        )
+        self.assertNotIn('page', client.calls[-1][2])
+
+    def test_presenter_accepts_fifty_four_string_columns(self):
+        presenter = OutputPresenter()
+        columns = [{'key': key, 'name': name} for key, name in COLUMNS]
+        record = {key: 'v_{0}'.format(key) for key, _ in COLUMNS}
+        ok = presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [record]},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })
+        self.assertFalse(ok['is_error'])
+        self.assertEqual(54, len(ok['structured_content']['headers']))
+        self.assertEqual('v_container_code', ok['structured_content']['rows'][0][2])
+
+        numeric = dict(record)
+        numeric['total_volume'] = 1.2
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [numeric]},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [], 'extra': 1},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': []},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False,
+                'request_id': 'rq_x', 'total': 1,
+            },
+        })['is_error'])
+        bad_columns = list(columns)
+        bad_columns[0] = {'key': 'ship_company', 'name': '错'}
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': bad_columns, 'records': []},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        extra = dict(record)
+        extra['seq'] = '1'
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [extra]},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': 'bad'},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        short_columns = columns[:-1]
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': short_columns, 'records': []},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+        self.assertTrue(presenter.present('query_container_timeliness_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': ['bad']},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+            },
+        })['is_error'])
+
+    def test_local_and_public_registries_include_both_tools(self):
+        local = GatewayApp().registered_tool_names()
+        public = PublicGatewayApp(None, None).registered_tool_names()
+        self.assertEqual(local, public)
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
+        self.assertIn('query_container_timeliness_list', local)
+        self.assertIn('export_container_timeliness_report', local)
+
+
+if __name__ == '__main__':
+    unittest.main()

+ 1 - 1
tests/test_customer_payment_followup_tool.py

@@ -112,7 +112,7 @@ class CustomerPaymentFollowupToolTest(unittest.TestCase):
         local = GatewayApp(api_client=RecordingApiClient())
         public = PublicGatewayApp(None, None)
         self.assertEqual(local.registered_tool_names(), public.registered_tool_names())
-        self.assertEqual(28, len(local.registered_tool_names()))
+        self.assertEqual(34, len(local.registered_tool_names()))
         self.assertIn('query_customer_payment_followup', local.registered_tool_names())
 
         stdout = io.StringIO()

+ 1 - 1
tests/test_customer_payment_records_tool.py

@@ -118,7 +118,7 @@ class CustomerPaymentRecordsToolTest(unittest.TestCase):
         local = GatewayApp(api_client=client)
         public = PublicGatewayApp(None, None)
         self.assertEqual(local.registered_tool_names(), public.registered_tool_names())
-        self.assertEqual(28, len(local.registered_tool_names()))
+        self.assertEqual(34, len(local.registered_tool_names()))
         self.assertIn('query_customer_payment_records', local.registered_tool_names())
 
         stdout = io.StringIO()

+ 1 - 1
tests/test_customer_query_tools.py

@@ -68,7 +68,7 @@ class CustomerQueryToolTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
+        self.assertEqual(34, len(local))
         self.assertIn('query_customer_list', local)
         self.assertIn('list_customer_filter_options', local)
 

+ 1 - 1
tests/test_customer_unverified_bill_details_tool.py

@@ -61,7 +61,7 @@ class CustomerUnverifiedBillDetailsToolTest(unittest.TestCase):
         local = GatewayApp(api_client=client)
         public = PublicGatewayApp(None, None)
         self.assertEqual(local.registered_tool_names(), public.registered_tool_names())
-        self.assertEqual(28, len(local.registered_tool_names()))
+        self.assertEqual(34, len(local.registered_tool_names()))
         self.assertIn('query_customer_unverified_bill_details', local.registered_tool_names())
 
         output = StringIO()

+ 2 - 2
tests/test_destination_trailer_tools.py

@@ -387,8 +387,8 @@ class DestinationTrailerToolContractTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
-        self.assertEqual(27, len(OutputPresenter.SAFE_TOOLS))
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
         self.assertIn('query_destination_trailer_list', local)
         self.assertIn('list_destination_trailer_filter_options', local)
 

+ 2 - 2
tests/test_export_pallet_data_tool.py

@@ -296,9 +296,9 @@ class ExportPalletDataToolTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
+        self.assertEqual(34, len(local))
         self.assertIn('export_pallet_data', local)
-        self.assertEqual(27, len(OutputPresenter.SAFE_TOOLS))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
 
     def test_presenter_reuses_queued_export_contract(self):
         presented = OutputPresenter().present(

+ 2 - 2
tests/test_export_receivable_cost_list_tool.py

@@ -168,9 +168,9 @@ class ExportReceivableCostListToolTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
+        self.assertEqual(34, len(local))
         self.assertIn('export_receivable_cost_list', local)
-        self.assertEqual(27, len(OutputPresenter.SAFE_TOOLS))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
 
     def test_presenter_reuses_queued_export_contract(self):
         presented = OutputPresenter().present(

+ 347 - 0
tests/test_order_abnormal_tools.py

@@ -0,0 +1,347 @@
+import importlib
+import io
+import unittest
+
+from app import GatewayApp
+from public_gateway import PublicGatewayApp
+from services.output_presenter import OutputPresenter
+
+
+COLUMNS = [
+    ('order_number', '订单号'), ('customer_name', '客户'),
+    ('product_name', '物流产品'), ('abnormal_status', '问题件状态'),
+    ('abnormal_type', '问题件类型'), ('abnormal_desc', '问题件描述'),
+    ('outbound_status', '排舱单状态'), ('inbound_date', '入库时间'),
+    ('marker_name', '标记人'),
+]
+STATUSES = [
+    '待处理', '放行待审核', '包裹放行', '退件待审核', '退件驳回', '已退件',
+]
+
+
+class RecordingApiClient:
+    def __init__(self):
+        self.calls = []
+
+    def list_enabled_tools(self, request_id=''):
+        return {
+            'code': 'MCP_0000',
+            'data': {
+                'tool_codes': [
+                    'query_order_abnormal_list',
+                    'list_order_abnormal_filter_options',
+                ],
+            },
+        }
+
+    def call_tool(self, tool_code, route_path, payload, request_id):
+        self.calls.append((tool_code, route_path, payload, request_id))
+        return {'code': 'MCP_0000', 'data': {}, 'meta': {}}
+
+
+class OrderAbnormalToolContractTest(unittest.TestCase):
+    def tool_class(self, module_name, class_name):
+        return getattr(importlib.import_module('tools.' + module_name), class_name)
+
+    def test_query_schema_requires_status_and_forbids_identity(self):
+        cls = self.tool_class(
+            'query_order_abnormal_list', 'QueryOrderAbnormalListTool'
+        )
+        metadata = cls().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('query_order_abnormal_list', metadata['name'])
+        self.assertEqual('/mcp/tools/queryOrderAbnormalList', cls.route_path)
+        self.assertFalse(schema['additionalProperties'])
+        self.assertEqual(['abnormal_status'], schema['required'])
+        self.assertEqual(STATUSES, schema['properties']['abnormal_status']['enum'])
+        self.assertNotIn('default', schema['properties']['abnormal_status'])
+        for forbidden in (
+            'company_id', 'admin_id', 'is_super', 'customer_id', 'product_id',
+        ):
+            self.assertNotIn(forbidden, schema['properties'])
+        self.assertIn('使用场景:', metadata['description'])
+        self.assertIn('禁止使用:', metadata['description'])
+        self.assertIn('号码类型不明确时必须先询问用户', metadata['description'])
+        self.assertIn('不得根据号码格式猜测', metadata['description'])
+        self.assertIn('不得跨字段或跨工具试查', metadata['description'])
+        self.assertIn('admin/Order/abnormal', metadata['description'])
+        self.assertIn('订单号可选', metadata['description'])
+
+    def test_query_forwards_optional_order_numbers(self):
+        cls = self.tool_class(
+            'query_order_abnormal_list', 'QueryOrderAbnormalListTool'
+        )
+        client = RecordingApiClient()
+        cls(client).call(
+            abnormal_status='包裹放行',
+            order_numbers=[' FMS-1 ', 'FMS-1'],
+            page=2,
+            limit=30,
+            request_id='rq_abn',
+        )
+        self.assertEqual(
+            (
+                'query_order_abnormal_list',
+                '/mcp/tools/queryOrderAbnormalList',
+                {
+                    'abnormal_status': '包裹放行',
+                    'order_numbers': ['FMS-1'],
+                    'page': 2,
+                    'limit': 30,
+                },
+                'rq_abn',
+            ),
+            client.calls[-1],
+        )
+        cls(client).call(abnormal_status='待处理')
+        self.assertEqual(
+            {'abnormal_status': '待处理', 'page': 1, 'limit': 20},
+            client.calls[-1][2],
+        )
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='结案')
+        with self.assertRaises(RuntimeError):
+            cls().call(abnormal_status='待处理')
+
+    def test_filter_schema_and_call(self):
+        cls = self.tool_class(
+            'list_order_abnormal_filter_options',
+            'ListOrderAbnormalFilterOptionsTool',
+        )
+        metadata = cls().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('list_order_abnormal_filter_options', metadata['name'])
+        self.assertEqual(
+            '/mcp/tools/listOrderAbnormalFilterOptions', cls.route_path
+        )
+        self.assertEqual(['filter_type'], schema['required'])
+        self.assertEqual(['问题件状态'], schema['properties']['filter_type']['enum'])
+        self.assertIn('query_order_abnormal_list', metadata['description'])
+        self.assertIn('禁止猜测', metadata['description'])
+
+        client = RecordingApiClient()
+        cls(client).call('问题件状态', keyword='待', page=2, limit=10)
+        self.assertEqual(
+            {
+                'filter_type': '问题件状态',
+                'keyword': '待',
+                'page': 2,
+                'limit': 10,
+            },
+            client.calls[-1][2],
+        )
+        with self.assertRaises(ValueError):
+            cls(client).call('问题件类型')
+        with self.assertRaises(RuntimeError):
+            cls().call('问题件状态')
+        with self.assertRaises(ValueError):
+            cls(client).call('问题件状态', keyword='x' * 101)
+        with self.assertRaises(ValueError):
+            cls(client).call('问题件状态', page=0)
+        with self.assertRaises(ValueError):
+            cls(client).call('问题件状态', limit=True)
+
+    def test_query_covers_remaining_validation_branches(self):
+        cls = self.tool_class(
+            'query_order_abnormal_list', 'QueryOrderAbnormalListTool'
+        )
+        client = RecordingApiClient()
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                abnormal_status='待处理',
+                order_numbers=['X%s' % i for i in range(201)],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', order_numbers='FMS-1')
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', order_numbers=[1])
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', order_numbers=[' '])
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                abnormal_status='待处理',
+                order_numbers=['X' * 101],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', page=0)
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', limit=True)
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', order_numbers=[])
+        with self.assertRaises(ValueError):
+            cls(client).call(abnormal_status='待处理', page=101)
+
+    def test_cli_forwards_status_and_order_numbers(self):
+        client = RecordingApiClient()
+        app = GatewayApp(api_client=client)
+        with self.assertRaises(ValueError):
+            app.run_cli([
+                'call', '--tool', 'query_order_abnormal_list',
+            ], stdout=io.StringIO())
+        app.run_cli([
+            'call', '--tool', 'query_order_abnormal_list',
+            '--abnormal-status', '退件待审核',
+            '--order-numbers', ' FMS-1,FMS-2 ',
+        ], stdout=io.StringIO())
+        self.assertEqual(
+            {
+                'abnormal_status': '退件待审核',
+                'order_numbers': ['FMS-1', 'FMS-2'],
+                'page': 1,
+                'limit': 20,
+            },
+            client.calls[-1][2],
+        )
+        app.run_cli([
+            'call', '--tool', 'query_order_abnormal_list',
+            '--abnormal-status', '待处理',
+        ], stdout=io.StringIO())
+        self.assertEqual(
+            {'abnormal_status': '待处理', 'page': 1, 'limit': 20},
+            client.calls[-1][2],
+        )
+        app.run_cli([
+            'call', '--tool', 'list_order_abnormal_filter_options',
+            '--filter-type', '问题件状态',
+        ], stdout=io.StringIO())
+        self.assertEqual('list_order_abnormal_filter_options', client.calls[-1][0])
+        with self.assertRaises(ValueError):
+            app.run_cli([
+                'call', '--tool', 'list_order_abnormal_filter_options',
+            ], stdout=io.StringIO())
+
+    def test_presenter_renders_nine_columns_and_fails_closed(self):
+        presenter = OutputPresenter()
+        meta = {
+            'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+        }
+        columns = [{'key': key, 'name': name} for key, name in COLUMNS]
+        record = {key: 'v' for key, _ in COLUMNS}
+        record['abnormal_status'] = '待处理'
+        ok = presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': [record],
+            },
+            'meta': meta,
+        })
+        self.assertFalse(ok['is_error'])
+        self.assertEqual(
+            ['订单号', '客户', '物流产品', '问题件状态', '问题件类型',
+             '问题件描述', '排舱单状态', '入库时间', '标记人'],
+            [item['label'] for item in ok['structured_content']['headers']],
+        )
+
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': [],
+                'records': [],
+                'extra': 1,
+            },
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '结案',
+                'columns': columns,
+                'records': [],
+            },
+            'meta': meta,
+        })['is_error'])
+        bad_columns = list(columns)
+        bad_columns[0] = {'key': 'order_number', 'name': '错'}
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': bad_columns,
+                'records': [],
+            },
+            'meta': meta,
+        })['is_error'])
+        bad_record = dict(record)
+        bad_record['order_number'] = 1
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': [bad_record],
+            },
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': 'bad',
+            },
+            'meta': meta,
+        })['is_error'])
+        extra_record = dict(record)
+        extra_record['deal_remark'] = 'x'
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': [extra_record],
+            },
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': None,
+                'records': [],
+            },
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': [None],
+            },
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_order_abnormal_list', {
+            'code': 'MCP_0000',
+            'data': {
+                'abnormal_status': '待处理',
+                'columns': columns,
+                'records': [],
+            },
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False,
+                'request_id': 'rq_x', 'total': 1,
+            },
+        })['is_error'])
+
+        options = presenter.present('list_order_abnormal_filter_options', {
+            'code': 'MCP_0000',
+            'data': {
+                'records': [
+                    {'value': '待处理', 'label': '待处理', 'code': ''},
+                ],
+            },
+            'meta': meta,
+        })
+        self.assertFalse(options['is_error'])
+
+    def test_local_public_registry_includes_both_tools(self):
+        local = GatewayApp().registered_tool_names()
+        public = PublicGatewayApp(None, None).registered_tool_names()
+        self.assertEqual(local, public)
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
+        self.assertIn('query_order_abnormal_list', local)
+        self.assertIn('list_order_abnormal_filter_options', local)

+ 1 - 1
tests/test_order_receivable_cost_details_tool.py

@@ -86,7 +86,7 @@ class OrderReceivableCostDetailsToolTest(unittest.TestCase):
         local = GatewayApp(api_client=client)
         public = PublicGatewayApp(None, None)
         self.assertEqual(local.registered_tool_names(), public.registered_tool_names())
-        self.assertEqual(28, len(local.registered_tool_names()))
+        self.assertEqual(34, len(local.registered_tool_names()))
         self.assertIn('query_order_receivable_cost_details', local.registered_tool_names())
         self.assertIn('query_customer_payment_records', local.registered_tool_names())
 

+ 2 - 1
tests/test_output_presenter.py

@@ -203,7 +203,7 @@ class OutputPresenterTest(unittest.TestCase):
     def test_customer_tools_are_safe_and_total_is_24(self):
         self.assertTrue(self.presenter.handles(QueryCustomerListTool.name))
         self.assertTrue(self.presenter.handles(ListCustomerFilterOptionsTool.name))
-        self.assertEqual(27, len(self.presenter.SAFE_TOOLS))
+        self.assertEqual(33, len(self.presenter.SAFE_TOOLS))
 
     def test_exact_order_uses_labels_and_drops_internal_fields(self):
         result = self.presenter.present(
@@ -442,6 +442,7 @@ class OutputPresenterTest(unittest.TestCase):
             'export_out_of_province_port_data',
             'export_receivable_cost_list',
             'export_pallet_data',
+            'export_container_timeliness_report',
         ):
             with self.subTest(tool_name=tool_name):
                 result = self.presenter.present(

+ 2 - 2
tests/test_payable_cost_tools.py

@@ -231,8 +231,8 @@ class PayableCostToolContractTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
-        self.assertEqual(27, len(OutputPresenter.SAFE_TOOLS))
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
         self.assertEqual(
             (
                 'query_payable_cost_list',

+ 1 - 1
tests/test_query_export_task_tool.py

@@ -63,7 +63,7 @@ class QueryExportTaskToolTest(unittest.TestCase):
         public = PublicGatewayApp(None, None).registered_tool_names()
 
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
+        self.assertEqual(34, len(local))
         self.assertIn('query_export_task', local)
 
     def test_cli_forwards_only_task_reference(self):

+ 2 - 2
tests/test_receivable_cost_list_tools.py

@@ -274,8 +274,8 @@ class ReceivableCostIntegrationTest(unittest.TestCase):
         local = GatewayApp().registered_tool_names()
         public = PublicGatewayApp(None, None).registered_tool_names()
         self.assertEqual(local, public)
-        self.assertEqual(28, len(local))
-        self.assertEqual(27, len(OutputPresenter.SAFE_TOOLS))
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
         self.assertEqual(
             (
                 'query_receivable_cost_list',

+ 412 - 0
tests/test_receive_volume_tools.py

@@ -0,0 +1,412 @@
+import importlib
+import io
+import math
+import unittest
+
+from app import GatewayApp
+from public_gateway import PublicGatewayApp
+from services.output_presenter import OutputPresenter
+
+
+COLUMNS = [
+    ('order_number', '订单号'),
+    ('customer_name', '客户名称'),
+    ('packing_type', '货物类型'),
+    ('inbound_volume', '入库体积'),
+    ('inbound_date', '入库时间'),
+    ('sales_name', '商务经理'),
+    ('merchandiser_name', '客户经理'),
+    ('department_name', '事业部'),
+    ('product_name', '物流产品'),
+]
+FILTER_TYPES = ['客户名称', '商务经理', '客户经理', '货物类型', '物流产品']
+
+
+class RecordingApiClient:
+    def __init__(self):
+        self.calls = []
+
+    def list_enabled_tools(self, request_id=''):
+        return {
+            'code': 'MCP_0000',
+            'data': {
+                'tool_codes': [
+                    'query_receive_volume_list',
+                    'list_receive_volume_filter_options',
+                ],
+            },
+        }
+
+    def call_tool(self, tool_code, route_path, payload, request_id):
+        self.calls.append((tool_code, route_path, payload, request_id))
+        return {'code': 'MCP_0000', 'data': {}, 'meta': {}}
+
+
+class ReceiveVolumeToolContractTest(unittest.TestCase):
+    def tool_class(self, module_name, class_name):
+        return getattr(importlib.import_module('tools.' + module_name), class_name)
+
+    def test_query_schema_requires_inbound_dates_and_forbids_identity(self):
+        cls = self.tool_class(
+            'query_receive_volume_list', 'QueryReceiveVolumeListTool'
+        )
+        metadata = cls().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('query_receive_volume_list', metadata['name'])
+        self.assertEqual('/mcp/tools/queryReceiveVolumeList', cls.route_path)
+        self.assertFalse(schema['additionalProperties'])
+        self.assertEqual(
+            ['inbound_date_start', 'inbound_date_end'],
+            schema['required'],
+        )
+        for forbidden in (
+            'company_id', 'admin_id', 'is_super', 'order_numbers',
+            'business_date_start',
+        ):
+            self.assertNotIn(forbidden, schema['properties'])
+        self.assertIn('使用场景:', metadata['description'])
+        self.assertIn('禁止使用:', metadata['description'])
+        self.assertIn('入库时间', metadata['description'])
+        self.assertIn('admin/Report/receiveForm', metadata['description'])
+        self.assertIn('list_receive_volume_filter_options', metadata['description'])
+        self.assertIn('不得改走query_order', metadata['description'])
+
+    def test_query_forwards_optional_filters(self):
+        cls = self.tool_class(
+            'query_receive_volume_list', 'QueryReceiveVolumeListTool'
+        )
+        client = RecordingApiClient()
+        cls(client).call(
+            inbound_date_start='2026-09-01',
+            inbound_date_end='2026-09-30',
+            customer_ids=[11, 11, 12],
+            sales_ids=[3],
+            merchandiser_ids=[4],
+            packing_types=[' 散货 ', '散货'],
+            product_ids=[8],
+            page=2,
+            limit=30,
+            request_id='rq_rv',
+        )
+        self.assertEqual(
+            (
+                'query_receive_volume_list',
+                '/mcp/tools/queryReceiveVolumeList',
+                {
+                    'inbound_date_start': '2026-09-01',
+                    'inbound_date_end': '2026-09-30',
+                    'customer_ids': [11, 12],
+                    'sales_ids': [3],
+                    'merchandiser_ids': [4],
+                    'packing_types': ['散货'],
+                    'product_ids': [8],
+                    'page': 2,
+                    'limit': 30,
+                },
+                'rq_rv',
+            ),
+            client.calls[-1],
+        )
+        cls(client).call(
+            inbound_date_start='2026-09-01',
+            inbound_date_end='2026-09-01',
+        )
+        self.assertEqual(
+            {
+                'inbound_date_start': '2026-09-01',
+                'inbound_date_end': '2026-09-01',
+                'page': 1,
+                'limit': 20,
+            },
+            client.calls[-1][2],
+        )
+        with self.assertRaises(RuntimeError):
+            cls().call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+            )
+
+    def test_query_rejects_invalid_window_and_ids(self):
+        cls = self.tool_class(
+            'query_receive_volume_list', 'QueryReceiveVolumeListTool'
+        )
+        client = RecordingApiClient()
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-30',
+                inbound_date_end='2026-09-01',
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-08-01',
+                inbound_date_end='2026-09-01',
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                customer_ids=[0],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                packing_types=[''],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                sales_ids=list(range(1, 202)),
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                packing_types=['x' * 101],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                packing_types=[1],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                packing_types=[],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='bad',
+                inbound_date_end='2026-09-30',
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-9-01',
+                inbound_date_end='2026-09-30',
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                packing_types=['n{0}'.format(i) for i in range(201)],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                product_ids=['8'],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                merchandiser_ids=[],
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                page=101,
+            )
+        with self.assertRaises(ValueError):
+            cls(client).call(
+                inbound_date_start='2026-09-01',
+                inbound_date_end='2026-09-30',
+                limit=True,
+            )
+
+    def test_filter_schema_and_call(self):
+        cls = self.tool_class(
+            'list_receive_volume_filter_options',
+            'ListReceiveVolumeFilterOptionsTool',
+        )
+        metadata = cls().metadata()
+        schema = metadata['input_schema']
+        self.assertEqual('list_receive_volume_filter_options', metadata['name'])
+        self.assertEqual(
+            '/mcp/tools/listReceiveVolumeFilterOptions', cls.route_path
+        )
+        self.assertEqual(['filter_type'], schema['required'])
+        self.assertEqual(FILTER_TYPES, schema['properties']['filter_type']['enum'])
+        self.assertIn('query_receive_volume_list', metadata['description'])
+        self.assertIn('禁止猜测', metadata['description'])
+        self.assertIn('使用场景:', metadata['description'])
+        self.assertIn('禁止使用:', metadata['description'])
+
+        client = RecordingApiClient()
+        cls(client).call('货物类型', keyword='散', page=2, limit=10)
+        self.assertEqual(
+            {
+                'filter_type': '货物类型',
+                'keyword': '散',
+                'page': 2,
+                'limit': 10,
+            },
+            client.calls[-1][2],
+        )
+        with self.assertRaises(ValueError):
+            cls(client).call('事业部')
+        with self.assertRaises(RuntimeError):
+            cls().call('客户名称')
+        with self.assertRaises(ValueError):
+            cls(client).call('客户名称', keyword='x' * 101)
+        with self.assertRaises(ValueError):
+            cls(client).call('客户名称', page=0)
+        with self.assertRaises(ValueError):
+            cls(client).call('客户名称', page=True)
+
+    def test_cli_forwards_dates_and_filters(self):
+        client = RecordingApiClient()
+        app = GatewayApp(api_client=client)
+        with self.assertRaises(ValueError):
+            app.run_cli([
+                'call', '--tool', 'query_receive_volume_list',
+            ], stdout=io.StringIO())
+        app.run_cli([
+            'call', '--tool', 'query_receive_volume_list',
+            '--inbound-date-start', '2026-09-01',
+            '--inbound-date-end', '2026-09-30',
+            '--customer-ids', '11,12',
+            '--sales-ids', '3',
+            '--merchandiser-ids', '4',
+            '--packing-types', '散货,整柜',
+            '--product-ids', '8',
+        ], stdout=io.StringIO())
+        self.assertEqual(
+            {
+                'inbound_date_start': '2026-09-01',
+                'inbound_date_end': '2026-09-30',
+                'customer_ids': [11, 12],
+                'sales_ids': [3],
+                'merchandiser_ids': [4],
+                'packing_types': ['散货', '整柜'],
+                'product_ids': [8],
+                'page': 1,
+                'limit': 20,
+            },
+            client.calls[-1][2],
+        )
+        app.run_cli([
+            'call', '--tool', 'query_receive_volume_list',
+            '--inbound-date-start', '2026-09-01',
+            '--inbound-date-end', '2026-09-02',
+        ], stdout=io.StringIO())
+        self.assertEqual(
+            {
+                'inbound_date_start': '2026-09-01',
+                'inbound_date_end': '2026-09-02',
+                'page': 1,
+                'limit': 20,
+            },
+            client.calls[-1][2],
+        )
+        app.run_cli([
+            'call', '--tool', 'list_receive_volume_filter_options',
+            '--filter-type', '物流产品',
+        ], stdout=io.StringIO())
+        self.assertEqual(
+            {
+                'filter_type': '物流产品',
+                'keyword': '',
+                'page': 1,
+                'limit': 20,
+            },
+            client.calls[-1][2],
+        )
+
+    def test_presenter_accepts_nine_columns_and_finite_volume(self):
+        presenter = OutputPresenter()
+        columns = [{'key': key, 'name': name} for key, name in COLUMNS]
+        record = {
+            'order_number': 'FMS-1',
+            'customer_name': '客户甲',
+            'packing_type': '散货',
+            'inbound_volume': 12.5,
+            'inbound_date': '2026-09-01',
+            'sales_name': '张三',
+            'merchandiser_name': '李四',
+            'department_name': '事业部A',
+            'product_name': '美线-US01',
+        }
+        meta = {
+            'page': 1, 'limit': 20, 'has_more': False, 'request_id': 'rq_x',
+        }
+        ok = presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [record]},
+            'meta': meta,
+        })
+        self.assertFalse(ok['is_error'])
+        self.assertEqual(12.5, ok['structured_content']['rows'][0][3])
+
+        string_volume = dict(record)
+        string_volume['inbound_volume'] = '12.5'
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [string_volume]},
+            'meta': meta,
+        })['is_error'])
+        inf_volume = dict(record)
+        inf_volume['inbound_volume'] = math.inf
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [inf_volume]},
+            'meta': meta,
+        })['is_error'])
+        extra = dict(record)
+        extra['inbound_pieces'] = '1'
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [extra]},
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [], 'extra': 1},
+            'meta': meta,
+        })['is_error'])
+        bad_columns = list(columns)
+        bad_columns[0] = {'key': 'order_number', 'name': '错'}
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': bad_columns, 'records': []},
+            'meta': meta,
+        })['is_error'])
+        non_string = dict(record)
+        non_string['order_number'] = 1
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': [non_string]},
+            'meta': meta,
+        })['is_error'])
+        self.assertTrue(presenter.present('query_receive_volume_list', {
+            'code': 'MCP_0000',
+            'data': {'columns': columns, 'records': []},
+            'meta': {
+                'page': 1, 'limit': 20, 'has_more': False,
+                'request_id': 'rq_x', 'total': 1,
+            },
+        })['is_error'])
+
+        options = presenter.present('list_receive_volume_filter_options', {
+            'code': 'MCP_0000',
+            'data': {
+                'records': [
+                    {'value': '散货', 'label': '散货', 'code': ''},
+                ],
+            },
+            'meta': meta,
+        })
+        self.assertFalse(options['is_error'])
+
+    def test_local_public_registry_includes_both_tools(self):
+        local = GatewayApp().registered_tool_names()
+        public = PublicGatewayApp(None, None).registered_tool_names()
+        self.assertEqual(local, public)
+        self.assertEqual(34, len(local))
+        self.assertEqual(33, len(OutputPresenter.SAFE_TOOLS))
+        self.assertIn('query_receive_volume_list', local)
+        self.assertIn('list_receive_volume_filter_options', local)

+ 40 - 0
tests/test_tool_description_boundaries.py

@@ -19,6 +19,18 @@ from tools.query_destination_trailer_list import QueryDestinationTrailerListTool
 from tools.list_destination_trailer_filter_options import (
     ListDestinationTrailerFilterOptionsTool,
 )
+from tools.query_order_abnormal_list import QueryOrderAbnormalListTool
+from tools.list_order_abnormal_filter_options import (
+    ListOrderAbnormalFilterOptionsTool,
+)
+from tools.query_receive_volume_list import QueryReceiveVolumeListTool
+from tools.list_receive_volume_filter_options import (
+    ListReceiveVolumeFilterOptionsTool,
+)
+from tools.query_container_timeliness_list import QueryContainerTimelinessListTool
+from tools.export_container_timeliness_report import (
+    ExportContainerTimelinessReportTool,
+)
 from tools.query_track import QueryTrackTool
 
 
@@ -38,6 +50,12 @@ class ToolDescriptionBoundaryTest(unittest.TestCase):
             ExportPalletDataTool(),
             QueryDestinationTrailerListTool(),
             ListDestinationTrailerFilterOptionsTool(),
+            QueryOrderAbnormalListTool(),
+            ListOrderAbnormalFilterOptionsTool(),
+            QueryReceiveVolumeListTool(),
+            ListReceiveVolumeFilterOptionsTool(),
+            QueryContainerTimelinessListTool(),
+            ExportContainerTimelinessReportTool(),
         )
 
         for tool in tools:
@@ -57,6 +75,9 @@ class ToolDescriptionBoundaryTest(unittest.TestCase):
             ExportOutOfProvincePortDataTool(),
             ExportPalletDataTool(),
             QueryDestinationTrailerListTool(),
+            QueryOrderAbnormalListTool(),
+            QueryContainerTimelinessListTool(),
+            ExportContainerTimelinessReportTool(),
         )
 
         for tool in tools:
@@ -88,6 +109,24 @@ class ToolDescriptionBoundaryTest(unittest.TestCase):
             ListDestinationTrailerFilterOptionsTool(): (
                 'query_destination_trailer_list', '禁止猜测', '排舱列表',
             ),
+            QueryOrderAbnormalListTool(): (
+                '头程问题件', 'admin/Order/abnormal', 'query_order',
+            ),
+            ListOrderAbnormalFilterOptionsTool(): (
+                'query_order_abnormal_list', '禁止猜测', '作废审核',
+            ),
+            QueryReceiveVolumeListTool(): (
+                '收货量', 'admin/Report/receiveForm', 'query_order',
+            ),
+            ListReceiveVolumeFilterOptionsTool(): (
+                'query_receive_volume_list', '禁止猜测', '导出',
+            ),
+            QueryContainerTimelinessListTool(): (
+                '柜子时效', 'admin/Report/outboundReport', 'query_outbound_list',
+            ),
+            ExportContainerTimelinessReportTool(): (
+                '明确要求导出', '柜子时效', 'query_export_task',
+            ),
         }
 
         for tool, phrases in expected.items():
@@ -116,6 +155,7 @@ class ToolDescriptionBoundaryTest(unittest.TestCase):
             ExportPendingOutboundOrdersTool(),
             ExportOutOfProvincePortDataTool(),
             ExportPalletDataTool(),
+            ExportContainerTimelinessReportTool(),
         ):
             with self.subTest(tool=tool.name):
                 description = tool.metadata()['description']

+ 99 - 0
tools/export_container_timeliness_report.py

@@ -0,0 +1,99 @@
+from tools.query_container_timeliness_list import QueryContainerTimelinessListTool
+
+
+class ExportContainerTimelinessReportTool:
+    name = 'export_container_timeliness_report'
+    route_path = '/mcp/tools/exportContainerTimelinessReport'
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        date_field = {
+            'type': 'string',
+            'format': 'date',
+            'pattern': '^\\d{4}-\\d{2}-\\d{2}$',
+        }
+        number_array = {
+            'type': 'array',
+            'minItems': 1,
+            'maxItems': 200,
+            'items': {
+                'type': 'string',
+                'minLength': 1,
+                'maxLength': 100,
+                'pattern': '.*\\S.*',
+            },
+        }
+        return {
+            'name': self.name,
+            'description': (
+                '本工具只提交异步导出任务,不会在本次调用中等待文件生成,也禁止在一次调用内'
+                '轮询任务状态。成功后返回任务引用(task_ref)和建议等待时间'
+                '(retry_after_seconds)。稍后单独使用 query_export_task 查询任务状态或下载链接。'
+                '使用场景:只有用户明确要求导出柜子时效统计报表并需要下载文件时才可调用。'
+                '必须提供柜号数组、提单号数组或最多31个起运港当地日历日的干线实际出发时间闭区间;'
+                '没有号码时干线实际出发时间必填,有号码时时间可选。柜号与提单号可同时传入并按AND收窄。'
+                '号码类型不明确时必须先询问用户;用户没有明确号码类型时必须先询问:'
+                '“请确认使用哪种号码导出:柜号还是提单号?”确认前不得调用。'
+                '禁止使用:查看柜子时效表格、排舱列表、混用出库时间或其他后台页面筛选、'
+                '一次调用内轮询 query_export_task。看表格改走 query_container_timeliness_list。'
+                '不得根据号码格式猜测,不得跨字段或跨工具试查。'
+                '参数名仅用于工具调用;向用户回答时只能使用中文业务名称,'
+                '不得展示内部参数名。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'container_codes': dict(
+                        number_array,
+                        description=(
+                            '柜号数组。仅当用户明确说柜号时使用;'
+                            '不得放入其他类型号码。'
+                        ),
+                    ),
+                    'bl_numbers': dict(
+                        number_array,
+                        description=(
+                            '提单号数组。仅当用户明确说提单号时使用;'
+                            '不得放入其他类型号码。'
+                        ),
+                    ),
+                    'departure_time_start': dict(
+                        date_field,
+                        description='干线实际出发时间开始日期,起运港当地日历日 YYYY-MM-DD。',
+                    ),
+                    'departure_time_end': dict(
+                        date_field,
+                        description=(
+                            '干线实际出发时间结束日期,起运港当地日历日 YYYY-MM-DD,'
+                            '且与开始日期跨度不超过31个日历日。'
+                        ),
+                    ),
+                },
+                'required': [],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        container_codes=None,
+        bl_numbers=None,
+        departure_time_start=None,
+        departure_time_end=None,
+        request_id='rq_export_container_timeliness_report',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for export_container_timeliness_report'
+            )
+        payload = QueryContainerTimelinessListTool._locator_payload(
+            container_codes,
+            bl_numbers,
+            departure_time_start,
+            departure_time_end,
+        )
+        return self.api_client.call_tool(
+            self.name, self.route_path, payload, request_id,
+        )

+ 84 - 0
tools/list_order_abnormal_filter_options.py

@@ -0,0 +1,84 @@
+class ListOrderAbnormalFilterOptionsTool:
+    name = 'list_order_abnormal_filter_options'
+    route_path = '/mcp/tools/listOrderAbnormalFilterOptions'
+    FILTER_TYPES = ('问题件状态',)
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        return {
+            'name': self.name,
+            'description': (
+                '使用场景:用户需要筛选头程问题件列表时,先按中文筛选类别调用本工具,'
+                '取得后台同源的中文名称和可传值,再把选中的值传给query_order_abnormal_list。'
+                '问题件状态未明确时先列出六个中文页签并让用户选择。禁止使用:本工具不返回问题件业务数据,'
+                '禁止猜测任何筛选值,也禁止用于订单列表、排舱列表或作废审核。参数只用于工具内部调用;'
+                '最终回答只能展示中文业务名称;描述筛选条件时不得展示筛选字段的英文参数名,不得使用'
+                '“筛选字段=内部值”形式。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'filter_type': {
+                        'type': 'string',
+                        'enum': list(self.FILTER_TYPES),
+                        'description': '要查询的中文筛选类别。',
+                    },
+                    'keyword': {
+                        'type': 'string', 'maxLength': 100,
+                        'description': '按中文显示名称搜索;可不传以分页列出全部。',
+                    },
+                    'page': {
+                        'type': 'integer', 'minimum': 1, 'maximum': 100,
+                        'default': 1,
+                    },
+                    'limit': {
+                        'type': 'integer', 'minimum': 1, 'maximum': 100,
+                        'default': 20,
+                    },
+                },
+                'required': ['filter_type'],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        filter_type,
+        keyword='',
+        page=1,
+        limit=20,
+        request_id='rq_list_order_abnormal_filter_options',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for list_order_abnormal_filter_options'
+            )
+        filter_type = str(filter_type or '').strip()
+        if filter_type not in self.FILTER_TYPES:
+            raise ValueError('unsupported filter_type')
+        keyword = str(keyword or '').strip()
+        if len(keyword) > 100:
+            raise ValueError('keyword is too long')
+        page = self._bounded_integer(page, 'page')
+        limit = self._bounded_integer(limit, 'limit')
+        return self.api_client.call_tool(
+            self.name,
+            self.route_path,
+            {
+                'filter_type': filter_type,
+                'keyword': keyword,
+                'page': page,
+                'limit': limit,
+            },
+            request_id,
+        )
+
+    @staticmethod
+    def _bounded_integer(value, field):
+        if isinstance(value, bool) or not isinstance(value, int):
+            raise ValueError(field + ' is invalid')
+        if value < 1 or value > 100:
+            raise ValueError(field + ' is invalid')
+        return value

+ 86 - 0
tools/list_receive_volume_filter_options.py

@@ -0,0 +1,86 @@
+class ListReceiveVolumeFilterOptionsTool:
+    name = 'list_receive_volume_filter_options'
+    route_path = '/mcp/tools/listReceiveVolumeFilterOptions'
+    FILTER_TYPES = (
+        '客户名称', '商务经理', '客户经理', '货物类型', '物流产品',
+    )
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        return {
+            'name': self.name,
+            'description': (
+                '使用场景:用户需要筛选收货量列表时,先按中文筛选类别调用本工具,'
+                '取得后台同源的中文名称和可传值,再把选中的值传给query_receive_volume_list。'
+                '禁止使用:本工具不返回收货量业务数据,禁止猜测任何筛选值,也禁止用于'
+                '订单列表、应收费用或后台收货量导出。参数只用于工具内部调用;'
+                '最终回答只能展示中文业务名称;描述筛选条件时不得展示筛选字段的英文参数名,'
+                '不得使用“筛选字段=内部值”形式。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'filter_type': {
+                        'type': 'string',
+                        'enum': list(self.FILTER_TYPES),
+                        'description': '要查询的中文筛选类别。',
+                    },
+                    'keyword': {
+                        'type': 'string', 'maxLength': 100,
+                        'description': '按中文显示名称搜索;可不传以分页列出全部。',
+                    },
+                    'page': {
+                        'type': 'integer', 'minimum': 1, 'maximum': 100,
+                        'default': 1,
+                    },
+                    'limit': {
+                        'type': 'integer', 'minimum': 1, 'maximum': 100,
+                        'default': 20,
+                    },
+                },
+                'required': ['filter_type'],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        filter_type,
+        keyword='',
+        page=1,
+        limit=20,
+        request_id='rq_list_receive_volume_filter_options',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for list_receive_volume_filter_options'
+            )
+        filter_type = str(filter_type or '').strip()
+        if filter_type not in self.FILTER_TYPES:
+            raise ValueError('unsupported filter_type')
+        keyword = str(keyword or '').strip()
+        if len(keyword) > 100:
+            raise ValueError('keyword is too long')
+        page = self._bounded_integer(page, 'page')
+        limit = self._bounded_integer(limit, 'limit')
+        return self.api_client.call_tool(
+            self.name,
+            self.route_path,
+            {
+                'filter_type': filter_type,
+                'keyword': keyword,
+                'page': page,
+                'limit': limit,
+            },
+            request_id,
+        )
+
+    @staticmethod
+    def _bounded_integer(value, field):
+        if isinstance(value, bool) or not isinstance(value, int):
+            raise ValueError(field + ' is invalid')
+        if value < 1 or value > 100:
+            raise ValueError(field + ' is invalid')
+        return value

+ 248 - 0
tools/query_container_timeliness_list.py

@@ -0,0 +1,248 @@
+from datetime import datetime
+
+
+COLUMNS = (
+    ('ship_company', '船公司'),
+    ('bl_number', '提单号'),
+    ('container_code', '柜号'),
+    ('container_type', '柜型'),
+    ('is_direct_send_name', '是否直送'),
+    ('shipping_method', '运输方式'),
+    ('route', '航线'),
+    ('vessel_name', '航名航次'),
+    ('wharf_name', '到港码头'),
+    ('providers_name', '拖车行'),
+    ('dt_status_name', '柜子状态'),
+    ('warehouse_name', '交货仓库'),
+    ('order_total', '件数'),
+    ('total_volume', '体积'),
+    ('total_weight', '重量'),
+    ('loading_name', '起运港'),
+    ('destination_name', '目的港'),
+    ('delivery_address', '派送地址'),
+    ('has_throw_off_name', '甩柜'),
+    ('throw_off_time', '甩柜时间'),
+    ('ed_check_name', '报关查验'),
+    ('ed_check_time', '报关查验时间'),
+    ('qg_check_name', '清关查验'),
+    ('check_time', '清关查验时间'),
+    ('in_inspection_site', '进查验场时间'),
+    ('out_inspection_site', '出查验场时间'),
+    ('is_close_area_name', '封闭区'),
+    ('start_close_area', '进封闭区时间'),
+    ('end_close_area', '出封闭区时间'),
+    ('outbound_date', '出库时间'),
+    ('export_release_time', '出口报关放行时间'),
+    ('etd', '干线预计出发时间'),
+    ('eta', '干线预计到达时间'),
+    ('gxyjsx', '干线预计时效'),
+    ('departure_time', '干线实际出发时间'),
+    ('arrival_time', '干线实际到达时间'),
+    ('gxsjsx', '干线实际时效'),
+    ('hcsx', '航程时效'),
+    ('start_clearance_time', '开始清关时间'),
+    ('import_release_time', '海外清关放行时间'),
+    ('wharf_wait_time', '码头等待时间'),
+    ('pickup_time', '码头提柜时间'),
+    ('second_pickup_time', '二次提柜时间'),
+    ('tgsx', '提柜时效'),
+    ('max_appointment_delivery_time', 'APPT时间'),
+    ('delivery_end_time', '卡车实际派送时间'),
+    ('oversea_warehouse_name', '海外仓库名称'),
+    ('inbound_date', '到仓时间'),
+    ('inbound_time', '海外仓入库时间'),
+    ('container_return_date', '还空柜时间'),
+    ('hksx', '还空时效'),
+    ('amazon_wait_time', '亚马逊等待时间'),
+    ('inner_remark', '内部备注'),
+    ('financial_remark', '财务备注'),
+)
+
+
+class QueryContainerTimelinessListTool:
+    name = 'query_container_timeliness_list'
+    route_path = '/mcp/tools/queryContainerTimelinessList'
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        date_field = {
+            'type': 'string',
+            'format': 'date',
+            'pattern': '^\\d{4}-\\d{2}-\\d{2}$',
+        }
+        number_array = {
+            'type': 'array',
+            'minItems': 1,
+            'maxItems': 200,
+            'items': {
+                'type': 'string',
+                'minLength': 1,
+                'maxLength': 100,
+                'pattern': '.*\\S.*',
+            },
+        }
+        return {
+            'name': self.name,
+            'description': (
+                '使用场景:用户要看柜子时效统计报表表格(已出库排舱单一行一柜)时,'
+                '对照后台admin/Report/outboundReport导出列,固定54列,不含序号。'
+                '必须先确认柜号、提单号或最多31个起运港当地日历日的干线实际出发时间闭区间;'
+                '没有号码时干线实际出发时间必填,有号码时时间可选。柜号与提单号可同时传入并按AND收窄。'
+                '号码类型不明确时必须先询问用户:“请确认使用哪种号码查询:柜号还是提单号?”确认前不得调用。'
+                '不得根据号码格式猜测,不得跨字段或跨工具试查。'
+                '禁止使用:导出文件、排舱列表query_outbound_list、海外提柜列表、后台页面筛选'
+                '(船公司、港口、出库时间、查验勾选等)。看表格用本工具;用户明确要下载文件时改走'
+                'export_container_timeliness_report。'
+                '参数只用于工具内部调用;最终回答只能展示中文业务名称;描述筛选条件时不得展示筛选字段的'
+                '英文参数名。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'container_codes': dict(
+                        number_array,
+                        description=(
+                            '柜号数组。仅当用户明确说柜号时使用;'
+                            '不得放入其他类型号码。'
+                        ),
+                    ),
+                    'bl_numbers': dict(
+                        number_array,
+                        description=(
+                            '提单号数组。仅当用户明确说提单号时使用;'
+                            '不得放入其他类型号码。'
+                        ),
+                    ),
+                    'departure_time_start': dict(
+                        date_field,
+                        description='干线实际出发时间开始日期,起运港当地日历日 YYYY-MM-DD。',
+                    ),
+                    'departure_time_end': dict(
+                        date_field,
+                        description=(
+                            '干线实际出发时间结束日期,起运港当地日历日 YYYY-MM-DD,'
+                            '且与开始日期跨度不超过31个日历日。'
+                        ),
+                    ),
+                    'page': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 1,
+                    },
+                    'limit': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 20,
+                    },
+                },
+                'required': [],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        container_codes=None,
+        bl_numbers=None,
+        departure_time_start=None,
+        departure_time_end=None,
+        page=1,
+        limit=20,
+        request_id='rq_query_container_timeliness_list',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for query_container_timeliness_list'
+            )
+        payload = self._locator_payload(
+            container_codes,
+            bl_numbers,
+            departure_time_start,
+            departure_time_end,
+        )
+        payload['page'] = self._bounded_integer(page, 'page')
+        payload['limit'] = self._bounded_integer(limit, 'limit')
+        return self.api_client.call_tool(
+            self.name, self.route_path, payload, request_id,
+        )
+
+    @classmethod
+    def _locator_payload(
+        cls,
+        container_codes,
+        bl_numbers,
+        departure_time_start,
+        departure_time_end,
+    ):
+        payload = {}
+        if container_codes is not None:
+            payload['container_codes'] = cls._number_list(
+                'container_codes', container_codes
+            )
+        if bl_numbers is not None:
+            payload['bl_numbers'] = cls._number_list('bl_numbers', bl_numbers)
+        total = len(payload.get('container_codes', [])) + len(
+            payload.get('bl_numbers', [])
+        )
+        if total > 200:
+            raise ValueError('at most 200 container codes and bl numbers combined')
+        has_start = departure_time_start is not None
+        has_end = departure_time_end is not None
+        if has_start != has_end:
+            raise ValueError('departure time range requires both start and end')
+        if has_start:
+            start = cls._date(departure_time_start, 'departure_time_start')
+            end = cls._date(departure_time_end, 'departure_time_end')
+            cls._assert_window(start, end)
+            payload['departure_time_start'] = start
+            payload['departure_time_end'] = end
+        elif 'container_codes' not in payload and 'bl_numbers' not in payload:
+            raise ValueError(
+                'provide container codes, bl numbers, or a departure time range'
+            )
+        return payload
+
+    @staticmethod
+    def _date(value, field):
+        text = str(value or '').strip()
+        try:
+            parsed = datetime.strptime(text, '%Y-%m-%d').date()
+        except ValueError:
+            raise ValueError(field + ' is invalid')
+        return parsed.strftime('%Y-%m-%d')
+
+    @staticmethod
+    def _assert_window(start, end):
+        start_date = datetime.strptime(start, '%Y-%m-%d').date()
+        end_date = datetime.strptime(end, '%Y-%m-%d').date()
+        if end_date < start_date or (end_date - start_date).days > 30:
+            raise ValueError('departure time window is invalid')
+
+    @staticmethod
+    def _number_list(field, values):
+        if not isinstance(values, list) or not values:
+            raise ValueError(field + ' must be a non-empty list')
+        cleaned = []
+        for value in values:
+            if not isinstance(value, str):
+                raise ValueError(field + ' items must be strings')
+            item = value.strip()
+            if not item or len(item) > 100:
+                raise ValueError(field + ' items must be 1 to 100 chars')
+            if item not in cleaned:
+                cleaned.append(item)
+        if len(cleaned) > 200:
+            raise ValueError('at most 200 ' + field)
+        return cleaned
+
+    @staticmethod
+    def _bounded_integer(value, field):
+        if isinstance(value, bool) or not isinstance(value, int):
+            raise ValueError(field + ' is invalid')
+        if value < 1 or value > 100:
+            raise ValueError(field + ' is invalid')
+        return value

+ 123 - 0
tools/query_order_abnormal_list.py

@@ -0,0 +1,123 @@
+from typing import Literal
+
+
+class QueryOrderAbnormalListTool:
+    name = 'query_order_abnormal_list'
+    route_path = '/mcp/tools/queryOrderAbnormalList'
+    STATUSES = (
+        '待处理', '放行待审核', '包裹放行', '退件待审核', '退件驳回', '已退件',
+    )
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        return {
+            'name': self.name,
+            'description': (
+                '使用场景:用户要看头程问题件列表时,先调用'
+                'list_order_abnormal_filter_options取得六个中文问题件状态之一即可查询当前页签;'
+                '订单号可选。对照后台admin/Order/abnormal,一行一条问题件记录。'
+                '号码类型不明确时必须先询问用户,'
+                '不得根据号码格式猜测,不得跨字段或跨工具试查,也不得改走query_order或作废审核。'
+                '禁止使用:关闭异常、已读、重新取号、编辑、导出,以及混查参考号、跟踪号、柜号或SO。'
+                '参数只用于工具内部调用;最终回答只能展示中文业务名称;'
+                '描述筛选条件时不得展示筛选字段的英文参数名。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'abnormal_status': {
+                        'type': 'string',
+                        'enum': list[Literal[
+                            '待处理', '放行待审核', '包裹放行',
+                            '退件待审核', '退件驳回', '已退件',
+                        ]](self.STATUSES),
+                        'description': (
+                            '问题件状态。必须先调用list_order_abnormal_filter_options并选择'
+                            '“问题件状态”取得六个中文页签之一;用户未明确时必须先询问,'
+                            '不得默认待处理或六类一起查。'
+                        ),
+                    },
+                    'order_numbers': {
+                        'type': 'array',
+                        'minItems': 1,
+                        'maxItems': 200,
+                        'items': {
+                            'type': 'string',
+                            'minLength': 1,
+                            'maxLength': 100,
+                            'pattern': '.*\\S.*',
+                        },
+                        'description': (
+                            '订单号数组。仅当用户明确说订单号时使用;不得放入参考号、跟踪号、柜号或SO。'
+                        ),
+                    },
+                    'page': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 1,
+                    },
+                    'limit': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 20,
+                    },
+                },
+                'required': ['abnormal_status'],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        abnormal_status,
+        order_numbers=None,
+        page=1,
+        limit=20,
+        request_id='rq_query_order_abnormal_list',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for query_order_abnormal_list'
+            )
+        status = str(abnormal_status or '').strip()
+        if status not in self.STATUSES:
+            raise ValueError('abnormal_status is invalid')
+        payload = {'abnormal_status': status}
+        if order_numbers is not None:
+            payload['order_numbers'] = self._number_list(
+                order_numbers, 'order_numbers'
+            )
+        payload['page'] = self._bounded_integer(page, 'page')
+        payload['limit'] = self._bounded_integer(limit, 'limit')
+        return self.api_client.call_tool(
+            self.name, self.route_path, payload, request_id,
+        )
+
+    @staticmethod
+    def _number_list(values, field):
+        if not isinstance(values, list) or not values:
+            raise ValueError(field + ' is invalid')
+        result = []
+        for value in values:
+            if not isinstance(value, str):
+                raise ValueError(field + ' is invalid')
+            value = value.strip()
+            if not value or len(value) > 100:
+                raise ValueError(field + ' is invalid')
+            if value not in result:
+                result.append(value)
+        if len(result) > 200:
+            raise ValueError('at most 200 numbers are allowed')
+        return result
+
+    @staticmethod
+    def _bounded_integer(value, field):
+        if isinstance(value, bool) or not isinstance(value, int):
+            raise ValueError(field + ' is invalid')
+        if value < 1 or value > 100:
+            raise ValueError(field + ' is invalid')
+        return value

+ 192 - 0
tools/query_receive_volume_list.py

@@ -0,0 +1,192 @@
+from datetime import datetime
+
+
+class QueryReceiveVolumeListTool:
+    name = 'query_receive_volume_list'
+    route_path = '/mcp/tools/queryReceiveVolumeList'
+
+    def __init__(self, api_client=None):
+        self.api_client = api_client
+
+    def metadata(self):
+        date_field = {
+            'type': 'string',
+            'format': 'date',
+            'pattern': '^\\d{4}-\\d{2}-\\d{2}$',
+        }
+        id_array = {
+            'type': 'array',
+            'minItems': 1,
+            'maxItems': 200,
+            'items': {'type': 'integer', 'minimum': 1},
+        }
+        return {
+            'name': self.name,
+            'description': (
+                '使用场景:用户要看收货量明细(已入库头程订单一行一单)时,'
+                '必须先确认员工时区下最多31个日历日的入库时间闭区间,再调用'
+                'list_receive_volume_filter_options取得客户、商务经理、客户经理、'
+                '货物类型或物流产品的可传值。对照后台admin/Report/receiveForm的'
+                '已入库集合,不是按客户汇总,也不是业务发生时间。'
+                '禁止使用:导出、散货/整柜页脚、订单号筛选,不得改走query_order、'
+                'query_order_exact或后台收货量导出。参数只用于工具内部调用;'
+                '最终回答只能展示中文业务名称;描述筛选条件时不得展示筛选字段的'
+                '英文参数名。'
+            ),
+            'input_schema': {
+                'type': 'object',
+                'properties': {
+                    'inbound_date_start': dict(
+                        date_field,
+                        description='入库时间开始日期,员工时区 YYYY-MM-DD。',
+                    ),
+                    'inbound_date_end': dict(
+                        date_field,
+                        description='入库时间结束日期,员工时区 YYYY-MM-DD,且与开始日期跨度不超过31个日历日。',
+                    ),
+                    'customer_ids': dict(
+                        id_array,
+                        description='客户ID数组。必须先调用list_receive_volume_filter_options选择「客户名称」取得value。',
+                    ),
+                    'sales_ids': dict(
+                        id_array,
+                        description='商务经理员工ID数组。必须先调用筛选项取得value。',
+                    ),
+                    'merchandiser_ids': dict(
+                        id_array,
+                        description='客户经理员工ID数组。必须先调用筛选项取得value。',
+                    ),
+                    'packing_types': {
+                        'type': 'array',
+                        'minItems': 1,
+                        'maxItems': 200,
+                        'items': {
+                            'type': 'string',
+                            'minLength': 1,
+                            'maxLength': 100,
+                            'pattern': '.*\\S.*',
+                        },
+                        'description': '货物类型名称数组。必须先调用筛选项选择「货物类型」取得value。',
+                    },
+                    'product_ids': dict(
+                        id_array,
+                        description='物流产品ID数组。必须先调用筛选项选择「物流产品」取得value。',
+                    ),
+                    'page': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 1,
+                    },
+                    'limit': {
+                        'type': 'integer',
+                        'minimum': 1,
+                        'maximum': 100,
+                        'default': 20,
+                    },
+                },
+                'required': ['inbound_date_start', 'inbound_date_end'],
+                'additionalProperties': False,
+            },
+        }
+
+    def call(
+        self,
+        inbound_date_start,
+        inbound_date_end,
+        customer_ids=None,
+        sales_ids=None,
+        merchandiser_ids=None,
+        packing_types=None,
+        product_ids=None,
+        page=1,
+        limit=20,
+        request_id='rq_query_receive_volume_list',
+    ):
+        if self.api_client is None:
+            raise RuntimeError(
+                'api client is required for query_receive_volume_list'
+            )
+        payload = {
+            'inbound_date_start': self._date(inbound_date_start, 'inbound_date_start'),
+            'inbound_date_end': self._date(inbound_date_end, 'inbound_date_end'),
+        }
+        self._assert_window(
+            payload['inbound_date_start'], payload['inbound_date_end']
+        )
+        if customer_ids is not None:
+            payload['customer_ids'] = self._id_list(customer_ids, 'customer_ids')
+        if sales_ids is not None:
+            payload['sales_ids'] = self._id_list(sales_ids, 'sales_ids')
+        if merchandiser_ids is not None:
+            payload['merchandiser_ids'] = self._id_list(
+                merchandiser_ids, 'merchandiser_ids'
+            )
+        if packing_types is not None:
+            payload['packing_types'] = self._name_list(
+                packing_types, 'packing_types'
+            )
+        if product_ids is not None:
+            payload['product_ids'] = self._id_list(product_ids, 'product_ids')
+        payload['page'] = self._bounded_integer(page, 'page')
+        payload['limit'] = self._bounded_integer(limit, 'limit')
+        return self.api_client.call_tool(
+            self.name, self.route_path, payload, request_id,
+        )
+
+    @staticmethod
+    def _date(value, field):
+        text = str(value or '').strip()
+        try:
+            parsed = datetime.strptime(text, '%Y-%m-%d').date()
+        except ValueError:
+            raise ValueError(field + ' is invalid')
+        if parsed.strftime('%Y-%m-%d') != text:
+            raise ValueError(field + ' is invalid')
+        return text
+
+    @staticmethod
+    def _assert_window(start, end):
+        start_date = datetime.strptime(start, '%Y-%m-%d').date()
+        end_date = datetime.strptime(end, '%Y-%m-%d').date()
+        if end_date < start_date or (end_date - start_date).days > 30:
+            raise ValueError('inbound date window is invalid')
+
+    @staticmethod
+    def _id_list(values, field):
+        if not isinstance(values, list) or not values:
+            raise ValueError(field + ' is invalid')
+        result = []
+        for value in values:
+            if isinstance(value, bool) or not isinstance(value, int) or value <= 0:
+                raise ValueError(field + ' is invalid')
+            if value not in result:
+                result.append(value)
+        if len(result) > 200:
+            raise ValueError('at most 200 ids are allowed')
+        return result
+
+    @staticmethod
+    def _name_list(values, field):
+        if not isinstance(values, list) or not values:
+            raise ValueError(field + ' is invalid')
+        result = []
+        for value in values:
+            if not isinstance(value, str):
+                raise ValueError(field + ' is invalid')
+            value = value.strip()
+            if not value or len(value) > 100:
+                raise ValueError(field + ' is invalid')
+            if value not in result:
+                result.append(value)
+        if len(result) > 200:
+            raise ValueError('at most 200 names are allowed')
+        return result
+
+    @staticmethod
+    def _bounded_integer(value, field):
+        if isinstance(value, bool) or not isinstance(value, int):
+            raise ValueError(field + ' is invalid')
+        if value < 1 or value > 100:
+            raise ValueError(field + ' is invalid')
+        return value