记录前先审查
先检查当前 summary;ledger record 属于 financial data,重复条目比缺失条目更难判断。
ledger({ action: "summary", months: 1 })公开 MCP 工具
ledger
用途
通过 Ledger dispatcher 管理受治理的 financial transaction 和 external-service renewal reminder,并提供结构化 summary 与 audit boundary。
适用场景
- 记录包含 amount、currency、date 和 merchant context 的 expense 或其他支持的 transaction。
- 按 date、category、currency 或 project filter 列出、汇总或查看已授权的 Ledger record。
- 创建或管理 subscription renewal reminder,并可选择将其 review cycle 连接到 TODO。
不适用场景
- 不要对 financial record 使用 generic remember;ledger 会保留 financial data contract。
- 不要推断跨 currency total;聚合不安全时,summary 会将 currencies 分开。
- 没有所需的准确 ID/version 和 user authorization 时,不要 update 或 delete record。
- REST API 接受的 field set 比 public MCP tool 更宽;scope、bucket、team 和 provenance filter 见 /docs/api/memory。
所需权限范围
- Read actions 需要 memory:read;public chat surface 中的 transaction 和 subscription mutations 需要 memory:write。
- 认证的 owner/team/scope boundary 管辖每一项 Ledger record 和 reminder operation。
参数列表
| 参数名 | 类型 | 描述 |
|---|---|---|
action | add_expense | list | summary | overview | update_transaction · 必填 | 由 caller 选择的 Ledger operation。只接受这五个 literal values。 |
item / amount / transaction_type / currency | string / number | 核心 transaction fields;financial write 必须提供 amount 和 currency。 |
transaction_date / category / merchant / payment_method / note | string | 可选的 transaction classification、date 和 note fields。 |
query / date_from / date_to / min_amount / max_amount | string / number | List 和 summary filters。 |
transaction_id / expected_version / patch | string / integer / object | 准确的 update target、optimistic concurrency version 和允许的 update fields。 |
owner_timezone / project_id | string | 日期解释和已授权的 project/team boundary。 |
limit / offset / months | integer / boolean · 默认值: 20 / 0 / 6 / false | Pagination、summary horizon 和 structured-output controls。 |
返回模式
Structured output 包含请求的 transaction、summary groups 或 overview,以及面向用户的 text summary。Widget caller 可能收到 refresh metadata;raw secrets 永远不属于 response contract。
使用示例
ledger({
action: "add_expense",
item: "Domain renewal",
amount: 18.00,
currency: "USD",
transaction_date: "2026-08-21",
category: "software"
})ledger({ action: "summary", months: 1 })错误信息
- Authorization failure:token 在读取时缺少 memory:read,或在 mutation 时缺少 memory:write。
- Validation failure:所需 transaction fields、date formats、currency 或 action values 无效。
- Concurrency failure:update 使用了过时的 expected_version,或找不到准确的 transaction。
- Aggregation boundary:不同 currencies 的 records 会分开报告,不会生成虚假的 combined total。
关联工具
来源: MCP 参考