{
  "title": "NovaStock AI Tools Lab · 工具说明书",
  "note": "自学用：这是给大模型看的菜单（tool schema），不是同事助手的正式 MCP。执行仍由你的 lab.js 完成。",
  "tools": [
    {
      "name": "search_contracts",
      "description": "按年度和关键词搜索货品/合同单据，返回编号、名称、预算项目、金额等摘要。当用户要「找哪些单、列出清单、有没有某某相关合同」时使用。不要用于只要总额/分别花了多少的统计问题；也不要在用户已明确某一份单据且只要附件时使用。",
      "parameters": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "description": "预算年度，例如 2026。用户说「今年」时用当前业务年。"
          },
          "keyword": {
            "type": "string",
            "description": "在名称、编号、系统号、乙方、预算项目等字段中匹配的关键词，如「维保」「耗材」。"
          },
          "limit": {
            "type": "integer",
            "description": "最多返回几条，默认 8。"
          }
        },
        "required": ["keyword"]
      }
    },
    {
      "name": "get_contract_statistics",
      "description": "汇总某年、某部门（可选）的合同数量、合同金额、已付金额、预算等。当用户问「总金额多少、分别花了多少、执行情况」时使用。不要用于列出具体单据清单或下载附件。",
      "parameters": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "description": "预算年度，例如 2026。"
          },
          "department": {
            "type": "string",
            "description": "归口/预算部门名称，例如「产品交付部」。为空表示不按部门过滤。"
          },
          "group_by": {
            "type": "string",
            "enum": ["none", "project", "department"],
            "description": "是否分组：none=只要汇总；project=按预算项目拆开（用户说「分别」时常用）。"
          }
        },
        "required": ["year"]
      }
    },
    {
      "name": "get_contract_files",
      "description": "列出某一份单据的附件名称与类型。当用户已能定位到具体单据，并说「文件、附件、下载、给我」时使用。若还不知道是哪一份，应先调用 search_contracts。",
      "parameters": {
        "type": "object",
        "properties": {
          "contract_key": {
            "type": "string",
            "description": "单据稳定键：优先 sysCode，其次业务 code。实验室里对应 filesKey。"
          }
        },
        "required": ["contract_key"]
      }
    }
  ]
}
