{
  "name": "company_finance_mcp_tools_draft",
  "version": "0.2.0",
  "updated_at": "2026-06-12",
  "description": "一期公司财务系统面向机器人使用的 MCP 工具草案。新增报销发起即入系统账本、飞书审批回调更新状态的工具口径。",
  "tools": [
    {
      "name": "finance_get_intake_rules",
      "description": "获取某类财务入库意图的字段规则、默认规则、阻塞字段和追问模板。机器人在追问用户前应先调用。",
      "input_schema": {
        "type": "object",
        "required": [
          "intent"
        ],
        "properties": {
          "intent": {
            "type": "string",
            "enum": [
              "record_reimbursement",
              "record_receivable",
              "record_fund_in",
              "allocate_receipt",
              "record_payable",
              "record_fund_out",
              "allocate_payment",
              "personal_injection",
              "company_repay_person",
              "query_project",
              "query_personal_ledger",
              "query_subject_summary"
            ]
          },
          "version": {
            "type": "string",
            "default": "current"
          }
        }
      }
    },
    {
      "name": "finance_validate_intake_draft",
      "description": "校验机器人整理出的结构化草稿，返回缺失字段、风险提示、规范化草稿和适合继续追问用户的问题。",
      "input_schema": {
        "type": "object",
        "required": [
          "intent",
          "draft"
        ],
        "properties": {
          "intent": {
            "type": "string"
          },
          "draft": {
            "type": "object"
          },
          "operator_subject_id": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_resolve_subject",
      "description": "把用户口述的主体名称解析成系统 subject。无法唯一匹配时返回候选和追问建议。",
      "input_schema": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "allowed_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "create_if_missing": {
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    {
      "name": "finance_resolve_project",
      "description": "解析项目；可在无明确业务项目时返回对应主体的基础经营项目。",
      "input_schema": {
        "type": "object",
        "properties": {
          "project_text": {
            "type": "string"
          },
          "owner_subject_text": {
            "type": "string"
          },
          "owner_subject_id": {
            "type": "string"
          },
          "allow_base_operation_fallback": {
            "type": "boolean",
            "default": true
          },
          "create_if_missing": {
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    {
      "name": "finance_archive_source_file",
      "description": "把发票、合同或付款凭证源文件上传到腾讯 COS，返回可放入报销草稿 attachments/invoice.file_attachment 的对象存储元数据。",
      "input_schema": {
        "type": "object",
        "required": [
          "source_kind",
          "file_name",
          "content_base64"
        ],
        "properties": {
          "source_kind": {
            "type": "string",
            "enum": [
              "invoice",
              "contract",
              "proof",
              "payment_proof",
              "other"
            ]
          },
          "file_name": {
            "type": "string",
            "description": "用户原始文件名，仅作为元数据保存，不裸拼到 COS key。"
          },
          "content_base64": {
            "type": "string",
            "description": "源文件内容的 base64。"
          },
          "content_type": {
            "type": "string",
            "default": "application/octet-stream"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_prepare_reimbursement",
      "description": "创建报销入库草稿，不直接正式入账。每条报销明细必须挂项目；无业务项目时挂主体基础经营项目。",
      "input_schema": {
        "type": "object",
        "required": [
          "applicant_subject_id",
          "items"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "applicant_subject_id": {
            "type": "string"
          },
          "payee_subject_id": {
            "type": "string"
          },
          "default_owner_subject_id": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "amount",
                "invoice_status",
                "description"
              ],
              "properties": {
                "project_id": {
                  "type": "string"
                },
                "owner_subject_id": {
                  "type": "string"
                },
                "expense_category_code": {
                  "type": "string"
                },
                "source_category_code": {
                  "type": "string"
                },
                "advancer_subject_id": {
                  "type": "string"
                },
                "amount": {
                  "type": "string"
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date"
                },
                "invoice_status": {
                  "type": "string",
                  "enum": [
                    "NO_INVOICE",
                    "PENDING_INVOICE",
                    "INVOICED",
                    "VERIFIED",
                    "INVALID",
                    "VOID"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "personal_ledger_effect": {
                  "type": "boolean"
                },
                "expense_category_id": {
                  "type": "string"
                },
                "source_category_id": {
                  "type": "string"
                },
                "attachments": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "invoice": {
                  "type": "object",
                  "description": "发票结构化信息，如 invoice_no、invoice_type、amount_total、tax_amount、issued_at、buyer_subject_id、seller_subject_id、file_attachment。"
                },
                "invoice_no": {
                  "type": "string"
                },
                "invoice_type": {
                  "type": "string"
                }
              }
            }
          },
          "remark": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "description": "整单附件/发票/付款凭证，可传 file_name/file_path/file_token。",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    {
      "name": "finance_prepare_receivable",
      "description": "创建应收/收入计划草稿。",
      "input_schema": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "amount"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "commercial_order_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "expected_date": {
            "type": "string",
            "format": "date"
          },
          "expected_receiver_subject_id": {
            "type": "string"
          },
          "source_category_code": {
            "type": "string",
            "default": "project_income"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_prepare_payable",
      "description": "创建应付/费用义务草稿。",
      "input_schema": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "amount"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "paying_subject_id": {
            "type": "string"
          },
          "counterparty_subject_id": {
            "type": "string"
          },
          "expense_category_code": {
            "type": "string"
          },
          "source_category_code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "incurred_at": {
            "type": "string",
            "format": "date"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "invoice_status": {
            "type": "string"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_record_fund_transaction_draft",
      "description": "创建真实资金流水草稿。每一次真实收款、付款、退款、转账都对应一条 fund_transaction。",
      "input_schema": {
        "type": "object",
        "required": [
          "direction",
          "amount",
          "occurred_at"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "IN",
              "OUT",
              "TRANSFER",
              "REFUND"
            ]
          },
          "amount": {
            "type": "string"
          },
          "occurred_at": {
            "type": "string",
            "format": "date"
          },
          "payer_subject_id": {
            "type": "string"
          },
          "payer_cash_account_id": {
            "type": "string"
          },
          "receiver_subject_id": {
            "type": "string"
          },
          "receiver_cash_account_id": {
            "type": "string"
          },
          "counterparty_subject_id": {
            "type": "string"
          },
          "source_category_code": {
            "type": "string"
          },
          "proof_attachment_id": {
            "type": "string"
          },
          "original_transaction_id": {
            "type": "string"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_allocate_fund_transaction",
      "description": "把一笔真实资金流水分配/核销到应收、应付或报销单。",
      "input_schema": {
        "type": "object",
        "required": [
          "fund_transaction_id",
          "target_type",
          "target_id",
          "amount"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "fund_transaction_id": {
            "type": "string"
          },
          "target_type": {
            "type": "string",
            "enum": [
              "receivable",
              "payable",
              "reimbursement_order"
            ]
          },
          "target_id": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "settled_at": {
            "type": "string",
            "format": "date"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_preview_intake",
      "description": "生成用户确认/审批前摘要，返回 human_summary、risk_flags、will_create 等。",
      "input_schema": {
        "type": "object",
        "required": [
          "intent",
          "draft"
        ],
        "properties": {
          "intent": {
            "type": "string"
          },
          "draft": {
            "type": "object"
          }
        }
      }
    },
    {
      "name": "finance_submit_reimbursement_approval",
      "description": "报销草稿校验后，先创建系统报销单并标记为发起审批/审批中。飞书审批实例 ID 可稍后由发起审批接口或回调补入；该工具不代表已审批通过或已打款。",
      "input_schema": {
        "type": "object",
        "required": [
          "draft_id"
        ],
        "properties": {
          "draft_id": {
            "type": "string"
          },
          "approval_instance_id": {
            "type": "string"
          },
          "approved_by": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "APPROVAL_PENDING",
              "APPROVED",
              "REJECTED",
              "PAID"
            ],
            "default": "APPROVAL_PENDING"
          },
          "dry_run": {
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    {
      "name": "finance_commit_draft",
      "description": "兼容旧工具名：将已校验草稿提交到系统事实表；默认状态为 APPROVAL_PENDING（发起审批），不是审批通过/待打款。",
      "input_schema": {
        "type": "object",
        "required": [
          "draft_id"
        ],
        "properties": {
          "draft_id": {
            "type": "string"
          },
          "approved_by": {
            "type": "string"
          },
          "approval_instance_id": {
            "type": "string"
          },
          "dry_run": {
            "type": "boolean",
            "default": false
          },
          "status": {
            "type": "string",
            "enum": [
              "APPROVAL_PENDING",
              "APPROVED",
              "REJECTED",
              "PAID"
            ],
            "default": "APPROVAL_PENDING"
          }
        }
      }
    },
    {
      "name": "finance_search_records",
      "description": "查询主体、项目、应收、应付、报销、资金流水等记录，供机器人对话时查证。",
      "input_schema": {
        "type": "object",
        "required": [
          "record_type"
        ],
        "properties": {
          "record_type": {
            "type": "string",
            "enum": [
              "subject",
              "project",
              "receivable",
              "payable",
              "reimbursement",
              "fund_transaction"
            ]
          },
          "q": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "limit": {
            "type": "integer",
            "default": 10,
            "minimum": 1,
            "maximum": 100
          }
        }
      }
    },
    {
      "name": "finance_record_reimbursement_payment",
      "description": "报销打款核销：对 APPROVED 报销单记录真实打款，自动创建资金流水（或复用 fund_transaction_id 指定的已有流水做合并打款核销），付清后报销单流转到 PAID。仅云端 PostgreSQL 模式可用。",
      "input_schema": {
        "type": "object",
        "required": [
          "amount"
        ],
        "properties": {
          "reimbursement_order_id": {
            "type": "string",
            "description": "报销单 ID 或 order_no（与 order_no 二选一）"
          },
          "order_no": {
            "type": "string",
            "description": "报销单号，如 RB20260609-97CB911E"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "本次打款金额；可小于报销单未付金额（部分付款），不可超额"
          },
          "paid_at": {
            "type": "string",
            "description": "实际打款时间，ISO 8601；缺省为当前时间"
          },
          "fund_transaction_id": {
            "type": "string",
            "description": "可选：复用已有资金流水（ID 或 transaction_no）做合并打款核销；不传则新建一条 OUT 流水"
          },
          "transaction_no": {
            "type": "string",
            "description": "可选：新建流水时指定流水号；缺省自动生成 FT 前缀流水号"
          },
          "payer_subject_id": {
            "type": "string",
            "description": "付款主体；缺省取报销单 default_owner_subject_id"
          },
          "payer_cash_account_id": {
            "type": "string",
            "description": "付款资金账户（cash_account.id），建议填写以便对账"
          },
          "receiver_subject_id": {
            "type": "string",
            "description": "收款主体；缺省取报销单 payee/applicant"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人主体 ID，写入审计"
          },
          "idempotency_key": {
            "type": "string",
            "description": "幂等键；重复调用返回首次结果，不会重复打款"
          },
          "remark": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "finance_list_cash_accounts",
      "description": "查询资金账户列表，供报销打款时选择付款账户。仅云端 PostgreSQL 模式可用。",
      "input_schema": {
        "type": "object",
        "properties": {
          "owner_subject_id": {
            "type": "string",
            "description": "按所属主体过滤"
          },
          "active_only": {
            "type": "boolean",
            "default": true
          },
          "limit": {
            "type": "integer",
            "default": 50,
            "minimum": 1,
            "maximum": 200
          }
        }
      }
    },
    {
      "name": "finance_create_contract",
      "description": "合同/订单建档（commercial_order）：项目必须已存在；可同时创建分期应收。仅云端 PostgreSQL 模式可用。",
      "input_schema": {
        "type": "object",
        "required": [
          "project_id",
          "name"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "项目 ID/编号/名称"
          },
          "name": {
            "type": "string",
            "description": "合同/订单名称"
          },
          "order_type": {
            "type": "string",
            "enum": [
              "contract",
              "order",
              "verbal",
              "other"
            ],
            "default": "contract"
          },
          "amount_total": {
            "type": "number",
            "description": "合同总金额"
          },
          "customer_subject_id": {
            "type": "string",
            "description": "客户主体"
          },
          "signing_subject_id": {
            "type": "string",
            "description": "签约主体，缺省取项目归属主体"
          },
          "signed_at": {
            "type": "string",
            "description": "签约日期 YYYY-MM-DD"
          },
          "external_no": {
            "type": "string",
            "description": "外部合同编号"
          },
          "status": {
            "type": "string",
            "default": "SIGNED"
          },
          "receivables": {
            "type": "array",
            "description": "可选：分期应收计划",
            "items": {
              "type": "object",
              "required": [
                "amount"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "如首付款/尾款"
                },
                "amount": {
                  "type": "number",
                  "description": "金额"
                },
                "expected_date": {
                  "type": "string",
                  "description": "预计收款日期"
                }
              }
            }
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_list_contracts",
      "description": "查询合同台账（含关联应收与已收金额）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "状态过滤"
          },
          "project_id": {
            "type": "string",
            "description": "项目过滤"
          },
          "owner_subject_id": {
            "type": "string",
            "description": "归属主体过滤"
          },
          "q": {
            "type": "string",
            "description": "名称/编号关键词"
          },
          "limit": {
            "type": "integer",
            "default": 50
          }
        }
      }
    },
    {
      "name": "finance_create_receivable",
      "description": "应收建档：记录应该收多少钱；实收由核销派生。",
      "input_schema": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "amount"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "项目"
          },
          "commercial_order_id": {
            "type": "string",
            "description": "关联合同/订单，可空"
          },
          "name": {
            "type": "string",
            "description": "应收名称如首付款"
          },
          "amount": {
            "type": "number",
            "description": "应收金额"
          },
          "expected_date": {
            "type": "string",
            "description": "预计收款日期"
          },
          "expected_receiver_subject_id": {
            "type": "string",
            "description": "应收主体"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_create_payable",
      "description": "应付建档：记录已形成的付款义务；实付由核销派生。无明确项目时用主体基础经营项目。",
      "input_schema": {
        "type": "object",
        "required": [
          "project_id",
          "name",
          "amount"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "description": "项目（或基础经营项目）"
          },
          "name": {
            "type": "string",
            "description": "费用名称"
          },
          "amount": {
            "type": "number",
            "description": "应付金额"
          },
          "counterparty_subject_id": {
            "type": "string",
            "description": "供应商/收款对象"
          },
          "expense_category_id": {
            "type": "string",
            "description": "费用分类"
          },
          "incurred_at": {
            "type": "string",
            "description": "发生日期"
          },
          "due_date": {
            "type": "string",
            "description": "预计付款日期"
          },
          "invoice_status": {
            "type": "string",
            "default": "NO_INVOICE"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_list_receivables",
      "description": "查询应收列表（含已收/未收金额）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "状态"
          },
          "project_id": {
            "type": "string",
            "description": "项目"
          },
          "owner_subject_id": {
            "type": "string",
            "description": "主体"
          },
          "outstanding_only": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer",
            "default": 50
          }
        }
      }
    },
    {
      "name": "finance_list_payables",
      "description": "查询应付列表（含已付/未付金额）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "状态"
          },
          "project_id": {
            "type": "string",
            "description": "项目"
          },
          "owner_subject_id": {
            "type": "string",
            "description": "主体"
          },
          "outstanding_only": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer",
            "default": 50
          }
        }
      }
    },
    {
      "name": "finance_settle_obligation",
      "description": "应收/应付核销：把真实资金流水分配到应收（收款）或应付（付款）上；不传 fund_transaction_id 时自动创建流水；个人代付时 payer_subject_id 传个人主体。付清/收齐自动流转状态。",
      "input_schema": {
        "type": "object",
        "required": [
          "target_type",
          "target_id",
          "amount"
        ],
        "properties": {
          "target_type": {
            "type": "string",
            "enum": [
              "receivable",
              "payable"
            ]
          },
          "target_id": {
            "type": "string",
            "description": "应收/应付 ID 或编号"
          },
          "amount": {
            "type": "number",
            "description": "本次核销金额"
          },
          "settled_at": {
            "type": "string",
            "description": "实际发生时间"
          },
          "fund_transaction_id": {
            "type": "string",
            "description": "复用已有流水做合并核销"
          },
          "payer_subject_id": {
            "type": "string",
            "description": "付款主体（个人代付时传个人）"
          },
          "payer_cash_account_id": {
            "type": "string",
            "description": "付款账户"
          },
          "receiver_subject_id": {
            "type": "string",
            "description": "收款主体"
          },
          "receiver_cash_account_id": {
            "type": "string",
            "description": "收款账户"
          },
          "counterparty_subject_id": {
            "type": "string",
            "description": "对方主体"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "idempotency_key": {
            "type": "string",
            "description": "幂等键"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_record_fund_transaction",
      "description": "直接登记一笔真实资金流水（资金主账）。个人注资：direction=IN + source_category_id=src_personal_injection + payer 为个人主体。",
      "input_schema": {
        "type": "object",
        "required": [
          "direction",
          "amount"
        ],
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "IN",
              "OUT",
              "TRANSFER",
              "REFUND"
            ]
          },
          "amount": {
            "type": "number",
            "description": "金额，正数"
          },
          "occurred_at": {
            "type": "string",
            "description": "实际发生时间"
          },
          "payer_subject_id": {
            "type": "string",
            "description": "付款主体（OUT 必填）"
          },
          "payer_cash_account_id": {
            "type": "string",
            "description": "付款账户"
          },
          "receiver_subject_id": {
            "type": "string",
            "description": "收款主体（IN 必填）"
          },
          "receiver_cash_account_id": {
            "type": "string",
            "description": "收款账户"
          },
          "counterparty_subject_id": {
            "type": "string",
            "description": "对方主体"
          },
          "source_category_id": {
            "type": "string",
            "description": "来源分类 ID 或 code，如 src_personal_injection/personal_injection"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_list_fund_transactions",
      "description": "查询资金流水（含已核销/未核销金额）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "IN",
              "OUT"
            ]
          },
          "source_category_id": {
            "type": "string",
            "description": "来源分类"
          },
          "person_subject_id": {
            "type": "string",
            "description": "个人主体（付款或收款方）"
          },
          "cash_account_id": {
            "type": "string",
            "description": "资金账户"
          },
          "date_from": {
            "type": "string",
            "description": "开始日期"
          },
          "date_to": {
            "type": "string",
            "description": "结束日期"
          },
          "unallocated_only": {
            "type": "boolean"
          },
          "q": {
            "type": "string",
            "description": "流水号/备注关键词"
          },
          "limit": {
            "type": "integer",
            "default": 50
          }
        }
      }
    },
    {
      "name": "finance_personal_ledger",
      "description": "个人账派生查询：+报销待打款（含无票/有票拆分）+个人注资+个人代付−公司还个人，按人/按公司主体拆分，可追溯到来源单据。",
      "input_schema": {
        "type": "object",
        "properties": {
          "person_subject_id": {
            "type": "string",
            "description": "只查某个人，缺省查全部个人"
          }
        }
      }
    },
    {
      "name": "finance_overview",
      "description": "财务总览：资金账户余额、月度收支、应收应付未结、报销待打款、合同回款进度、按公司主体汇总。",
      "input_schema": {
        "type": "object",
        "properties": {
          "months": {
            "type": "integer",
            "default": 6,
            "description": "月度收支回看月数"
          }
        }
      }
    },
    {
      "name": "finance_create_project",
      "description": "项目建档：收入/合同进来时项目不存在则先建项目；项目必须归属主体；同主体同名项目会被拒绝。",
      "input_schema": {
        "type": "object",
        "required": [
          "owner_subject_id",
          "name"
        ],
        "properties": {
          "owner_subject_id": {
            "type": "string",
            "description": "项目归属主体 ID"
          },
          "name": {
            "type": "string",
            "description": "项目名称"
          },
          "project_code": {
            "type": "string",
            "description": "项目编号，缺省自动生成"
          },
          "project_type": {
            "type": "string",
            "enum": [
              "BUSINESS",
              "BASE_OPERATION",
              "INTERNAL"
            ],
            "default": "BUSINESS"
          },
          "start_date": {
            "type": "string",
            "description": "开始日期"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "别名，便于机器人匹配"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_list_projects",
      "description": "查询项目列表（含归属主体名）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "owner_subject_id": {
            "type": "string",
            "description": "归属主体过滤"
          },
          "project_type": {
            "type": "string",
            "description": "BUSINESS/BASE_OPERATION/INTERNAL"
          },
          "status": {
            "type": "string",
            "description": "状态"
          },
          "q": {
            "type": "string",
            "description": "名称/编号/别名关键词"
          },
          "limit": {
            "type": "integer",
            "default": 100
          }
        }
      }
    },
    {
      "name": "finance_list_internal_accounts",
      "description": "查询内部账户（个人账/公共账）及余额，按公司主体/持有人过滤。",
      "input_schema": {
        "type": "object",
        "properties": {
          "company_subject_id": {
            "type": "string",
            "description": "公司主体"
          },
          "holder_subject_id": {
            "type": "string",
            "description": "个人账持有人"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "PUBLIC"
            ]
          }
        }
      }
    },
    {
      "name": "finance_create_internal_account",
      "description": "创建内部账户：每公司一个公共账（PUBLIC），个人账（PERSONAL）需指定持有人；同公司同持有人唯一。",
      "input_schema": {
        "type": "object",
        "required": [
          "account_type",
          "company_subject_id"
        ],
        "properties": {
          "account_type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "PUBLIC"
            ]
          },
          "company_subject_id": {
            "type": "string",
            "description": "公司主体"
          },
          "holder_subject_id": {
            "type": "string",
            "description": "个人账持有人（PERSONAL 必填）"
          },
          "name": {
            "type": "string",
            "description": "账户名，缺省自动生成"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_list_internal_account_entries",
      "description": "查询内部账户分录明细（分账流入/报销支出/工资支出/税费/调拨）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "账户 ID"
          },
          "entry_type": {
            "type": "string",
            "description": "分录类型过滤"
          },
          "limit": {
            "type": "integer",
            "default": 100
          }
        }
      }
    },
    {
      "name": "finance_allocate_receivable",
      "description": "应收分账：把应收金额的一部分人工分配到个人账/公共账（仅钱丽娜有权操作，操作人记入审计）；累计分配不得超过应收金额。",
      "input_schema": {
        "type": "object",
        "required": [
          "receivable_id",
          "allocations"
        ],
        "properties": {
          "receivable_id": {
            "type": "string",
            "description": "应收 ID 或编号"
          },
          "allocations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "account_id",
                "amount"
              ],
              "properties": {
                "account_id": {
                  "type": "string",
                  "description": "目标内部账户"
                },
                "amount": {
                  "type": "number",
                  "description": "分配金额"
                },
                "remark": {
                  "type": "string",
                  "description": "备注"
                }
              }
            }
          },
          "operator_subject_id": {
            "type": "string",
            "description": "操作人（分配权限人）"
          },
          "idempotency_key": {
            "type": "string",
            "description": "幂等键"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_settle_reimbursement_internal",
      "description": "报销内部结算：从来源内部账户出账；无票报销自动调拨进报销人个人账并置 PAID；有票报销出账登记后仍需银行打款核销。",
      "input_schema": {
        "type": "object",
        "required": [
          "reimbursement_order_id",
          "funding_account_id"
        ],
        "properties": {
          "reimbursement_order_id": {
            "type": "string",
            "description": "报销单 ID 或单号"
          },
          "funding_account_id": {
            "type": "string",
            "description": "来源内部账户（本人/他人个人账或公共账）"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          },
          "idempotency_key": {
            "type": "string",
            "description": "幂等键"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_create_recurring_expense",
      "description": "配置固定月度工资：人员、公司主体、出账内部账户、月固定金额、执行周期（起止月）。",
      "input_schema": {
        "type": "object",
        "required": [
          "name",
          "company_subject_id",
          "funding_account_id",
          "monthly_amount",
          "start_month"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "如 朱潇潇工资"
          },
          "payee_subject_id": {
            "type": "string",
            "description": "收款人主体"
          },
          "payee_name": {
            "type": "string",
            "description": "收款人姓名（无主体时）"
          },
          "company_subject_id": {
            "type": "string",
            "description": "所属公司主体"
          },
          "funding_account_id": {
            "type": "string",
            "description": "出账内部账户（个人账/公共账）"
          },
          "monthly_amount": {
            "type": "number",
            "description": "月固定金额"
          },
          "start_month": {
            "type": "string",
            "description": "生效起始月 YYYY-MM"
          },
          "end_month": {
            "type": "string",
            "description": "结束月，可空"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_generate_recurring_expenses",
      "description": "按月生成固定工资记录（幂等，每配置每月一条）：内部账户出账分录 + 待付款应付记录。",
      "input_schema": {
        "type": "object",
        "required": [
          "month"
        ],
        "properties": {
          "month": {
            "type": "string",
            "description": "YYYY-MM"
          },
          "operator_subject_id": {
            "type": "string",
            "description": "经办人"
          }
        }
      }
    },
    {
      "name": "finance_register_extra_expense",
      "description": "额外支出登记（增值税、企业所得税等非合同支出）：统一进对应公司公共账，无需拆分到个人。",
      "input_schema": {
        "type": "object",
        "required": [
          "company_subject_id",
          "expense_type",
          "name",
          "amount"
        ],
        "properties": {
          "company_subject_id": {
            "type": "string",
            "description": "公司主体"
          },
          "expense_type": {
            "type": "string",
            "description": "支出类型，如 增值税/企业所得税/其他"
          },
          "name": {
            "type": "string",
            "description": "支出名称"
          },
          "amount": {
            "type": "number",
            "description": "金额"
          },
          "occurred_at": {
            "type": "string",
            "description": "发生日期"
          },
          "cash_account_id": {
            "type": "string",
            "description": "出账资金账户，可空"
          },
          "registrar_subject_id": {
            "type": "string",
            "description": "登记人（财务）"
          },
          "idempotency_key": {
            "type": "string",
            "description": "幂等键"
          },
          "remark": {
            "type": "string",
            "description": "备注"
          }
        }
      }
    },
    {
      "name": "finance_company_overview",
      "description": "公司主体总览：各公司个人账/公共账余额、总公共账余额、支出构成（合同/报销/固定工资/手工支出）。",
      "input_schema": {
        "type": "object",
        "properties": {
          "company_subject_id": {
            "type": "string",
            "description": "只看某公司，缺省全部"
          }
        }
      }
    }
  ]
}