{
  "notice": "bxzxxr MCP archive: a record of what public MCP servers declared when we listed them (we never call their tools). It is data, not a rating: nothing here says a server is safe, secure, verified or trustworthy, and a server can change after we looked. Secrets we detected are redacted; redacted tool lists are withheld and only their hash is shown.",
  "infrastructure": {
    "host": "mcp.expensebot.ai",
    "site": "expensebot.ai",
    "addresses": [
      {
        "address": "216.150.16.193",
        "endpoints": 683,
        "shared_infrastructure": true,
        "network": {
          "asn": 16509,
          "name": "AMAZON-02 - Amazon.com, Inc.",
          "prefix": "216.150.16.0/24",
          "country": "US"
        }
      },
      {
        "address": "216.150.1.193",
        "endpoints": 699,
        "shared_infrastructure": true,
        "network": {
          "asn": 16509,
          "name": "AMAZON-02 - Amazon.com, Inc.",
          "prefix": "216.150.1.0/24",
          "country": "US"
        }
      }
    ],
    "addresses_recorded": true,
    "address_history": [
      {
        "addresses": [
          "216.150.16.193",
          "216.150.1.193"
        ],
        "first_seen": "2026-11-22T19:06:03.851Z",
        "last_seen": "2026-11-22T19:06:03.851Z",
        "checks": 1
      },
      {
        "addresses": [
          "216.150.16.1",
          "216.150.1.1"
        ],
        "first_seen": "2026-11-21T14:35:02.474Z",
        "last_seen": "2026-11-21T14:35:02.474Z",
        "checks": 1
      }
    ],
    "hosting": [
      {
        "value": "Vercel",
        "evidence": "Server header \"Vercel\""
      }
    ],
    "software": [
      {
        "value": "Express",
        "evidence": "X-Powered-By header \"Express\""
      }
    ],
    "server_info": {
      "name": "expensebot-remote",
      "version": "0.3.1-m3.6",
      "protocol_version": "2025-06-18"
    },
    "headers": {
      "server": "Vercel",
      "x-powered-by": "Express",
      "strict-transport-security": "max-age=63072000"
    },
    "auth": null
  },
  "related": {
    "same_address": {
      "total": 898,
      "sample": [
        {
          "id": "38",
          "url": "https://www.hood.ag/api/mcp",
          "server_name": "ag.hood/name-service",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:32:01.495Z"
        },
        {
          "id": "39",
          "url": "https://www.almostimpossible.agency/mcp",
          "server_name": "agency.almostimpossible/site",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:32:01.495Z"
        },
        {
          "id": "182",
          "url": "https://www.ai-portal.ai/mcp",
          "server_name": "ai.ai-portal/ai-portal",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:34:01.210Z"
        },
        {
          "id": "248",
          "url": "https://app.aqta.ai/api/mcp",
          "server_name": "ai.aqta/seal",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:35:03.039Z"
        },
        {
          "id": "278",
          "url": "https://asrm.ai/mcp",
          "server_name": "ai.asrm/asrm",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:37:01.449Z"
        },
        {
          "id": "368",
          "url": "https://beexcellent.ai/api/mcp/public",
          "server_name": "ai.beexcellent/reference",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:39:02.648Z"
        },
        {
          "id": "395",
          "url": "https://property.bluebed.ai/mcp",
          "server_name": "ai.bluebed.property/new-launches",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:40:02.123Z"
        },
        {
          "id": "416",
          "url": "https://www.bordet.ai/api/mcp/mcp",
          "server_name": "ai.bordet/bordet",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:39:02.482Z"
        },
        {
          "id": "430",
          "url": "https://www.budgetseo.ai/api/mcp",
          "server_name": "ai.budgetseo/budget-seo-mcp",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:41:00.965Z"
        },
        {
          "id": "461",
          "url": "https://callmcp.ai/mcp",
          "server_name": "ai.callmcp/server",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:41:01.824Z"
        },
        {
          "id": "670",
          "url": "https://www.decisionlog.ai/api/mcp",
          "server_name": "ai.decisionlog/mcp",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:45:03.762Z"
        },
        {
          "id": "754",
          "url": "https://www.edgechat.ai/mcp",
          "server_name": "ai.edgechat/edgepedia",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:48:01.794Z"
        },
        {
          "id": "787",
          "url": "https://mcp.tenda.eshmere.ai/mcp",
          "server_name": "ai.eshmere/tenda",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:50:01.774Z"
        },
        {
          "id": "868",
          "url": "https://www.flamel.ai/mcp",
          "server_name": "ai.flamel/public-content",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:51:02.819Z"
        },
        {
          "id": "908",
          "url": "https://mcp.fudge.ai/mcp",
          "server_name": "ai.fudge/fudge",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:52:01.102Z"
        },
        {
          "id": "1083",
          "url": "https://govrelations.ai/mcp",
          "server_name": "ai.govrelations/govrelations",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:54:00.852Z"
        },
        {
          "id": "1134",
          "url": "https://www.heycai.ai/mcp",
          "server_name": "ai.heycai/clinic-tools",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:55:02.831Z"
        },
        {
          "id": "1183",
          "url": "https://hustlin.ai/api/mcp",
          "server_name": "ai.hustlin/hustlin",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:56:01.796Z"
        },
        {
          "id": "1300",
          "url": "https://kifly.ai/api/mcp",
          "server_name": "ai.kifly/mcp",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T04:59:02.560Z"
        },
        {
          "id": "1563",
          "url": "https://www.modulos.ai/mcp/",
          "server_name": "ai.modulos/demo-booking",
          "last_state": "listed",
          "last_checked_at": "2026-11-22T06:43:08.809Z"
        }
      ]
    },
    "same_site": {
      "total": 0,
      "sample": []
    },
    "same_tool_list": {
      "total": 0,
      "sample": []
    },
    "same_publisher": {
      "publisher": "io.github.TotesMagotes",
      "total": 1,
      "sample": [
        {
          "name": "io.github.TotesMagotes/mcp-server",
          "title": null
        }
      ]
    },
    "same_repository": {
      "repository_url": "https://github.com/TotesMagotes/expensebot-mcp",
      "total": 0,
      "sample": []
    },
    "note": "Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators."
  },
  "endpoint": {
    "id": "26837",
    "server_name": "io.github.TotesMagotes/mcp-server-auth",
    "url": "https://mcp.expensebot.ai/mcp",
    "host": "mcp.expensebot.ai",
    "transport": "streamable-http",
    "last_checked_at": "2026-11-22T19:06:03.851Z",
    "last_state": "listed",
    "last_detail": null,
    "consecutive_failures": 0,
    "current_sha": "63d1e5d1d112f1c42c1a5d7f56166657a97d127ec00f4b6ed08c7f7b80437b1f",
    "first_listed_at": "2026-11-21T14:35:02.474Z",
    "created_at": "2026-11-21T09:00:09.555Z",
    "resolved_addresses": [
      "216.150.16.193",
      "216.150.1.193"
    ]
  },
  "server": {
    "name": "io.github.TotesMagotes/mcp-server-auth",
    "title": "ExpenseBot",
    "description": "Receipt ingestion, Gmail capture, expense analysis, and reviewed reports for AI-agent workflows.",
    "version": "0.6.28",
    "registry_status": "active",
    "repository_url": "https://github.com/TotesMagotes/expensebot-mcp",
    "website_url": "https://www.expensebot.ai/receipt-collection-mcp?utm_source=official_mcp_registry&utm_medium=referral&utm_campaign=mcp-builder-receipt-infrastructure&utm_content=server_listing",
    "published_at": "2026-11-11T21:19:40.330Z",
    "updated_at": "2026-11-11T21:19:40.330Z",
    "first_seen": "2026-11-21T09:00:09.097Z"
  },
  "other_endpoints": [],
  "intel": {
    "capabilities": [
      "takes-payment",
      "vector-search"
    ],
    "evm_addresses": [],
    "chains": [],
    "tokens": [],
    "computed_at": "2026-11-22T19:06:09.676Z"
  },
  "operator": {
    "key": "expensebot.ai",
    "name": "expensebot.ai",
    "platform": false
  },
  "needs_sign_in": false,
  "reachability": {
    "window_days": 30,
    "checks": 2,
    "answered": 2,
    "answered_percent": 100,
    "avg_listing_latency_ms": 362,
    "first_check_in_window": "2026-11-21T14:35:02.474Z",
    "consecutive_failures_now": 0,
    "days": [
      {
        "day": "2026-11-21",
        "checks": 1,
        "answered": 1,
        "last_state": "listed"
      },
      {
        "day": "2026-11-22",
        "checks": 1,
        "answered": 1,
        "last_state": "listed"
      }
    ]
  },
  "tool_list": {
    "sha256": "63d1e5d1d112f1c42c1a5d7f56166657a97d127ec00f4b6ed08c7f7b80437b1f",
    "tools": 66,
    "resources": 0,
    "prompts": 0,
    "first_seen": "2026-11-22T19:06:04.197Z",
    "tool_names": [
      "get_setup_status",
      "complete_setup",
      "search_expenses",
      "get_spending_summary",
      "get_deep_analytics",
      "create_report",
      "review_report_setup",
      "list_reports",
      "request_accounting_integration",
      "get_report_details",
      "share_report",
      "check_compliance",
      "fix_compliance",
      "check_tax_deductibility",
      "search_knowledge",
      "submit_receipt",
      "get_last_receipt_result",
      "add_cash_expense",
      "parse_expense",
      "process_gmail_receipts",
      "scan_gmail",
      "add_mileage_entry",
      "add_income",
      "add_income_from_file",
      "add_income_from_csv",
      "get_accounting_integration_status",
      "send_report_to_accounting",
      "get_accounting_push_status",
      "list_categories",
      "list_tags",
      "create_tag",
      "get_income_summary",
      "get_pnl",
      "get_per_tag_pnl",
      "list_income_categories",
      "get_recent_activity",
      "trace_document",
      "get_mileage_summary",
      "get_subscription_audit",
      "get_expense_by_id",
      "export_report",
      "get_spreadsheet_url",
      "check_feature",
      "whatif_afford",
      "whatif_client",
      "whatif_tax_setaside",
      "scan_gmail_years",
      "get_scan_status",
      "get_statement_import_status",
      "list_client_invoices",
      "get_client_invoice",
      "prepare_client_invoice",
      "create_client_invoice",
      "mark_client_invoice_paid",
      "get_expense_splits",
      "get_monthly_books_review",
      "list_client_close_readiness",
      "get_credits_refunds",
      "get_client_advance_balances",
      "get_trip_suggestions",
      "group_expenses",
      "update_expense",
      "correct_expenses",
      "omit_expenses",
      "search",
      "fetch"
    ],
    "declared": {
      "tools": [
        {
          "name": "get_setup_status",
          "description": "Read authoritative setup, known answers, next question and eligible actions for the current workspace. Ask only missing prerequisites; optional setup must not block a specific expense task. Unknown is not empty/complete. No client acting/writes.",
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "scope": {
                "enum": [
                  "own",
                  "employee",
                  "administrator",
                  "accountant"
                ],
                "type": "string"
              },
              "states": {
                "type": "object",
                "description": "Setup and expense readiness."
              },
              "status": {
                "enum": [
                  "ready",
                  "missing",
                  "unavailable"
                ],
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "handoffs": {
                "type": "object",
                "description": "Setup screen links."
              },
              "revision": {
                "type": "string",
                "description": "Scope-bound revision."
              },
              "decisions": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "suggestions": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Eligible actions."
              },
              "nextQuestion": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "personalRules": {
                "type": "object",
                "description": "Status and preferences."
              },
              "personalLearning": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Learning state and next steps."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Read setup status",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "complete_setup",
          "description": "Preview explicit setup answers, never infer. Show changes/access/recipients; approval then proposalId+confirm:true only. Owner/revision-bound; rejects changed state. Lost reply: proposalId+status:true; never resend blindly. Re-read get_setup_status. Personal Rules need validation/activation; invites are not client access. OAuth/bank/reviews use screens. No financial writes/client acting.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "status": {
                "type": "boolean",
                "const": true,
                "description": "Read outcome; do not replay."
              },
              "answers": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "homeCountry": {
                        "type": "string",
                        "description": "Country code, e.g. USA/CA/UK."
                      },
                      "businessName": {
                        "type": "string",
                        "maxLength": 200,
                        "description": "Business name."
                      },
                      "homeCurrency": {
                        "type": "string",
                        "description": "Reporting currency code."
                      },
                      "homeProvince": {
                        "enum": [
                          "AB",
                          "BC",
                          "MB",
                          "NB",
                          "NL",
                          "NS",
                          "NT",
                          "NU",
                          "ON",
                          "PE",
                          "QC",
                          "SK",
                          "YT"
                        ],
                        "type": "string",
                        "description": "Explicit CA province."
                      },
                      "fiscalYearEnd": {
                        "type": "string",
                        "pattern": "^\\d{2}-\\d{2}$",
                        "description": "Incorporated owner only: MM-DD."
                      }
                    },
                    "minProperties": 1,
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "ambiguousFallback": {
                        "oneOf": [
                          {
                            "enum": [
                              "business",
                              "personal",
                              "untagged",
                              "ask"
                            ],
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Treatment of ambiguous items."
                      },
                      "mixedUseCardLast4": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^\\d{4}$"
                        },
                        "maxItems": 5,
                        "description": "Mixed-use cards."
                      },
                      "personalCardLast4": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^\\d{4}$"
                        },
                        "maxItems": 5,
                        "description": "Personal cards."
                      },
                      "personalLifeSignals": {
                        "type": "array",
                        "items": {
                          "enum": [
                            "kids",
                            "pets",
                            "household",
                            "clothing"
                          ],
                          "type": "string"
                        },
                        "description": "Personal life signals."
                      },
                      "personalSubscriptions": {
                        "type": "array",
                        "items": {
                          "enum": [
                            "streaming"
                          ],
                          "type": "string"
                        },
                        "description": "Personal subscriptions."
                      },
                      "personalAmazonCategories": {
                        "type": "array",
                        "items": {
                          "enum": [
                            "kids/baby",
                            "pet supplies",
                            "clothing",
                            "home & kitchen",
                            "food & snacks",
                            "hobby/gaming",
                            "health & beauty"
                          ],
                          "type": "string"
                        },
                        "description": "Personal Amazon categories."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "step",
                      "action"
                    ],
                    "properties": {
                      "step": {
                        "enum": [
                          "personal_rules",
                          "connect_gmail",
                          "other_inbox",
                          "business_name",
                          "fiscal_year",
                          "review_report"
                        ],
                        "type": "string",
                        "description": "Checklist step."
                      },
                      "action": {
                        "enum": [
                          "skip",
                          "no_other_inbox",
                          "use_other_inbox",
                          "finish",
                          "dismiss",
                          "resume",
                          "visit"
                        ],
                        "type": "string",
                        "description": "Decision."
                      },
                      "nextStep": {
                        "enum": [
                          "personal_rules",
                          "connect_gmail",
                          "other_inbox",
                          "business_name",
                          "fiscal_year",
                          "review_report"
                        ],
                        "type": "string",
                        "description": "Optional next step."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "stage"
                    ],
                    "properties": {
                      "optIn": {
                        "type": "boolean",
                        "description": "Explicit learning consent."
                      },
                      "stage": {
                        "enum": [
                          "get",
                          "discover",
                          "answer",
                          "evaluate",
                          "activate",
                          "refine",
                          "undo",
                          "remove",
                          "dismiss"
                        ],
                        "type": "string",
                        "description": "Learning stage."
                      },
                      "answer": {
                        "enum": [
                          "personal",
                          "business",
                          "mixed",
                          "not_sure",
                          "not_now"
                        ],
                        "type": "string",
                        "description": "User answer."
                      },
                      "ruleId": {
                        "type": "string",
                        "description": "Returned rule ID."
                      },
                      "changeId": {
                        "type": "string",
                        "description": "Returned change ID for Undo."
                      },
                      "revision": {
                        "type": "integer",
                        "description": "Returned learning revision."
                      },
                      "exceptions": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "description": "Exception."
                        },
                        "maxItems": 5,
                        "description": "User exceptions."
                      },
                      "proposalId": {
                        "type": "string",
                        "description": "Returned learning proposal ID."
                      },
                      "questionId": {
                        "type": "string",
                        "description": "Returned question ID."
                      },
                      "distinction": {
                        "type": "string",
                        "description": "User business/personal distinction."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "recipients"
                    ],
                    "properties": {
                      "recipients": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "email"
                          ],
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "Recipient name."
                            },
                            "email": {
                              "type": "string",
                              "format": "email",
                              "description": "Recipient email."
                            }
                          },
                          "additionalProperties": false
                        },
                        "maxItems": 10,
                        "minItems": 1,
                        "description": "Preview recipients."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "label",
                      "purpose",
                      "selection",
                      "includeIncome"
                    ],
                    "properties": {
                      "label": {
                        "type": "string",
                        "maxLength": 80,
                        "minLength": 1,
                        "description": "New setup name."
                      },
                      "purpose": {
                        "enum": [
                          "company",
                          "rental",
                          "personal"
                        ],
                        "type": "string",
                        "description": "Explicit purpose."
                      },
                      "selection": {
                        "type": "object",
                        "required": [
                          "tagMode",
                          "includedTags",
                          "excludedTags",
                          "includeUntagged",
                          "categories"
                        ],
                        "properties": {
                          "tagMode": {
                            "enum": [
                              "all",
                              "selected"
                            ],
                            "type": "string",
                            "description": "All or selected tags."
                          },
                          "categories": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            },
                            "maxItems": 100,
                            "description": "Expense categories; [] = all."
                          },
                          "excludedTags": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            },
                            "maxItems": 100,
                            "description": "Excluded tags take priority."
                          },
                          "includedTags": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "minLength": 1
                            },
                            "maxItems": 100,
                            "description": "Included tags."
                          },
                          "includeUntagged": {
                            "type": "boolean",
                            "description": "Include untagged records."
                          }
                        },
                        "description": "Existing tags and categories.",
                        "additionalProperties": false
                      },
                      "includeIncome": {
                        "type": "boolean",
                        "description": "Include income."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "User choices."
              },
              "confirm": {
                "type": "boolean",
                "const": true,
                "description": "Approve exact preview."
              },
              "operation": {
                "enum": [
                  "general_settings",
                  "personal_rules",
                  "setup_decision",
                  "personal_learning",
                  "invite_clients",
                  "report_setup"
                ],
                "type": "string",
                "description": "report_setup previews new choices. Review records and create files in-app."
              },
              "proposalId": {
                "type": "string",
                "pattern": "^[a-f0-9]{32}$",
                "description": "Returned setup proposal ID."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "result": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "status": {
                "enum": [
                  "preview",
                  "completed",
                  "executing",
                  "pending_verification",
                  "handoff",
                  "read",
                  "requires_new_preview"
                ],
                "type": "string",
                "description": "Pending requires verification."
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "proposed": {
                "type": "object",
                "description": "Show these changes for approval."
              },
              "revision": {
                "type": "string"
              },
              "operation": {
                "enum": [
                  "general_settings",
                  "personal_rules",
                  "setup_decision",
                  "personal_learning",
                  "invite_clients",
                  "report_setup"
                ],
                "type": "string"
              },
              "handoffUrl": {
                "type": "string",
                "description": "Open to continue setup."
              },
              "proposalId": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Preview and complete setup",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "search_expenses",
          "description": "Search spreadsheet expenses by category, merchant, dates, amount or tags. When hasMore, reuse nextCursor with identical filters; avoid overlapping ranges. Optional query does deterministic non-embedding recall over merchant, city/location, Notes (e.g. receipt items, delivery source, payer or business purpose), Tag and category; ANDed with structured filters. Query examples: Tribeca restaurant, client dinner note. Results include matchedFields, matchReason and exact expenseId. expenseId is the exact durable Receipt ID for update_expense. paymentStatus is bookkeeping only, never bank settlement proof. For card/account nicknames use includePaidWith:true; page-only labels cannot filter all expenses. Country/client review: groupBy:country needs explicit YYYY-MM-DD bounds, at most 100 matches; narrow oversized ranges. Use configured travel categories; foreign locations do not prove travel. Keep unknown countries separate; ask about ambiguous places, never infer from currency. Country review allows categories/merchants/tags/countries/tagAssignment, no query or pagination. Show counts and per-currency totals; copy selectionItems (tag/date/location expectations) to group_expenses once a destination is chosen.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Filter by tags"
              },
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 50,
                "minimum": 1,
                "description": "Results per page (default 20, maximum 50)"
              },
              "query": {
                "type": "string",
                "description": "Optional case-insensitive keyword recall over the fields listed in the tool description; ANDed with structured filters."
              },
              "cursor": {
                "type": "string",
                "description": "Opaque nextCursor returned by the previous search_expenses page. Reuse the same filters; never construct or edit this value."
              },
              "groupBy": {
                "enum": [
                  "country"
                ],
                "type": "string",
                "description": "Read-only country review; requires explicit dateRange.start/end and at most 100 matches."
              },
              "countries": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Country-review filter: supported country names/codes, or unknown. Never infer a country from currency or an ambiguous city."
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "maxAmount": {
                "type": "number",
                "description": "Maximum expense amount"
              },
              "merchants": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Filter by merchant names (e.g., ['Uber', 'Starbucks'])"
              },
              "minAmount": {
                "type": "number",
                "description": "Minimum expense amount"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Filter by expense categories (e.g., ['Travel', 'Meals'])"
              },
              "hasReceipt": {
                "type": "boolean",
                "description": "When true, return only expenses with a receipt link. When false, return only expenses without one."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              },
              "paymentStatus": {
                "enum": [
                  "paid",
                  "unpaid",
                  "unknown"
                ],
                "type": "string",
                "description": "Bookkeeping prefix filter before pagination; not bank settlement. Ordinary search only."
              },
              "tagAssignment": {
                "enum": [
                  "all",
                  "unassigned",
                  "no_client"
                ],
                "type": "string",
                "description": "Country review: unassigned = blank/Business; no_client = no canonical client tag (incl. project/trip tags). Neither implies business use."
              },
              "includePaidWith": {
                "type": "boolean",
                "description": "Page labels only; unavailable differs from blank. No label filter."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "expenses",
              "count",
              "total"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "description": "Rows matched by the filters."
              },
              "total": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Home-currency sum in normal search; null in country review. Use countryGroups totalsByCurrency, never sum currencies."
              },
              "hasMore": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "expenses": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Matching expense rows, newest first, paginated."
              },
              "pageInfo": {
                "type": "object"
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque signed continuation; reuse with identical filters."
              },
              "queryApplied": {
                "type": "string"
              },
              "totalMatched": {
                "type": "integer",
                "description": "Present for free-text searches."
              },
              "countryGroups": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Complete bounded country review; unknown locations remain separate."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Search expenses",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_spending_summary",
          "description": "Summarize the user's recorded expenses with totals and breakdowns by category, merchant, month, tag, source, or payment method. Supports date ranges, period comparisons, and total, count, or average metrics. Read-only. Income or profit questions: get_income_summary/get_pnl. Returns: { message, data: { total, breakdown?, comparison?, sampleMeta? } }.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Natural language question (e.g., 'how much did I spend in March', 'top merchants this quarter')"
              },
              "metric": {
                "enum": [
                  "total",
                  "count",
                  "average"
                ],
                "type": "string"
              },
              "groupBy": {
                "enum": [
                  "category",
                  "merchant",
                  "month",
                  "tag",
                  "source",
                  "paymentMethod"
                ],
                "type": "string"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Optional configured expense categories to include in the summary."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Inline analytics; null without sheet/data."
              },
              "type": {
                "type": "string",
                "description": "Async analytics_pending: poll pollEndpoint/poll_analytics(jobId)."
              },
              "jobId": {
                "type": "string",
                "description": "Async branch only."
              },
              "message": {
                "type": "string",
                "description": "Narrative."
              },
              "success": {
                "type": "boolean",
                "description": "Async branch only."
              },
              "response": {
                "type": "string",
                "description": "Chat alias of message."
              },
              "pollEndpoint": {
                "type": "string",
                "description": "Async branch only."
              },
              "pollInterval": {
                "type": "number",
                "description": "Async: milliseconds."
              },
              "estimatedTime": {
                "type": "number",
                "description": "Async: seconds."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get spending summary",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_deep_analytics",
          "description": "Run deeper, multi-step analytics on the user's expenses. Use for explanatory questions like 'why did my spending increase' or 'compare Q1 vs Q2'. Takes 10-30 seconds (runs as a background job, polled automatically). Returns: { message, data: { ..., sampleMeta? } } where sampleMeta.isTruncated indicates whether the agent saw the full dataset.",
          "inputSchema": {
            "type": "object",
            "required": [
              "query"
            ],
            "properties": {
              "query": {
                "type": "string",
                "description": "The analytics question to answer"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Inline analytics; null without sheet/data."
              },
              "type": {
                "type": "string",
                "description": "Async analytics_pending: poll pollEndpoint/poll_analytics(jobId)."
              },
              "jobId": {
                "type": "string",
                "description": "Async branch only."
              },
              "message": {
                "type": "string",
                "description": "Narrative."
              },
              "success": {
                "type": "boolean",
                "description": "Async branch only."
              },
              "response": {
                "type": "string",
                "description": "Chat alias of message."
              },
              "pollEndpoint": {
                "type": "string",
                "description": "Async branch only."
              },
              "pollInterval": {
                "type": "number",
                "description": "Async: milliseconds."
              },
              "estimatedTime": {
                "type": "number",
                "description": "Async: seconds."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Run deep analytics",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "create_report",
          "description": "Create ordinary expense reports by date/client/project/trip/category/merchant. For saved setups, accountant records or persona worksheets, use review_report_setup and its app links. Tags group clients/projects/codes/trips; list_tags if unclear. excludePersonal=true excludes Personal tag and Personal expense category. Returns summary, exact report/Bill Client links, filters and prefilled Report Wizard for visual criteria. shareWith emails only user-named recipients. No server preview: creates on call. Group reports exclude rows on other ordinary reports. No unreported matches: explain existing Reports; never duplicate. Use role-aware accountingHandoffUrls only for the requested destination; opening is not export proof. Skip check_compliance/get_report_details/tax/deductibility analysis unless explicitly requested.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Include existing client, project, code, property or trip groups. Check list_tags if unsure."
              },
              "title": {
                "type": "string",
                "description": "Custom report title"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "shareWith": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                },
                "description": "Email addresses to share the report with"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Include configured expense categories."
              },
              "excludedTags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Exclude these existing groups."
              },
              "recipientRole": {
                "enum": [
                  "reviewer",
                  "accountant"
                ],
                "type": "string",
                "default": "reviewer",
                "description": "All recipients: reviewer for one report (comments, approval, changes). Use accountant only for explicitly requested ongoing report management and accounting-software access."
              },
              "excludePersonal": {
                "type": "boolean",
                "description": "Exclude both Personal-tagged and Personal-category expenses."
              },
              "excludedCategories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Exclude these expense categories."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "reportId": {
                "type": "string"
              },
              "reportUrl": {
                "type": "string"
              },
              "finalAnswer": {
                "type": "string"
              },
              "nextActions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "billClientUrl": {
                "type": "string"
              },
              "creationStatus": {
                "type": "string"
              },
              "responseGuidance": {
                "type": "string"
              },
              "accountingSetupUrl": {
                "type": "string"
              },
              "accountingHandoffUrls": {
                "type": "object"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Create expense report",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "review_report_setup",
          "description": "Read the owner's saved company, rental or personal report setups. List first. For status/preview use a listed setupId and requested ending taxYear; preview needs revision. Preparation checks known scan/import outcomes without starting work. Pass exact revision, taxYear, periodId, startDate and endDate from status/preview. Use resumeUrl to create the file in-app, or specialistLinks for separate reports with their own dates and rules. Counts/outcomes cannot establish completeness or tax eligibility.",
          "inputSchema": {
            "type": "object",
            "required": [
              "mode"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "list",
                  "preview",
                  "status",
                  "preparation"
                ],
                "type": "string"
              },
              "endDate": {
                "type": "string",
                "description": "Preparation: returned YYYY-MM-DD."
              },
              "setupId": {
                "type": "string"
              },
              "taxYear": {
                "type": "integer"
              },
              "periodId": {
                "type": "string",
                "description": "Preparation: returned periodId."
              },
              "revision": {
                "type": "integer"
              },
              "startDate": {
                "type": "string",
                "description": "Preparation: returned YYYY-MM-DD."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "error": {
                "type": "string"
              },
              "setup": {
                "type": "object"
              },
              "state": {
                "type": "string"
              },
              "counts": {
                "type": "object"
              },
              "period": {
                "type": "object"
              },
              "report": {
                "type": "object"
              },
              "setups": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "totals": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "resumeUrl": {
                "type": "string"
              },
              "preparation": {
                "type": "object"
              },
              "reviewSummary": {
                "type": "object"
              },
              "canCreateInApp": {
                "type": "boolean"
              },
              "existingReport": {
                "type": "boolean"
              },
              "specialistLinks": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "availableInWorkspace": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Review a saved report setup",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_reports",
          "description": "List the user's expense reports with pagination. Filter by status (All, Draft, Submitted, Shared). Each exact report includes its app, Bill Client, and accounting handoff URLs. Use the matching accounting URL only when the user explicitly asks to send or export that report; the app keeps organization, mapping, preview, and final confirmation.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "page": {
                "type": "integer",
                "default": 1,
                "description": "One-based results page to return."
              },
              "limit": {
                "type": "integer",
                "default": 20,
                "description": "Maximum reports to return on this page."
              },
              "filter": {
                "enum": [
                  "All",
                  "Draft",
                  "Submitted",
                  "Shared"
                ],
                "type": "string",
                "default": "All",
                "description": "Optional report-status filter; All returns every authorized status."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "creationStatus"
            ],
            "properties": {
              "page": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "filter": {
                "type": "string"
              },
              "reports": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Present when the user has reports."
              },
              "success": {
                "type": "boolean"
              },
              "creationStatus": {
                "type": "string",
                "description": "Provenance of the listing, e.g. \"existing_only\"."
              },
              "responseGuidance": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List expense reports",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "request_accounting_integration",
          "description": "Request an exact accounting package only after checking reviewed direct/import-file destinations and finding no match. Do not use this for a listed or Beta destination or general compatibility. A confirmation-gated write: after user approval, creates one deduplicated request bound to the authenticated account and emails ExpenseBot's internal team. Does not create an integration or immediate availability. For accepted/already-recorded requests, say ExpenseBot will email an update within one week.",
          "inputSchema": {
            "type": "object",
            "required": [
              "packageName"
            ],
            "properties": {
              "packageName": {
                "type": "string",
                "description": "Exact accounting package requested by the user."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "duplicate",
              "packageName",
              "message"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "duplicate": {
                "type": "boolean"
              },
              "packageName": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Request an accounting integration",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_report_details",
          "description": "Get full details of a specific expense report including all expenses, totals, and compliance status. Use only when the user explicitly asks to inspect an existing report's details. Without checkFreshness:true, returns the stored report only. When explicitly requested together with analysisRequested:true, freshness reads canonical Google Sheets sources with a 5-second bound; if full tax-year replay is unavailable, status is unknown, not current. Never call this as a preflight or follow-up to creating, sharing, or billing from a report; those tools already return the requested result and links.",
          "inputSchema": {
            "type": "object",
            "required": [
              "reportId",
              "analysisRequested"
            ],
            "properties": {
              "reportId": {
                "type": "string",
                "description": "The report/spreadsheet ID"
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              },
              "checkFreshness": {
                "enum": [
                  true
                ],
                "type": "boolean",
                "description": "True only when the user explicitly asks if this Year End report is current. Needs analysisRequested:true; a bounded Sheets check that may return unknown. Never after report creation, sharing or billing."
              },
              "analysisRequested": {
                "enum": [
                  true
                ],
                "type": "boolean",
                "description": "True only when the user explicitly asked to inspect this report. Never ask for or copy their message or infer consent from report creation, sharing or billing."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "report"
            ],
            "properties": {
              "report": {
                "type": "object",
                "description": "The full stored report record."
              },
              "success": {
                "type": "boolean"
              },
              "freshness": {
                "type": "object"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get report details",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "share_report",
          "description": "Share one existing expense report with user-named recipients. No server preview: shares and emails on call. Default to reviewer: they can open and edit that report's Google Sheet, inspect receipts, comment, approve, or request changes, but cannot act for the owner or use accounting integrations. Use accountant only when the user explicitly asks for ongoing accounting access; it creates the established accountant relationship and broader report-management workflow.",
          "inputSchema": {
            "type": "object",
            "required": [
              "reportId",
              "recipients"
            ],
            "properties": {
              "reportId": {
                "type": "string"
              },
              "recipients": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              },
              "recipientRole": {
                "enum": [
                  "reviewer",
                  "accountant"
                ],
                "type": "string",
                "default": "reviewer",
                "description": "Use reviewer for report-only approval. Use accountant only for explicit ongoing accountant access."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message",
              "sharedWith",
              "recipientRole"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "sharedWith": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "finalAnswer": {
                "type": "string"
              },
              "recipientRole": {
                "type": "string"
              },
              "responseGuidance": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Share expense report",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "check_compliance",
          "description": "Use only when the user explicitly asks to check an existing report for compliance issues such as missing business purpose or policy violations. Creating a report, excluding Personal expenses, sharing a report, or billing a client is not a compliance request; never call this tool automatically as a preflight or follow-up for those workflows.",
          "inputSchema": {
            "type": "object",
            "required": [
              "reportId",
              "analysisRequested"
            ],
            "properties": {
              "reportId": {
                "type": "string",
                "description": "Report ID to check"
              },
              "analysisRequested": {
                "enum": [
                  true
                ],
                "type": "boolean",
                "description": "True only when the user explicitly asked for this report's compliance analysis. Never ask for or copy their message or infer consent from report creation, sharing or billing."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check report compliance",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "fix_compliance",
          "description": "Fix recorded expenses only after an explicit request to fix check_compliance findings; follow correct_expenses. Use exact expenseIds from search_expenses; never select all report rows or infer purpose/category/attendees. First call always gives a no-write before/after preview, even with early confirm:true; show changes and ask approval, then repeat identical operationId/selection/change with confirm:true. Terminal result gives applied/conflicted/failed counts, status and Undo. Group via group_expenses. Unsupported or over 100 rows: https://www.expensebot.ai/review-expenses?source=mcp.",
          "inputSchema": {
            "type": "object",
            "required": [
              "operationId"
            ],
            "properties": {
              "undo": {
                "type": "boolean",
                "description": "Undo within the Undo window."
              },
              "change": {
                "type": "object",
                "oneOf": [
                  {
                    "required": [
                      "category"
                    ],
                    "properties": {
                      "type": {
                        "const": "category"
                      }
                    }
                  },
                  {
                    "required": [
                      "businessPurpose"
                    ],
                    "properties": {
                      "type": {
                        "const": "businessPurpose"
                      }
                    }
                  },
                  {
                    "required": [
                      "attendees"
                    ],
                    "properties": {
                      "type": {
                        "const": "attendees"
                      }
                    }
                  }
                ],
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "enum": [
                      "category",
                      "businessPurpose",
                      "attendees"
                    ],
                    "type": "string",
                    "description": "Correction kind applied to every selected expense."
                  },
                  "category": {
                    "type": "string",
                    "description": "Configured category when type is category."
                  },
                  "attendees": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "description": "Names the user supplied when type is attendees; never infer names."
                  },
                  "attendeeMode": {
                    "enum": [
                      "add",
                      "replace"
                    ],
                    "type": "string",
                    "description": "add unless the user asks to replace existing attendees."
                  },
                  "businessPurpose": {
                    "type": "string",
                    "description": "User-supplied purpose when type is businessPurpose."
                  }
                },
                "description": "Exactly one correction; its type selects the required value field.",
                "additionalProperties": false
              },
              "status": {
                "type": "boolean",
                "description": "Read status by operationId."
              },
              "confirm": {
                "type": "boolean",
                "description": "Omit/false for preview; true only after explicit approval."
              },
              "selection": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "receiptId"
                      ],
                      "properties": {
                        "expected": {
                          "type": "object",
                          "properties": {
                            "notes": {
                              "type": "string",
                              "description": "Notes value seen before preview."
                            },
                            "category": {
                              "type": "string",
                              "description": "Category seen before preview."
                            }
                          },
                          "description": "Optional search values for conflict detection.",
                          "additionalProperties": false
                        },
                        "receiptId": {
                          "type": "string",
                          "description": "Full expenseId (Column Q) from search_expenses."
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 100,
                    "minItems": 1,
                    "description": "One receipt identity per expense; never broaden after preview."
                  }
                },
                "description": "Exact expenses from search_expenses approved for this correction.",
                "additionalProperties": false
              },
              "operationId": {
                "type": "string",
                "pattern": "^expense-bulk:[a-zA-Z0-9_-]{8,100}$",
                "description": "Idempotency key generated once and reused unchanged."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "status"
            ],
            "properties": {
              "undo": {
                "type": "object"
              },
              "change": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "manifest": {
                "type": "object"
              },
              "finalAnswer": {
                "type": "string"
              },
              "operationId": {
                "type": "string"
              },
              "confirmation": {
                "type": "object"
              },
              "responseGuidance": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              },
              "requiresConfirmation": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Fix compliance issues",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "check_tax_deductibility",
          "description": "Use this when the user asks for general deduction guidance for an expense type, such as business meals or home-office expenses. Looks up reference rules using the account's tax-country/home settings and current year. A verified rule may return a percentage and reference; unverified rules return unknown/reviewRequired without a percentage. Read-only: it does not classify saved expenses, prepare a return, or determine the user's actual tax liability. Do not use for tax refunds received as income; use get_income_summary for recorded refunds. General guidance is not a tax professional's determination.",
          "inputSchema": {
            "type": "object",
            "required": [
              "query"
            ],
            "properties": {
              "query": {
                "type": "string",
                "description": "Brief expense-type deduction question, e.g. 'are business meals deductible?'; no account numbers or unrelated personal context."
              },
              "category": {
                "type": "string",
                "description": "Optional expense category to match the reference rule."
              },
              "merchant": {
                "type": "string",
                "description": "Optional merchant name only when relevant to the expense type."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check tax deductibility",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "search_knowledge",
          "description": "Search ExpenseBot's complete product and help knowledge base. Use this before guessing when the user asks how a feature works, what ExpenseBot supports, or needs setup, billing, Gmail, scan, report, workflow, or troubleshooting instructions. Set fullAnswer:true on the first call when the user asks for complete, detailed, or step-by-step instructions. Use the default excerpt mode for discovery and quick answers; if an excerpt is truncated, call again with fullAnswer:true before presenting complete instructions. Each result has a stable id.",
          "inputSchema": {
            "type": "object",
            "required": [
              "query"
            ],
            "properties": {
              "limit": {
                "type": "integer",
                "default": 5,
                "maximum": 10,
                "minimum": 1,
                "description": "Number of ranked matching articles to return (1-10)."
              },
              "query": {
                "type": "string",
                "description": "Search terms"
              },
              "fullAnswer": {
                "type": "boolean",
                "default": false,
                "description": "True on the first call for complete or step-by-step instructions."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "results"
            ],
            "properties": {
              "results": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Search ExpenseBot knowledge base",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "submit_receipt",
          "description": "Process receipt images/PDFs, including 'log this', 'save this receipt', 'expense this', 'add this to my expenses' or a shared receipt/invoice photo. Starts on call (no server preview); AI extracts vendor, amount, date, tax and category (usually 1–3 minutes; longer for PDFs/batches); poll get_last_receipt_result with the returned submissionId. Mixed images/PDFs work. Required for PDFs; use this flow for large files/batches: call filesToUpload for EVERY file; PUT each ONE AT A TIME to signed URLs, report file/count progress, then call ONCE with all uploadRefs as one batch, never once per file. photo accepts one ChatGPT image/PDF; photoBase64 only for one small image without file references. note maps to Notes L, tag to Tag K; batch defaults apply to all files and uploadRefs items may override.",
          "inputSchema": {
            "type": "object",
            "required": [],
            "properties": {
              "tag": {
                "type": "string",
                "description": "Batch-level project or client tag for every row; a file may override it. Stored in the Tag column (K)."
              },
              "note": {
                "type": "string",
                "description": "Batch-level note for every file; a file may override it. Stored in the Notes column (L)."
              },
              "photo": {
                "type": "object",
                "required": [
                  "download_url",
                  "file_id"
                ],
                "properties": {
                  "file_id": {
                    "type": "string",
                    "description": "ChatGPT attachment ID."
                  },
                  "file_name": {
                    "type": "string",
                    "description": "ChatGPT attachment filename."
                  },
                  "mime_type": {
                    "type": "string",
                    "description": "ChatGPT attachment MIME type."
                  },
                  "download_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "ChatGPT temporary HTTPS attachment URL."
                  }
                },
                "description": "Single attached receipt image or PDF supplied by ChatGPT. For multiple files or large files, use filesToUpload and uploadRefs instead."
              },
              "filename": {
                "type": "string",
                "description": "Optional filename (e.g., 'lunch_receipt.jpg')"
              },
              "mimeType": {
                "enum": [
                  "image/jpeg",
                  "image/png",
                  "image/heic",
                  "image/webp",
                  "application/pdf"
                ],
                "type": "string",
                "description": "MIME type of the file (default: image/jpeg)"
              },
              "uploadRef": {
                "type": "string",
                "description": "Single-file shorthand for uploadRefs. Use uploadRefs when there is more than one file."
              },
              "uploadRefs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "uploadRef"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The id you supplied in filesToUpload."
                    },
                    "tag": {
                      "type": "string",
                      "description": "Project or client tag for this specific file. Overrides the batch-level tag and is stored in the Tag column (K)."
                    },
                    "note": {
                      "type": "string",
                      "description": "Note for this file; overrides the batch note. Stored in the Notes column (L)."
                    },
                    "uploadRef": {
                      "type": "string",
                      "description": "uploadRef returned for that file."
                    }
                  }
                },
                "description": "Every uploadRef from the filesToUpload step, as ONE batch. If any file fails validation nothing is processed."
              },
              "photoBase64": {
                "type": "string",
                "description": "Legacy fallback for MCP clients that send one small image as complete base64 data. ChatGPT should use photo or uploadRefs instead."
              },
              "filesToUpload": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "filename"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Your own identifier for this file, echoed back so you can match URLs to files. E.g. '1', '2'."
                    },
                    "filename": {
                      "type": "string",
                      "description": "Original filename, e.g. 'lunch.jpg' or 'invoice.pdf'."
                    },
                    "mimeType": {
                      "enum": [
                        "image/jpeg",
                        "image/png",
                        "image/heic",
                        "image/heif",
                        "image/webp",
                        "application/pdf"
                      ],
                      "type": "string",
                      "description": "MIME type; must match the PUT Content-Type exactly. The real format is re-detected from the contents."
                    }
                  }
                },
                "description": "Every file the user provided, in one call. Returns signedUrl + uploadRef per file; upload each, then call with uploadRefs."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "upload_required"
                    }
                  }
                },
                "then": {
                  "required": [
                    "data"
                  ]
                }
              }
            ],
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mimeType": {
                          "type": "string"
                        },
                        "signedUrl": {
                          "type": "string"
                        },
                        "uploadRef": {
                          "type": "string"
                        },
                        "requiredHeaders": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "signedUrl": {
                    "type": "string"
                  },
                  "uploadRef": {
                    "type": "string"
                  },
                  "submissionId": {
                    "type": "string"
                  },
                  "spreadsheetUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "requiredHeaders": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "expiresInSeconds": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "reviewExpensesUrl": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "fileCount": {
                "type": "integer",
                "minimum": 0
              },
              "statusCode": {
                "type": "integer"
              },
              "submissionId": {
                "type": "string"
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Submit receipt photo or PDF",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_last_receipt_result",
          "description": "Read the authoritative outcome of a receipt batch: a submit_receipt batch by its exact ID (submissionId), or the latest upload (including in-app) via withinSeconds. Poll at the returned interval/time allowance (small batch at least 5 minutes; larger longer). Pending is normal: never blindly resubmit. found:false = pending/no terminal verdict; found:true = terminal. Returns added/duplicate/skipped/held_for_review/errored per-file outcomes, exact counts and up to 10 summaries. Held files (missing details or a possible duplicate) were not added; relay only their message's next step (use the returned Review files link), do not invent a missing card or direct held uploads to Gmail Action Needed. Show spreadsheetUrl/reviewExpensesUrl for rows actually added, not for held files. Unknown outcomes stay unknown. Gmail scans use get_scan_status. Read-only.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "submissionId": {
                "type": "string",
                "description": "Exact submissionId returned by submit_receipt. Strongly preferred because it binds the result to this upload instead of an earlier receipt."
              },
              "withinSeconds": {
                "type": "integer",
                "default": 600,
                "maximum": 3600,
                "minimum": 30,
                "description": "Lookback seconds for the latest upload when there is no submissionId."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "found"
                  ],
                  "properties": {
                    "found": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "verdict",
                    "counts",
                    "receipts",
                    "submissionId",
                    "spreadsheetUrl",
                    "reviewExpensesUrl",
                    "data",
                    "timestamp"
                  ]
                }
              }
            ],
            "required": [
              "success",
              "found",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": true
              },
              "found": {
                "type": "boolean"
              },
              "state": {
                "type": "string",
                "const": "processing",
                "description": "Present on pending polls for a specific submission."
              },
              "counts": {
                "type": "object",
                "required": [
                  "submitted",
                  "added",
                  "duplicates",
                  "skipped",
                  "errors"
                ],
                "properties": {
                  "added": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "errors": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "submitted": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "duplicates": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "heldForReview": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Files held for review and not added. Present only when at least one."
                  }
                },
                "additionalProperties": true
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean",
                "const": true
              },
              "verdict": {
                "enum": [
                  "added",
                  "duplicate",
                  "skipped",
                  "errored",
                  "mixed",
                  "unknown",
                  "held_for_review"
                ],
                "type": "string",
                "description": "Terminal only. held_for_review: every file was held, none added; mixed also covers batches with held files."
              },
              "receipts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                },
                "description": "Processed receipt summaries. Held files are not listed here; see data.outcomes."
              },
              "timestamp": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "submissionId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            },
            "description": "found:false means processing is still pending; found:true is a terminal result."
          },
          "annotations": {
            "title": "Check a submitted receipt outcome",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "add_cash_expense",
          "description": "Add one receiptless expense or client-provided expense advance to the expense sheet after the user confirms; no server preview, it writes on call. Ordinary expenses: list_categories first; use a configured Expense Account. Advances: isClientAdvance=true + clientName reuses/creates the canonical client group, applies Cash advance received and writes a negative expense. Only client money provided before spending; never for vendor refunds, reimbursements, earned fees, retainers or generic deposits. Multiple/incomplete entries, refunds, tax/tip/per diem: Manual expense link from get_spreadsheet_url.",
          "inputSchema": {
            "type": "object",
            "required": [
              "total",
              "date"
            ],
            "properties": {
              "tax": {
                "type": "number",
                "description": "Tax amount"
              },
              "tip": {
                "type": "number",
                "description": "Tip amount"
              },
              "city": {
                "type": "string",
                "description": "City/location"
              },
              "date": {
                "type": "string",
                "format": "date",
                "description": "Expense date (YYYY-MM-DD)"
              },
              "notes": {
                "type": "string",
                "description": "Notes or description"
              },
              "total": {
                "type": "number",
                "description": "Positive amount paid or received. ExpenseBot stores a client advance as negative."
              },
              "category": {
                "type": "string",
                "description": "A configured Expense Account returned by list_categories. Do not invent a category."
              },
              "currency": {
                "type": "string",
                "description": "Currency code (default: USD)"
              },
              "merchant": {
                "type": "string",
                "description": "Merchant/vendor name for an ordinary expense. Not needed for a client advance; ExpenseBot derives it from clientName."
              },
              "subtotal": {
                "type": "number",
                "description": "Subtotal before tax"
              },
              "clientName": {
                "type": "string",
                "description": "Client name for a client advance, in ordinary language. ExpenseBot resolves the canonical Client – Name group."
              },
              "isClientAdvance": {
                "type": "boolean",
                "description": "True only when a client supplied money in advance for expenses. Requires clientName and does not require category."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "expense": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "recordId": {
                "type": "string"
              },
              "rowNumber": {
                "type": "integer"
              },
              "finalAnswer": {
                "type": "string"
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "responseGuidance": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Log cash expense",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "parse_expense",
          "description": "Parse a natural language expense description into structured fields. Does NOT add the expense: returns fields to show the user; once they approve, save with add_cash_expense. Example: \"Lunch at Chipotle $15.50 today\" → {merchant: \"Chipotle\", total: 15.50, ...}",
          "inputSchema": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "description": "Natural language expense (e.g., \"Coffee at Starbucks $6.50 yesterday\")"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "expenses",
              "validationErrors",
              "categoryNames"
            ],
            "properties": {
              "success": {
                "type": "boolean"
              },
              "expenses": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "categoryNames": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "validationErrors": {
                "type": "array",
                "items": {}
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Parse expense text",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "process_gmail_receipts",
          "description": "Process specific Gmail emails as receipts when the user supplies Gmail message IDs; to find receipts use scan_gmail. No server preview: on call each email is converted to PDF, extracted by AI and added to the user's expense spreadsheet. Max 25 emails per request. Requires Gmail connected in ExpenseBot.",
          "inputSchema": {
            "type": "object",
            "required": [
              "emailIds"
            ],
            "properties": {
              "emailIds": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Gmail message IDs to process as receipts"
              },
              "accountEmail": {
                "type": "string",
                "description": "Optional: which Gmail account to use (for users with multiple linked accounts)"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "emailCount": {
                "type": "integer"
              },
              "processInfo": {
                "type": "object"
              },
              "submissionId": {
                "type": "string"
              },
              "processedItems": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Process specific Gmail receipts",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "scan_gmail",
          "description": "Trigger a background Gmail scan to discover and process receipt emails from the last ~60 days (default). No server preview: starts on call and runs in the background; the user gets an email summary when done. Like clicking \"Find Receipts in Gmail\" in the UI. For whole PAST YEARS (e.g. 2023, or 2020-2022) use scan_gmail_years instead; to check a scan's progress use get_scan_status. Outlook.com or Microsoft 365: set provider:outlook for a Beta setup or scan link; no scan starts.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "endDate": {
                "type": "string",
                "format": "date",
                "description": "Optional: explicit end date (YYYY-MM-DD)"
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string",
                "description": "Default Gmail."
              },
              "startDate": {
                "type": "string",
                "format": "date",
                "description": "Optional: explicit start date (YYYY-MM-DD) instead of lookbackDays"
              },
              "accountEmail": {
                "type": "string",
                "description": "Optional connected mailbox email"
              },
              "lookbackDays": {
                "type": "integer",
                "default": 60,
                "description": "How many days back to scan (default 60, max depends on subscription)"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string"
              },
              "_metadata": {
                "type": "object"
              },
              "sessionId": {
                "type": "string"
              },
              "orchestrated": {
                "type": "boolean"
              },
              "submissionId": {
                "type": "string"
              },
              "scanInitiated": {
                "type": "boolean"
              },
              "scanInProgress": {
                "type": "boolean"
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewExpensesUrl": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Scan Gmail for receipts",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "add_mileage_entry",
          "description": "Log one user-confirmed business trip; writes on call, no server preview. Saved mode selects rate-based expense or distance-only trip; trackingMode overrides. For routes, vehicle setup/readings, imports or review, open Mileage and travel via get_spreadsheet_url.",
          "inputSchema": {
            "type": "object",
            "required": [
              "distance",
              "purpose",
              "date"
            ],
            "properties": {
              "tag": {
                "type": "string",
                "description": "Client/project tag."
              },
              "city": {
                "type": "string",
                "description": "City."
              },
              "date": {
                "type": "string",
                "format": "date",
                "description": "Required YYYY-MM-DD. Use the given date; for today use the user's timezone. Ask if missing."
              },
              "unit": {
                "enum": [
                  "km",
                  "mi"
                ],
                "type": "string",
                "description": "Trip-log unit; omit for saved. Expense uses configured unit."
              },
              "notes": {
                "type": "string",
                "description": "User context."
              },
              "purpose": {
                "type": "string",
                "description": "Business trip purpose."
              },
              "category": {
                "type": "string",
                "description": "Mileage category override."
              },
              "distance": {
                "type": "number",
                "description": "Distance in configured miles/km."
              },
              "roundTrip": {
                "type": "boolean",
                "default": false,
                "description": "Double distance for return trip."
              },
              "vehicleId": {
                "type": "string",
                "description": "Existing vehicle ID; omit for unassigned; never invent."
              },
              "destination": {
                "type": "string",
                "description": "Destination."
              },
              "operationId": {
                "type": "string",
                "description": "Stable ID required for trip_log; reuse for the same request; never repeat an unverified save."
              },
              "trackingMode": {
                "enum": [
                  "expense",
                  "trip_log"
                ],
                "type": "string",
                "description": "Optional override; otherwise saved mode. Never infer from country or occupation."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "settings": {
                "type": "object"
              },
              "rowNumber": {
                "type": "integer"
              },
              "finalAnswer": {
                "type": "string"
              },
              "trackingMode": {
                "enum": [
                  "expense",
                  "trip_log"
                ],
                "type": "string"
              },
              "mileageLogUrl": {
                "type": "string"
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "responseGuidance": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Log mileage trip",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "add_income",
          "description": "Log exactly one confirmed income payment (cash/check/Stripe/etc.) to Income, e.g. income absent from Gmail/Plaid; no server preview, it writes on call. Never loop over statements/exports/tables/lists. Multiple payments: add_income_from_csv for CSV/TSV/text or add_income_from_file for image/PDF; both duplicate-check, preview and require confirmation. Call list_income_categories first; use fixed tax categories. Omitted category defaults to Service income; unknown is rejected.",
          "inputSchema": {
            "type": "object",
            "required": [
              "amount",
              "source",
              "paymentMethod",
              "date"
            ],
            "properties": {
              "tag": {
                "type": "string",
                "description": "Tag for client/project attribution"
              },
              "date": {
                "type": "string",
                "format": "date",
                "description": "Income date (YYYY-MM-DD). Required. Use the date the user gives; for \"today\" send today's calendar date in their timezone. If no date was given, ask."
              },
              "fees": {
                "type": "number",
                "description": "Processor/transfer fees deducted"
              },
              "notes": {
                "type": "string"
              },
              "amount": {
                "type": "number",
                "description": "Income amount (>0)"
              },
              "source": {
                "type": "string",
                "description": "Who paid you (client name, customer, etc.)"
              },
              "category": {
                "type": "string",
                "description": "A category returned by list_income_categories (optional; defaults to Service income)"
              },
              "currency": {
                "type": "string",
                "description": "Currency code (default: home currency)"
              },
              "reference": {
                "type": "string",
                "description": "Invoice or transaction reference"
              },
              "description": {
                "type": "string",
                "description": "What the income was for"
              },
              "taxCollected": {
                "type": "number",
                "description": "Sales tax/GST/HST collected"
              },
              "paymentMethod": {
                "type": "string",
                "description": "How you got paid: Cash, Check, Bank transfer, Wallet app, Credit/Debit card, Payment processor or Other; labels like Stripe or Venmo are normalized."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "deduped": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "recordId": {
                "type": "string"
              },
              "rowNumber": {
                "type": "integer"
              },
              "matchedRow": {
                "type": "object"
              },
              "tabCreated": {
                "type": "boolean"
              },
              "finalAnswer": {
                "type": "string"
              },
              "destinations": {
                "type": "object"
              },
              "responseGuidance": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Log income entry",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "add_income_from_file",
          "description": "Import income from attached JPEG/PNG/WebP/HEIC/HEIF screenshots/images or PDF (payment/wallet/payout/bank statement; max 10 MB). Step 1: file WITHOUT confirm uses Add Income's parser and Income-tab duplicate check. Returns previewId, exact count, currency totals, rows, duplicate flags/rejections; parses only, saves nothing. Attachment is not write consent. Show rows/duplicates. Step 2: confirm:true + previewId writes only user-approved selectedIndexes/keepBothIndexes/rowEdits/tag/bulkNote. Skip flagged duplicates unless explicitly approved in keepBothIndexes. Unknown/expired previews (15 minutes) never write. Success: show spreadsheetUrl + reviewIncomeUrl. Mixed income/expense or many edits: Add Income link from get_spreadsheet_url.",
          "inputSchema": {
            "type": "object",
            "required": [],
            "properties": {
              "tag": {
                "type": "string",
                "description": "Optional client/project tag. In step 1 it pre-fills the staged rows; in step 2 it applies to the confirmed selection."
              },
              "photo": {
                "type": "object",
                "required": [
                  "download_url",
                  "file_id"
                ],
                "properties": {
                  "file_id": {
                    "type": "string",
                    "description": "ChatGPT attachment ID."
                  },
                  "file_name": {
                    "type": "string",
                    "description": "ChatGPT attachment filename."
                  },
                  "mime_type": {
                    "type": "string",
                    "description": "ChatGPT attachment MIME type."
                  },
                  "download_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "ChatGPT temporary HTTPS attachment URL."
                  }
                },
                "description": "Attached image or PDF supplied by ChatGPT for step 1. The server downloads and parses the attachment securely."
              },
              "confirm": {
                "type": "boolean",
                "description": "Step 2 only: true writes the staged rows. Omit it (with previewId absent) to parse and preview without writing."
              },
              "bulkNote": {
                "type": "string",
                "description": "Step 2 only: one note (max 120 chars) prepended to every confirmed row's Notes, same as the app's 'Add note to all entries'."
              },
              "mimeType": {
                "enum": [
                  "image/jpeg",
                  "image/png",
                  "image/webp",
                  "image/heic",
                  "image/heif",
                  "application/pdf"
                ],
                "type": "string",
                "description": "MIME type of the file (default: image/jpeg)"
              },
              "rowEdits": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "index",
                    "fields"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer",
                      "description": "Preview row index"
                    },
                    "fields": {
                      "type": "object",
                      "description": "Only the user-approved fields to replace on this staged row (same field names as rowEdits).",
                      "additionalProperties": true
                    }
                  }
                },
                "description": "Step 2 only: user-approved corrections, max 50 rows (date YYYY-MM-DD, source, amount, currency, category, paymentMethod, description, notes, reference, fees, taxCollected, tag)."
              },
              "previewId": {
                "type": "string",
                "description": "Step 2 only: the previewId returned by the step-1 call."
              },
              "photoBase64": {
                "type": "string",
                "description": "Legacy fallback for MCP clients that send complete image/PDF bytes as base64. ChatGPT should use photo."
              },
              "paymentMethod": {
                "type": "string",
                "description": "Fallback payment rail for rows where the parser found none (Cash, Check, Bank transfer, Wallet app, Credit/Debit card, Payment processor, or Other)."
              },
              "keepBothIndexes": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "Step 2 only: preview indexes of duplicate-flagged rows the user explicitly wants to keep anyway (the app's 'Keep Both')."
              },
              "selectedIndexes": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "Step 2 only: preview row indexes to write. Omit to write all staged rows."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "preview"
                  ],
                  "properties": {
                    "preview": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "previewId",
                    "expiresAt",
                    "entryCount",
                    "entries",
                    "confirmationContract"
                  ]
                }
              },
              {
                "if": {
                  "required": [
                    "confirmed"
                  ],
                  "properties": {
                    "confirmed": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "previewId",
                    "written",
                    "deduped",
                    "failed",
                    "unattempted",
                    "total"
                  ]
                }
              }
            ],
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "deduped": {
                "type": "integer",
                "minimum": 0
              },
              "entries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "payer": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "boolean"
              },
              "success": {
                "type": "boolean"
              },
              "written": {
                "type": "integer",
                "minimum": 0
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confirmed": {
                "type": "boolean"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "previewId": {
                "type": "string"
              },
              "duplicates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "entryCount": {
                "type": "integer",
                "minimum": 0
              },
              "finalAnswer": {
                "type": "string"
              },
              "unattempted": {
                "type": "integer",
                "minimum": 0
              },
              "rejectedRows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "duplicateCount": {
                "type": "integer",
                "minimum": 0
              },
              "maxChatEntries": {
                "type": "integer",
                "minimum": 1
              },
              "refundRowCount": {
                "type": "integer",
                "minimum": 0
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewImportUrl": {
                "type": "string"
              },
              "reviewIncomeUrl": {
                "type": "string"
              },
              "tooLargeForChat": {
                "type": "boolean"
              },
              "expiresInMinutes": {
                "type": "integer",
                "minimum": 1
              },
              "idempotentReplay": {
                "type": "boolean"
              },
              "responseGuidance": {
                "type": "string"
              },
              "totalsByCurrency": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "projectionTruncated": {
                "type": "boolean"
              },
              "confirmationContract": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Import income from an image or PDF",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "add_income_from_csv",
          "description": "Use this to import the user's CSV/TSV/text income export (max 500 KB). Step 1 stages a duplicate-checked previewId without writing Income rows. Show it and obtain approval. Step 2 uses confirm:true and that previewId to write the approved rows/edits; duplicates require explicit keep approval. Unknown or expired previews never write (15-minute expiry). Return spreadsheetUrl and reviewIncomeUrl after success. Accepts user-provided attachments or inline text, not arbitrary web URLs.",
          "inputSchema": {
            "type": "object",
            "required": [],
            "properties": {
              "tag": {
                "type": "string",
                "description": "Optional client/project tag for staged or confirmed rows."
              },
              "confirm": {
                "type": "boolean",
                "description": "Step 2: true writes the staged selection only after user approval."
              },
              "csvText": {
                "type": "string",
                "description": "Step 1 inline CSV/TSV/text fallback; ChatGPT should use csvContent."
              },
              "bulkNote": {
                "type": "string",
                "description": "Step 2 note prepended to confirmed rows (max 120 characters)."
              },
              "rowEdits": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "index",
                    "fields"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Preview row index"
                    },
                    "fields": {
                      "type": "object",
                      "properties": {
                        "tag": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Client/project tag."
                        },
                        "date": {
                          "type": "string",
                          "description": "ISO YYYY-MM-DD calendar date."
                        },
                        "fees": {
                          "type": [
                            "number",
                            "string",
                            "boolean",
                            "null"
                          ],
                          "description": "Non-negative platform fees."
                        },
                        "notes": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Income notes."
                        },
                        "amount": {
                          "type": [
                            "number",
                            "string",
                            "boolean"
                          ],
                          "description": "Non-zero income amount."
                        },
                        "source": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ],
                          "description": "Income source label."
                        },
                        "category": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Income category."
                        },
                        "currency": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Currency code."
                        },
                        "reference": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Income reference."
                        },
                        "description": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Income description."
                        },
                        "taxCollected": {
                          "type": [
                            "number",
                            "string",
                            "boolean",
                            "null"
                          ],
                          "description": "Non-negative collected tax."
                        },
                        "paymentMethod": {
                          "type": [
                            "string",
                            "number",
                            "boolean",
                            "null"
                          ],
                          "description": "Payment rail."
                        }
                      },
                      "description": "Only approved replacements on this staged row.",
                      "additionalProperties": false
                    }
                  }
                },
                "maxItems": 50,
                "description": "Step 2 approved edits; at most 50 selected preview rows."
              },
              "previewId": {
                "type": "string",
                "description": "Step 2 ID returned by the unexpired preview."
              },
              "csvContent": {
                "type": "object",
                "required": [
                  "download_url",
                  "file_id"
                ],
                "properties": {
                  "file_id": {
                    "type": "string",
                    "description": "ChatGPT attachment ID."
                  },
                  "file_name": {
                    "type": "string",
                    "description": "ChatGPT attachment filename."
                  },
                  "mime_type": {
                    "type": "string",
                    "description": "ChatGPT attachment MIME type."
                  },
                  "download_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "ChatGPT temporary HTTPS attachment URL."
                  }
                },
                "description": "Step 1 ChatGPT attachment; securely downloaded and decoded."
              },
              "paymentMethod": {
                "type": "string",
                "description": "Fallback payment rail only when absent from the parsed row."
              },
              "keepBothIndexes": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "Step 2 duplicate indexes the user explicitly approved keeping."
              },
              "selectedIndexes": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "description": "Step 2 preview row indexes to write; omit for all staged rows."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "preview"
                  ],
                  "properties": {
                    "preview": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "previewId",
                    "expiresAt",
                    "entryCount",
                    "entries",
                    "confirmationContract"
                  ]
                }
              },
              {
                "if": {
                  "required": [
                    "confirmed"
                  ],
                  "properties": {
                    "confirmed": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "previewId",
                    "written",
                    "deduped",
                    "failed",
                    "unattempted",
                    "total"
                  ]
                }
              }
            ],
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "deduped": {
                "type": "integer",
                "minimum": 0
              },
              "entries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "payer": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "boolean"
              },
              "success": {
                "type": "boolean"
              },
              "written": {
                "type": "integer",
                "minimum": 0
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confirmed": {
                "type": "boolean"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "previewId": {
                "type": "string"
              },
              "duplicates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "entryCount": {
                "type": "integer",
                "minimum": 0
              },
              "finalAnswer": {
                "type": "string"
              },
              "unattempted": {
                "type": "integer",
                "minimum": 0
              },
              "rejectedRows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "duplicateCount": {
                "type": "integer",
                "minimum": 0
              },
              "maxChatEntries": {
                "type": "integer",
                "minimum": 1
              },
              "refundRowCount": {
                "type": "integer",
                "minimum": 0
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reviewImportUrl": {
                "type": "string"
              },
              "reviewIncomeUrl": {
                "type": "string"
              },
              "tooLargeForChat": {
                "type": "boolean"
              },
              "expiresInMinutes": {
                "type": "integer",
                "minimum": 1
              },
              "idempotentReplay": {
                "type": "boolean"
              },
              "responseGuidance": {
                "type": "string"
              },
              "totalsByCurrency": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "projectionTruncated": {
                "type": "boolean"
              },
              "confirmationContract": {
                "type": "string"
              }
            }
          },
          "annotations": {
            "title": "Import income from a CSV/TSV/text export",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_accounting_integration_status",
          "description": "Read the owner's accounting connection/setup state, selected organization/company/business, rollout state and one connect/reconnect setupUrl. Pass an existing reportId to open that exact report's provider setup control; otherwise general Reports setup. Never posts data. Agent posting: Zoho Books only; QuickBooks Online, Xero, Wave and FreeAgent (beta) are connection/status only (writesAuthorized=false).",
          "inputSchema": {
            "type": "object",
            "required": [
              "provider"
            ],
            "properties": {
              "provider": {
                "enum": [
                  "zoho_books",
                  "quickbooks",
                  "xero",
                  "wave",
                  "freeagent"
                ],
                "type": "string",
                "description": "Accounting destination provider. QuickBooks Online, Xero, Wave, FreeAgent (beta), or Zoho Books."
              },
              "reportId": {
                "type": "string",
                "description": "Optional existing ExpenseBot report ID. When supplied, setupUrl opens this exact report and highlights the selected accounting provider's setup control."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object",
                "description": "Per-provider connection and rollout state."
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check accounting integration status",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "send_report_to_accounting",
          "description": "Preview then post an owner's report to accounting. Step 1: provider/reportId, optional mode/mappings, NO confirm. Reads live report/destination, enforces Omit/Personal/split/date/currency rules and Zoho bank-feed checks; returns complete frozen proposal + proposalId, posts nothing. Show complete proposal and ask approval. Step 2: ONLY provider/proposalId/confirm:true, never mappings. Revalidates live state and rejects changed reports/mappings; account-bound proposal only. No client acting. Agent posting: Zoho Books (zoho_books) only. QuickBooks Online/Xero/Wave/FreeAgent cannot yet freeze/revalidate shareReport plans; use their web flows.",
          "inputSchema": {
            "type": "object",
            "required": [
              "provider"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "auto",
                  "expense",
                  "bill"
                ],
                "type": "string",
                "description": "Step 1 only (Zoho Books): automatic document treatment, paid expenses, or bills."
              },
              "confirm": {
                "type": "boolean",
                "description": "Step 2 only: true posts the exact staged proposal. No other options may change."
              },
              "provider": {
                "enum": [
                  "zoho_books"
                ],
                "type": "string",
                "description": "Accounting destination provider. Agent-driven posting is currently available only for Zoho Books."
              },
              "reportId": {
                "type": "string",
                "description": "Step 1 only: ExpenseBot report ID owned by the signed-in account."
              },
              "proposalId": {
                "type": "string",
                "description": "Step 2 only: proposalId returned by the read-only preview."
              },
              "forceRepush": {
                "type": "boolean",
                "description": "Step 1 only: explicitly include disclosed uncertain prior outcomes in the frozen proposal."
              },
              "taxMappings": {
                "type": "object",
                "description": "Step 1 only: observed tax-rate string to live destination tax ID overrides.",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "accountMappings": {
                "type": "object",
                "description": "Step 1 only: ExpenseBot category to live destination account ID overrides.",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "reportingTagMappings": {
                "type": "object",
                "description": "Step 1 only: ExpenseBot tag to live destination reporting-tag option.",
                "additionalProperties": {
                  "type": "object",
                  "required": [
                    "tagId",
                    "optionId"
                  ],
                  "properties": {
                    "tagId": {
                      "type": "string",
                      "description": "Live accounting-provider reporting-tag ID returned in the step-1 proposal."
                    },
                    "optionId": {
                      "type": "string",
                      "description": "Live option ID belonging to tagId, returned in the step-1 proposal."
                    }
                  }
                }
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "phase"
                  ],
                  "properties": {
                    "phase": {
                      "const": "preview"
                    }
                  }
                },
                "then": {
                  "required": [
                    "expiresAt",
                    "confirmationRequired",
                    "confirmationQuestion",
                    "confirmationContract"
                  ]
                }
              },
              {
                "if": {
                  "required": [
                    "phase"
                  ],
                  "properties": {
                    "phase": {
                      "const": "completed"
                    }
                  }
                },
                "then": {
                  "required": [
                    "reportId",
                    "finalAnswer",
                    "responseGuidance"
                  ]
                }
              }
            ],
            "required": [
              "success",
              "phase",
              "provider",
              "proposalId"
            ],
            "properties": {
              "phase": {
                "enum": [
                  "preview",
                  "completed"
                ],
                "type": "string"
              },
              "units": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "counts": {
                "type": "object",
                "additionalProperties": true
              },
              "created": {
                "type": "integer",
                "minimum": 0
              },
              "success": {
                "type": "boolean"
              },
              "provider": {
                "type": "string"
              },
              "reportId": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "proposalId": {
                "type": "string"
              },
              "finalAnswer": {
                "type": "string"
              },
              "organization": {
                "type": "object",
                "additionalProperties": true
              },
              "matchedExisting": {
                "type": "integer",
                "minimum": 0
              },
              "omittedExpenses": {
                "type": "integer",
                "minimum": 0
              },
              "idempotentReplay": {
                "type": "boolean"
              },
              "responseGuidance": {
                "type": "string"
              },
              "confirmationContract": {
                "type": "string"
              },
              "confirmationQuestion": {
                "type": "string"
              },
              "confirmationRequired": {
                "type": "boolean"
              },
              "skippedAlreadyPushed": {
                "type": "integer",
                "minimum": 0
              },
              "reconciliationRequired": {
                "type": "boolean"
              }
            }
          },
          "annotations": {
            "title": "Review and send report to accounting",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_accounting_push_status",
          "description": "Read the authoritative posting and reconciliation status for one ExpenseBot report at an accounting destination. Use after a timeout or uncertain response before considering any retry. Returns status, submission time, posting mode, posted receipt count, any public error, and whether reconciliation is required. Never re-post a completed report or a report marked needs_reconciliation; show that state to the owner instead. This tool is read-only and owner-account only.",
          "inputSchema": {
            "type": "object",
            "required": [
              "provider",
              "reportId"
            ],
            "properties": {
              "provider": {
                "enum": [
                  "zoho_books",
                  "quickbooks",
                  "xero",
                  "wave",
                  "freeagent"
                ],
                "type": "string",
                "description": "Accounting destination provider used for the prior posting attempt."
              },
              "reportId": {
                "type": "string",
                "description": "Exact ExpenseBot report ID from the prior proposal or posting attempt."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check accounting push status",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_categories",
          "description": "List the user's configured expense categories and billing accounts. Use this BEFORE calling tools that need a category (add_cash_expense, add_mileage_entry, create_report) so you pass the user's actual category names, not guesses. Returns the live list from their spreadsheet.",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "categories"
            ],
            "properties": {
              "success": {
                "type": "boolean"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Expense categories for the user."
              },
              "billingAccounts": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Billing/card accounts, when configured."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List expense categories",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_tags",
          "description": "List the user's configured groups. ExpenseBot stores clients, projects, project codes, properties, and trips as tags (for example 'Client: Acme', 'Vegas Trip', or 'Property: 123 Main'). Use this when the user asks 'what groups/projects/clients do I have?' and before filtering, grouping, or reporting when the intended existing name is unclear.",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "tags"
            ],
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Client / project / trip groups (Column K values)."
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List tags",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "create_tag",
          "description": "Create a standalone group/tag without selecting or changing any expenses. The first call prepares a preview; after the user explicitly chooses to create it, send confirm:true with the returned operationId (fresh duplicate checks run). A first call with confirm:true still returns a preview. An exact canonical duplicate is a no-op; archived tags are not reactivated. Similar names are returned as choices; set allowSimilar:true only when the user explicitly chooses a distinct new group despite them. Use list_tags to inspect all groups.",
          "inputSchema": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the new group/tag."
              },
              "status": {
                "type": "boolean",
                "default": false,
                "description": "When true, read the verified outcome for operationId without creating or changing a tag."
              },
              "confirm": {
                "type": "boolean",
                "default": false,
                "description": "Confirm only after the user approves the preview; a first confirm call remains preview-only."
              },
              "operationId": {
                "type": "string",
                "description": "Server-issued preview operation ID to confirm a staged create."
              },
              "allowSimilar": {
                "type": "boolean",
                "default": false,
                "description": "Allow creation alongside similar names only when the user explicitly chooses a new distinct group."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "error": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "choices": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "created": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "retryable": {
                "type": "boolean"
              },
              "existingTag": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "operationId": {
                "type": "string"
              },
              "similarTags": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "confirmation": {
                "type": "object"
              },
              "existingTags": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "previewStale": {
                "type": "boolean"
              },
              "canonicalName": {
                "type": "string"
              },
              "requestedName": {
                "type": "string"
              },
              "existingMatches": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "outcomeVerified": {
                "type": "boolean"
              },
              "existingTagCount": {
                "type": "integer"
              },
              "groupManagementUrl": {
                "type": "string"
              },
              "confirmationRequired": {
                "type": "boolean"
              },
              "requiresConfirmation": {
                "type": "boolean"
              },
              "existingTagsTruncated": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Create a group/tag",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_income_summary",
          "description": "Use this when the user asks about income already recorded in their ExpenseBot Income tab. Read totals; group by source, category, month, payment method or tag; filter by dateRange/incomeTagPrefix. Query supports period comparisons (e.g. 'income YTD by source', 'income this year vs last'). Returns message and data with total and optional breakdown, comparison, sampleMeta. No scanning, imports, mutations, tax returns or liability determination.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Natural language income question (e.g., 'income YTD by source', 'rental income last month')"
              },
              "groupBy": {
                "enum": [
                  "source",
                  "category",
                  "month",
                  "paymentMethod",
                  "tag"
                ],
                "type": "string",
                "description": "How to group the breakdown"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "incomeTagPrefix": {
                "type": "string",
                "description": "Optional tag prefix (e.g. 'Prop –', 'Client –'); filters to income rows tagged with it."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Inline analytics; null without sheet/data."
              },
              "type": {
                "type": "string",
                "description": "Async analytics_pending: poll pollEndpoint/poll_analytics(jobId)."
              },
              "jobId": {
                "type": "string",
                "description": "Async branch only."
              },
              "message": {
                "type": "string",
                "description": "Narrative."
              },
              "success": {
                "type": "boolean",
                "description": "Async branch only."
              },
              "response": {
                "type": "string",
                "description": "Chat alias of message."
              },
              "pollEndpoint": {
                "type": "string",
                "description": "Async branch only."
              },
              "pollInterval": {
                "type": "number",
                "description": "Async: milliseconds."
              },
              "estimatedTime": {
                "type": "number",
                "description": "Async: seconds."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get income summary",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_pnl",
          "description": "Compute Profit & Loss (P&L / net income / margin) by combining the Income tab with expense tabs. Examples: 'am I profitable this year', 'P&L for Q1', 'net income last quarter', 'what's my margin', 'P&L this year vs last' (YoY). Supports period comparison — YoY, MoM, QoQ, same-month-prev-year. Margin shows as a multiplier in loss (e.g. 'expenses 5.4x revenue'). Returns: { message, data: { revenue, expenses, netIncome, margin, comparison?, sampleMeta? } }.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Natural language P&L question (e.g., 'P&L for Q1 2025', 'am I profitable')"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Inline analytics; null without sheet/data."
              },
              "type": {
                "type": "string",
                "description": "Async analytics_pending: poll pollEndpoint/poll_analytics(jobId)."
              },
              "jobId": {
                "type": "string",
                "description": "Async branch only."
              },
              "message": {
                "type": "string",
                "description": "Narrative."
              },
              "success": {
                "type": "boolean",
                "description": "Async branch only."
              },
              "response": {
                "type": "string",
                "description": "Chat alias of message."
              },
              "pollEndpoint": {
                "type": "string",
                "description": "Async branch only."
              },
              "pollInterval": {
                "type": "number",
                "description": "Async: milliseconds."
              },
              "estimatedTime": {
                "type": "number",
                "description": "Async: seconds."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get profit & loss",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_per_tag_pnl",
          "description": "Per-tag P&L — revenue, cost, profit, and margin grouped by tag (per-client, per-property, per-event, per-realtor-deal). Requires both income AND expense rows to be tagged with matching labels. Examples: 'per-tag P&L this year', 'profit by client', 'profit by property', 'profit on the Smith wedding', 'per-client P&L this year vs last' (YoY). Supports YoY / MoM / QoQ comparison phrasing. Margin renders as multiplier in loss territory. Defaults to year-to-date if no date range given.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Natural language per-tag P&L question"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              },
              "tagPrefix": {
                "type": "string",
                "description": "Optional prefix to limit which tags are bucketed (e.g., 'Prop –' for properties only, 'Client –' for clients only). When omitted, all tags are included."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Inline analytics; null without sheet/data."
              },
              "type": {
                "type": "string",
                "description": "Async analytics_pending: poll pollEndpoint/poll_analytics(jobId)."
              },
              "jobId": {
                "type": "string",
                "description": "Async branch only."
              },
              "message": {
                "type": "string",
                "description": "Narrative."
              },
              "success": {
                "type": "boolean",
                "description": "Async branch only."
              },
              "response": {
                "type": "string",
                "description": "Chat alias of message."
              },
              "pollEndpoint": {
                "type": "string",
                "description": "Async branch only."
              },
              "pollInterval": {
                "type": "number",
                "description": "Async: milliseconds."
              },
              "estimatedTime": {
                "type": "number",
                "description": "Async: seconds."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get per-tag profit & loss",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_income_categories",
          "description": "List ExpenseBot's fixed income tax categories. Unlike Expense Accounts, these are not user-configured. Use this BEFORE calling add_income so you pass an exact canonical category instead of guessing.",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "categories"
            ],
            "properties": {
              "notes": {
                "type": "string"
              },
              "legacy": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Deprecated income categories still accepted on read."
              },
              "success": {
                "type": "boolean"
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List income categories",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_recent_activity",
          "description": "Read recent MCP assistant tool calls: tool, time, arguments and success, not document processing history. Use for 'what did I do this week' or 'which tools has my assistant run'. Returns audit entries, default 20, max 100.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1
              },
              "actionId": {
                "type": "string",
                "description": "Optional: filter to a single tool/action name"
              },
              "sinceDays": {
                "type": "integer",
                "default": 7,
                "description": "Only show actions from the last N days (default 7)"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "count",
              "actions"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Show recent AI activity",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "trace_document",
          "description": "Read a receipt/invoice/forwarded email/Gmail receipt/PDF's lineage timeline: missing, skipped, income-routed, deduped or duplicate-removed documents. Not Gmail scan-job status/progress/completion (running/queued/finished/stuck): use get_scan_status; a scan is not a document.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "days": {
                "type": "integer",
                "default": 30,
                "maximum": 180,
                "minimum": 1,
                "description": "How many days back to search."
              },
              "limit": {
                "type": "integer",
                "default": 80,
                "maximum": 250,
                "minimum": 1,
                "description": "Maximum lineage events to return."
              },
              "query": {
                "type": "string",
                "description": "Merchant, sender, subject, invoice number, or phrase to search for, e.g. 'Blue Rocket', 'Driversnote', 'Uber receipt'."
              },
              "outcome": {
                "enum": [
                  "all",
                  "created",
                  "skipped",
                  "suggested",
                  "income_routed",
                  "deduped",
                  "removed_as_duplicate"
                ],
                "type": "string",
                "default": "all",
                "description": "Optional processing outcome filter."
              },
              "threadId": {
                "type": "string",
                "description": "Gmail thread ID if known."
              },
              "messageId": {
                "type": "string",
                "description": "Gmail message ID if known."
              },
              "receiptId": {
                "type": "string",
                "description": "ExpenseBot receipt/invoice ID if known, e.g. IR-123, RO-abc, RR-456."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "type",
              "message",
              "data"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "type": {
                "type": "string",
                "const": "lineage_trace"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Trace what happened to a receipt or invoice",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_mileage_summary",
          "description": "Recorded mileage expenses and Trip Log distances, with month/client/purpose/category breakdowns and date ranges. Expense amounts are not tax-deductibility determinations.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Mileage query."
              },
              "groupBy": {
                "enum": [
                  "month",
                  "tag",
                  "purpose",
                  "category"
                ],
                "type": "string",
                "description": "Grouping."
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean",
                "description": "Present only on the error branch (out of scope) / async path."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get mileage summary",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_subscription_audit",
          "description": "Find recurring subscriptions, duplicate charges, price increases and trial-conversion suspects in recorded expenses, optionally by cost (e.g. over $20/month). Returns message/data with recurring, duplicates, priceIncreases, trialConversions, totalMonthlyCost and sampleMeta.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "focus": {
                "enum": [
                  "recurring",
                  "duplicates",
                  "price_increases",
                  "trial_conversions",
                  "all"
                ],
                "type": "string",
                "description": "Narrow the audit to a single category (default: all)"
              },
              "query": {
                "type": "string",
                "description": "Natural language subscription question (e.g., 'find duplicate subscriptions', 'price increases this year')"
              },
              "dateRange": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Month",
                    "required": [
                      "type",
                      "month",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "month"
                      },
                      "year": {
                        "type": "integer",
                        "description": "Four-digit year."
                      },
                      "month": {
                        "type": "string",
                        "description": "Month name or 1–12."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Quarter",
                    "required": [
                      "type",
                      "quarter",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "quarter"
                      },
                      "year": {
                        "type": "integer"
                      },
                      "quarter": {
                        "type": "integer",
                        "maximum": 4,
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Year",
                    "required": [
                      "type",
                      "year"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "year"
                      },
                      "year": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Date range",
                    "required": [
                      "type",
                      "start",
                      "end"
                    ],
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      },
                      "type": {
                        "type": "string",
                        "const": "specific"
                      },
                      "start": {
                        "type": "string",
                        "format": "date",
                        "description": "YYYY-MM-DD, inclusive"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "title": "Relative period",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "relative"
                      },
                      "value": {
                        "type": "string",
                        "description": "E.g. 'last month', 'YTD', 'last 7 days'."
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "description": "Match the user's period."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean",
                "description": "Present only on the error branch (out of scope) / async path."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Audit subscriptions",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_expense_by_id",
          "description": "Read one existing expense from the authenticated user's ExpenseBot spreadsheet. Supply the exact expenseId returned by search_expenses (Receipt ID in Column Q), or the user's specified rowNumber. Never invent an identifier. Returns sheetName, rowNumber, headers, values, labeled fields, receipt_url (null if absent), and reviewExpenseUrl. It does not edit, submit, delete, share, or scan anything. Also returns Paid with context (unavailable differs from blank) and typed bookkeeping paymentStatus, never bank settlement proof.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "expenseId": {
                "type": "string",
                "description": "Exact full ExpenseBot Receipt ID from Column Q"
              },
              "rowNumber": {
                "type": "integer",
                "minimum": 2,
                "description": "1-indexed sheet row (row 1 is headers, so ≥ 2)"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "values": {
                "type": "array",
                "items": {}
              },
              "headers": {
                "type": "array",
                "items": {}
              },
              "labeled": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "paidWith": {
                "type": "object"
              },
              "rowNumber": {
                "type": "integer",
                "description": "Resolved sheet row for the expense."
              },
              "sheetName": {
                "type": "string"
              },
              "expense_id": {
                "type": "string"
              },
              "receipt_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "paymentStatus": {
                "type": "object"
              },
              "reviewExpenseUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get expense by ID",
            "readOnlyHint": true,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "export_report",
          "description": "Get a short-lived direct PDF download for one exact authorized expense report, plus the exact highlighted in-app report link. Use the in-app report for CSV, XLSX, receipt ZIP (when available), comments, invoicing, and other visually reviewed actions. Use list_reports first to find the reportId.",
          "inputSchema": {
            "type": "object",
            "required": [
              "reportId"
            ],
            "properties": {
              "reportId": {
                "type": "string",
                "description": "Report ID from list_reports"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "report",
              "urls",
              "expiresAt",
              "availableInReport",
              "notes"
            ],
            "properties": {
              "urls": {
                "type": "object"
              },
              "notes": {
                "type": "string"
              },
              "report": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "expiresAt": {
                "type": "string"
              },
              "availableInReport": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get report export URLs",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_spreadsheet_url",
          "description": "Return the master Google Sheet and authenticated workspace links, including Year-End. Show only 1–2 relevant links. Open spreadsheet: Sheet. Receipt added: Review expenses + Sheet; income added: Review income + Sheet. Receipts needing review: reviewReceiptsUrl. Held upload: use its Review files link. Gmail scan/connection: Scan Gmail. Bank/card: Reconcile. Configuration: Automation Hub/General Settings. Category/G/L/account codes: Category management. Client/project/trip groups: Group management. Personal classification: Personal rules. Client billing: use returned clientBillingHandoffs: manageClients, tagReadyExpenses, createClientReport. Named client grouping: search_expenses then group_expenses. Google Photos: authenticated picker with consent. Receipt storage: returned Drive folder only; never invent a folder ID. Complete unambiguous cash expense/mileage: direct write tool. Multiple/incomplete expenses, credits/refunds, tax/tip/per diem or visual review: Manual expense. Route/repeated/calendar/rideshare mileage, per diem or review: Mileage and travel. Income file without chat attachment or complex review: Import income (previews every row). Team setup: role-aware handoff; explain owner-access requirements. Complex reports: Create report. Read-only; no row changes.",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "spreadsheetId",
              "spreadsheetUrl",
              "reviewExpensesUrl",
              "reviewIncomeUrl",
              "gmailScanUrl",
              "gmailActionNeededUrl",
              "reportsUrl",
              "dashboardUrl",
              "data",
              "message"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean",
                "const": true
              },
              "reportsUrl": {
                "type": "string"
              },
              "yearEndUrl": {
                "type": "string",
                "description": "Authenticated Year-End screen link."
              },
              "dashboardUrl": {
                "type": "string"
              },
              "gmailScanUrl": {
                "type": "string"
              },
              "spreadsheetId": {
                "type": "string"
              },
              "spreadsheetUrl": {
                "type": "string"
              },
              "reviewIncomeUrl": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              },
              "reviewReceiptsUrl": {
                "type": "string"
              },
              "gmailActionNeededUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Open ExpenseBot workspace links",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "check_feature",
          "description": "Check whether ExpenseBot supports a specific feature ('does ExpenseBot support X', 'can it integrate with Y'). Searches the public knowledge base and returns a confidence-scored answer + related questions. Works with or without authentication.",
          "inputSchema": {
            "type": "object",
            "required": [
              "feature"
            ],
            "properties": {
              "feature": {
                "type": "string",
                "description": "Feature or integration to check (e.g., 'Xero', 'mileage tracking', 'Plaid')"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check ExpenseBot feature",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "whatif_afford",
          "description": "Can I afford $X/month? Recomputes the user's Safe Monthly Draw (how much they can safely pay themselves) with an added recurring monthly cost, and returns a yes/tight/no verdict plus the before/after numbers. Use for questions like 'can I afford a $500/mo hire' or 'what if I add a $200/mo software subscription'. Requires at least 3 months of income history — otherwise returns insufficient_data rather than a guess.",
          "inputSchema": {
            "type": "object",
            "required": [
              "deltaMonthly"
            ],
            "properties": {
              "deltaMonthly": {
                "type": "number",
                "minimum": 0,
                "description": "The new recurring monthly cost being considered, in the user's home currency"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object",
                "description": "Scenario assumptions, evidence and outcome."
              },
              "message": {
                "type": "string",
                "description": "Narrative; absent without template/evidence."
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "What-if: can I afford this?",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "whatif_client",
          "description": "What if a client pays late or leaves? mode='late30' shifts that client's OPEN invoice amounts out of the near-term expectation mode='gone' removes that client's trailing monthly income contribution and recomputes Safe Draw against the reduced baseline. Use for questions like 'what if Acme Corp pays 30 days late' or 'what happens if I lose my biggest client'. Client identity is matched against the Income tab's tag/source/description fields — best effort, not a guaranteed match.",
          "inputSchema": {
            "type": "object",
            "required": [
              "clientName",
              "mode"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "late30",
                  "gone"
                ],
                "type": "string",
                "description": "'late30' = shift open invoices 30 days late; 'gone' = client stops paying entirely"
              },
              "clientName": {
                "type": "string",
                "description": "The client's name as it appears on invoices or income rows"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object",
                "description": "Scenario assumptions, evidence and outcome."
              },
              "message": {
                "type": "string",
                "description": "Narrative; absent without template/evidence."
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "What-if: client pays late or leaves",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "whatif_tax_setaside",
          "description": "What should I set aside for taxes? Returns the monthly tax set-aside estimate already computed for Safe Monthly Draw. Flat-rate estimate (default 30%) against trailing income minus recurring + variable spend. Use for 'how much should I set aside for taxes this month'.",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object",
                "description": "Scenario assumptions, evidence and outcome."
              },
              "message": {
                "type": "string",
                "description": "Narrative; absent without template/evidence."
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "What-if: tax set-aside",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "scan_gmail_years",
          "description": "For Outlook periods, set provider:outlook for the review screen; no scan starts. Scan completed Gmail periods for receipts. In eligible split-tax-year accounts, a number is the period's ending year (2025 = 2024–25 tax year); otherwise it is a calendar year. Use returned tax-period labels and inclusive ISO bounds. Long-running: the first eligible period starts immediately; the rest queue one at a time (each full period typically takes hours; the app may close). Preview without confirmStart (no scan starts), ask the user to confirm, then start with confirmStart:true. For recent receipts (~60 days), use scan_gmail. The in-progress period cannot be year-scanned; use get_scan_status for progress.",
          "inputSchema": {
            "type": "object",
            "required": [
              "years"
            ],
            "properties": {
              "years": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "description": "Completed periods; ending year for eligible tax-year accounts (2025 = 2024–25), calendar year otherwise. Max 10."
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string",
                "description": "Default Gmail."
              },
              "accountEmail": {
                "type": "string",
                "description": "Connected mailbox email. Gmail defaults to primary."
              },
              "confirmStart": {
                "type": "boolean",
                "description": "Omit or false = preview only (no scan starts). Must be exactly true to start scanning."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "allOf": [
              {
                "if": {
                  "required": [
                    "preview"
                  ],
                  "properties": {
                    "preview": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "account",
                    "eligible",
                    "alreadyScanned",
                    "notEligible"
                  ]
                }
              }
            ],
            "required": [
              "success",
              "message"
            ],
            "properties": {
              "account": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "boolean"
              },
              "success": {
                "type": "boolean"
              },
              "eligible": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "gmailUrl": {
                "type": "string"
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string"
              },
              "scanning": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "notEligible": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "year",
                    "reason"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "year": {
                      "type": "integer"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "queuedYears": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "startedYear": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "alreadyQueued": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "scanInitiated": {
                "type": "boolean"
              },
              "alreadyScanned": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "archiveThroughYear": {
                "type": "integer"
              }
            }
          },
          "annotations": {
            "title": "Scan past years of Gmail",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_scan_status",
          "description": "Check authoritative scan status; defaults to Gmail. For Outlook.com or Microsoft 365 use provider:outlook for connections, mailbox status or an exact jobId. Start scans in ExpenseBot. Gmail returns the active lock, live phase/progress, queued or attention-needed periods, completed calendar years, tax-period statuses with their returned labels and inclusive ISO bounds, exclusions and recent outcomes. Use when asked if a scan is running, finished, stuck, or what it is doing. On completion show spreadsheetUrl or reviewExpensesUrl; for setup/reconnection show gmailScanUrl. Read-only.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "jobId": {
                "type": "string",
                "description": "Optional exact Outlook historical job ID, never guessed."
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string",
                "description": "Default Gmail."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "job": {
                "type": "object"
              },
              "data": {
                "type": "object"
              },
              "lock": {
                "type": "object",
                "description": "Scan-lock state (active, startedAt, ageSeconds, dispatchComplete, pendingProcessingCount)."
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Scan lifecycle state."
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "accounts": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "coverage": {
                "type": "string"
              },
              "provider": {
                "enum": [
                  "gmail",
                  "outlook"
                ],
                "type": "string"
              },
              "latestScan": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Most recent scan outcome (success, emailsFound, emailsTagged, timestamp)."
              },
              "gmailScanUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scanInitiated": {
                "type": "boolean"
              },
              "scanInProgress": {
                "type": "boolean"
              },
              "spreadsheetUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scanWorkspaceUrl": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "outlookSettingsUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check Gmail or Outlook scan status",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_statement_import_status",
          "description": "Check 'Did my statement finish importing?' for at most five jobs. Returns status and authenticated review link. Extraction isn't saved; read/save jobs may overlap, so counts aren't statement totals. No job found doesn't prove no import; older non-job imports are excluded. Read-only: never uploads, parses, saves, retries, or recovers.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "status",
              "availability",
              "imports",
              "links",
              "limitations"
            ],
            "properties": {
              "links": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "imports": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "success": {
                "type": "boolean"
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "availability": {
                "enum": [
                  "unavailable",
                  "partial",
                  "available"
                ],
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check statement import status",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_client_invoices",
          "description": "List the user's issued client invoices (accounts receivable) — who owes them money, how much, and when it is due. Examples: 'which invoices are outstanding', 'what does Acme still owe me', 'any overdue invoices', 'how much am I waiting to get paid'. status accepts 'active' (default), 'open', 'overdue', 'needs_review', 'paid', 'void', 'superseded', or 'all'. Returns invoice numbers, status, totals by currency, delivery state, and private document links. Read-only.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "number",
                "description": "Max invoices to return (default 25, max 100)."
              },
              "status": {
                "enum": [
                  "active",
                  "open",
                  "overdue",
                  "needs_review",
                  "paid",
                  "void",
                  "superseded",
                  "all"
                ],
                "type": "string",
                "description": "Filter by invoice status (default active/outstanding)."
              },
              "clientName": {
                "type": "string",
                "description": "Optional: exact client name (case-insensitive)."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "invoices"
            ],
            "properties": {
              "success": {
                "type": "boolean"
              },
              "invoices": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List client invoices (AR)",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_client_invoice",
          "description": "Get the full financial and delivery summary for one issued client invoice, including subtotal, markup, tax, advance applied, balance due, dates, status, source report, and private Google Doc/PDF/DOCX links when available. Provide invoiceId or invoiceNumber — one is required; invoiceNumber is accepted only when it is unique. Read-only.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "invoiceId": {
                "type": "string",
                "description": "Stable invoice ID from list_client_invoices. Required unless invoiceNumber is supplied."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              },
              "invoiceNumber": {
                "type": "string",
                "description": "Human invoice number when invoiceId is unavailable; it must identify one unique invoice."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "invoice": {
                "type": "object",
                "description": "The invoice record. Absent only on the error branch (not-found), which never carries structuredContent."
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Get client invoice details",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "prepare_client_invoice",
          "description": "Prepare a client invoice from a saved ExpenseBot report without creating it. Reads canonical report rows, allocates a unique invoice number, verifies the client ledger identity and advance, and returns exact totals plus a short-lived preparationId. Call this first, show the preview to the user, then call create_client_invoice after explicit confirmation. It reserves the invoice number and preview for 30 minutes but creates no invoice, document, Income row, email, or payment.",
          "inputSchema": {
            "type": "object",
            "required": [
              "reportId",
              "clientName",
              "issueDate"
            ],
            "properties": {
              "taxPct": {
                "type": "number",
                "maximum": 100,
                "minimum": 0,
                "description": "Tax percentage applied after markup and custom line items; use 0 for no tax."
              },
              "reportId": {
                "type": "string",
                "description": "Saved ExpenseBot report ID to invoice."
              },
              "taxLabel": {
                "type": "string",
                "description": "Tax label such as HST, GST, or VAT."
              },
              "issueDate": {
                "type": "string",
                "format": "date",
                "description": "Calendar-valid invoice date in YYYY-MM-DD format."
              },
              "markupPct": {
                "type": "number",
                "maximum": 100,
                "minimum": 0,
                "description": "Markup applied only to rebilled expense rows."
              },
              "clientName": {
                "type": "string",
                "description": "Full client or business name shown on the invoice."
              },
              "receiptIds": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Optional exact report receipt IDs. Defaults to every current report expense."
              },
              "billToEmail": {
                "type": "string",
                "description": "Optional client email printed on the invoice. This does not send email."
              },
              "paymentTerms": {
                "enum": [
                  "due_on_receipt",
                  "net7",
                  "net14",
                  "net15",
                  "net30",
                  "net45",
                  "net60"
                ],
                "type": "string",
                "description": "Invoice due terms. Defaults to the client's billing profile or net30."
              },
              "clientAddress": {
                "type": "string",
                "description": "Optional billing address printed in the invoice's Bill To section."
              },
              "invoiceNumber": {
                "type": "string",
                "description": "Optional custom invoice number. ExpenseBot allocates one when omitted."
              },
              "advanceApplied": {
                "type": "number",
                "minimum": 0,
                "description": "Verified client advance to apply against this invoice."
              },
              "customLineItems": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "description",
                    "amount"
                  ],
                  "properties": {
                    "amount": {
                      "type": "number",
                      "description": "Positive amount for this fee or service line in the invoice currency.",
                      "exclusiveMinimum": 0
                    },
                    "description": {
                      "type": "string",
                      "description": "User-approved fee or service description shown on the invoice."
                    }
                  }
                },
                "maxItems": 25,
                "description": "Optional fee/service lines. They are taxed but never marked up."
              },
              "mentionSupportingReceipts": {
                "type": "boolean",
                "description": "When true, note on the invoice that supporting receipts are available."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "preparationId",
              "expiresAt",
              "preview"
            ],
            "properties": {
              "preview": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "expiresAt": {
                "type": "string"
              },
              "preparationId": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Prepare client invoice",
            "readOnlyHint": false,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "create_client_invoice",
          "description": "Create the exact invoice previously returned by prepare_client_invoice. This is a confirmed write: it revalidates the report snapshot and client identity, creates a private editable Google Doc plus private PDF and DOCX copies, records the issued invoice, and supersedes an older active invoice for the same report. It does not send email or create an Income row. If tax is positive, confirmTax must be true.",
          "inputSchema": {
            "type": "object",
            "required": [
              "preparationId"
            ],
            "properties": {
              "confirmTax": {
                "type": "boolean",
                "description": "True only after the user confirms the displayed tax label and rate."
              },
              "operationId": {
                "type": "string",
                "description": "Optional retry key. Reuse it after an uncertain response."
              },
              "preparationId": {
                "type": "string",
                "description": "Short-lived ID returned by prepare_client_invoice."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "total": {
                "type": "number"
              },
              "pdfUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "docxUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "dueDate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "success": {
                "type": "boolean"
              },
              "currency": {
                "type": "string"
              },
              "invoiceId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "issueDate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recovered": {
                "type": "boolean"
              },
              "clientName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "grandTotal": {
                "type": "number"
              },
              "documentUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "invoiceNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "advanceApplied": {
                "type": "number"
              },
              "sourceReportId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "artifactWarning": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Create client invoice",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "mark_client_invoice_paid",
          "description": "Mark an issued client invoice as paid after explicit confirmation. Requires a strict calendar-valid paidDate in YYYY-MM-DD format. This updates the accounts-receivable invoice record only; it never creates or moves an Income row. Record the actual payment separately or link an existing Income row.",
          "inputSchema": {
            "type": "object",
            "required": [
              "invoiceId",
              "paidDate"
            ],
            "properties": {
              "paidVia": {
                "type": "string",
                "description": "Optional payment method or source, such as bank transfer or check."
              },
              "paidDate": {
                "type": "string",
                "format": "date",
                "description": "Calendar-valid payment date in YYYY-MM-DD format."
              },
              "invoiceId": {
                "type": "string",
                "description": "Stable invoice ID from list_client_invoices."
              },
              "paidAmount": {
                "type": "number",
                "minimum": 0,
                "description": "Optional amount received."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "invoiceId",
              "status",
              "paidDate",
              "paidAmount",
              "paidVia",
              "incomeRowCreated",
              "message"
            ],
            "properties": {
              "status": {
                "type": "string",
                "const": "paid"
              },
              "message": {
                "type": "string"
              },
              "paidVia": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "paidDate": {
                "type": "string"
              },
              "invoiceId": {
                "type": "string"
              },
              "paidAmount": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "invoiceNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "incomeRowCreated": {
                "type": "boolean",
                "const": false
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Mark client invoice paid",
            "readOnlyHint": false,
            "openWorldHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "get_expense_splits",
          "description": "Read a payment's category/client/property/business-personal allocation. Returns one parent with nested split lines; never count split lines as separate expenses. Use for 'how is this expense split' or 'business portion'. Edit splits in ExpenseBot Review workspace.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "number",
                "description": "Max parent expenses to return (default 25, max 100)."
              },
              "dateRange": {
                "type": "object",
                "properties": {
                  "endDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Inclusive end date in YYYY-MM-DD format."
                  },
                  "startDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Inclusive start date in YYYY-MM-DD format."
                  }
                },
                "description": "Optional open-ended or closed window to search for split expenses. Supply startDate, endDate, or both; supplied bounds are inclusive YYYY-MM-DD dates.",
                "additionalProperties": false
              },
              "onlySplit": {
                "type": "boolean",
                "description": "Return only expenses with active splits (default true). Set false to inspect an unsplit Receipt ID."
              },
              "receiptId": {
                "type": "string",
                "description": "Optional Receipt ID for one expense."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "splits": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "View expense splits",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_monthly_books_review",
          "description": "Review one calendar month's recorded income, spending, net, top categories/merchants and unusual alerts ('monthly review', 'how did last month go', 'what did I make and spend'). Defaults to last completed month. Advisory estimates are not tax advice. closeReadiness gives recorded-book checks/Action Needed links; explain unknown coverage/limits. Never closes books or certifies tax completeness.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "period": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$",
                "description": "Calendar month in YYYY-MM format. Defaults to the last completed month."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "closeReadiness": {
                "type": "object"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Review monthly books",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_client_close_readiness",
          "description": "Accountant-only month-end overview of accepted client workspaces. Returns page-level readiness and affected-client category counts with an authenticated Client Reports link. Use for 'how many clients need attention before month end'. No client identities, amounts, or individual items are returned; select a client in ExpenseBot to resolve items. Unavailable sources remain unknown. Each page uses the current roster; do not combine pages into a verified total.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "page": {
                "type": "integer",
                "maximum": 100,
                "minimum": 1,
                "description": "Page number; starts at 1. Use nextPage from the previous result."
              },
              "limit": {
                "type": "integer",
                "maximum": 5,
                "minimum": 1,
                "description": "Client workspaces per page; default and maximum 5."
              },
              "period": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$",
                "description": "Calendar month YYYY-MM; defaults to the last completed UTC month."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "period",
              "asOf",
              "scope",
              "coverage",
              "statusCounts",
              "evaluatedClientCount",
              "unavailableCandidateCount",
              "categories",
              "pageInfo",
              "links",
              "limitations",
              "message"
            ],
            "properties": {
              "asOf": {
                "type": "string"
              },
              "links": {
                "type": "object",
                "required": [
                  "clients"
                ],
                "properties": {
                  "clients": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "scope": {
                "enum": [
                  "page"
                ],
                "type": "string"
              },
              "period": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "coverage": {
                "enum": [
                  "complete_page",
                  "incomplete_page"
                ],
                "type": "string"
              },
              "pageInfo": {
                "type": "object",
                "required": [
                  "page",
                  "limit",
                  "hasMore",
                  "nextPage"
                ],
                "properties": {
                  "page": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "limit": {
                    "type": "integer",
                    "maximum": 5,
                    "minimum": 1
                  },
                  "hasMore": {
                    "type": "boolean"
                  },
                  "nextPage": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  }
                },
                "additionalProperties": false
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "code",
                    "label",
                    "affectedClientCount",
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "affectedClientCount": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "statusCounts": {
                "type": "object",
                "required": [
                  "ready",
                  "needs_action",
                  "blocked",
                  "unknown"
                ],
                "properties": {
                  "ready": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "blocked": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "unknown": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "needs_action": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "evaluatedClientCount": {
                "type": "integer",
                "minimum": 0
              },
              "unavailableCandidateCount": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "annotations": {
            "title": "Review client close readiness",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_credits_refunds",
          "description": "List card refunds, cashback/rewards, and statement credits that ExpenseBot has already recorded — either as negative expenses or matched against the original charge. Examples: 'did my refund come through', 'show my statement credits', 'was that return recorded'. Returns the most recent items (default 25, newest first); narrow with dateRange. Read-only: it never scans cards, changes review decisions, or adds rows.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "number",
                "description": "Maximum results to return (default 25, max 100)."
              },
              "dateRange": {
                "type": "object",
                "properties": {
                  "endDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Inclusive end date in YYYY-MM-DD format."
                  },
                  "startDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Inclusive start date in YYYY-MM-DD format."
                  }
                },
                "description": "Optional open-ended or closed window to narrow results. Supply startDate, endDate, or both; supplied bounds are inclusive YYYY-MM-DD dates.",
                "additionalProperties": false
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "credits": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "message": {
                "type": "string"
              },
              "refunds": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "success": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "List recorded credits and refunds",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_client_advance_balances",
          "description": "Read the same per-client advance balances shown in ExpenseBot's Client advances section. Use for questions like 'how much of Acme's advance remains?', 'which client floats are still open?', or 'do I owe a client a refund?'. A negative ledger balance means money remains to refund; a positive balance means the client owes the user. Returns the existing app handoff for Refund leftover or Bill Client. Read-only: never records a refund, creates an invoice, or recomputes the ledger in model prose.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "clientName": {
                "type": "string",
                "description": "Optional client name or canonical Client tag. Omit to list every open balance backed by a recorded client advance."
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "balances": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "homeCurrency": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Check client advance balances",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "get_trip_suggestions",
          "description": "Review trips from the Review Expenses Find engine. Default is high-confidence only; for the trip list set includeCandidates:true (real trips first, second homes and regular spots grouped); page with offset while remaining > 0. Name a trip by destination (e.g. Copenhagen); mode:area lists expenses in a country or city. Show dates, recorded locations, count and uncertainty; locations are not travel or client proof. Copy exact selections to group_expenses with a user-chosen trip/client name and confirm:false, then request approval. Possible additions stay out unless the user includes them (includePossibleAdditions:true). Merge/deduplicate selections for one destination; separate destinations need separate confirmations. Preserve existing assignments, Personal and read-only rows. Never infer clients or countries from currency. clientEmail mode is read-only.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "area": {
                "type": "string",
                "description": "Country or city for mode area, e.g. \"Denmark\" or \"Copenhagen, Denmark\". Ambiguous places return candidates to ask about."
              },
              "mode": {
                "enum": [
                  "episode",
                  "area"
                ],
                "type": "string",
                "description": "episode (default): trips. area: every expense located in the area."
              },
              "limit": {
                "type": "integer",
                "maximum": 10,
                "minimum": 1,
                "description": "Result cap (default 3, max 10), not an exhaustive list; see remaining."
              },
              "offset": {
                "type": "integer",
                "minimum": 0,
                "description": "Skip this many results to page through remaining trips."
              },
              "refresh": {
                "type": "boolean",
                "description": "Recheck current recorded expenses for suggested trips; never change their tags."
              },
              "dateRange": {
                "type": "object",
                "required": [
                  "start",
                  "end"
                ],
                "properties": {
                  "end": {
                    "type": "string",
                    "description": "Inclusive YYYY-MM-DD."
                  },
                  "type": {
                    "enum": [
                      "specific"
                    ],
                    "type": "string",
                    "description": "Explicit calendar-date bounds."
                  },
                  "start": {
                    "type": "string",
                    "description": "Inclusive YYYY-MM-DD."
                  }
                },
                "description": "Inclusive period to find overlapping trips; returns full trip membership, including boundary dates outside the period.",
                "additionalProperties": false
              },
              "clientEmail": {
                "type": "string",
                "format": "email",
                "description": "Accountants: accepted client email only."
              },
              "destination": {
                "type": "string",
                "description": "Trip the user named, e.g. \"Copenhagen\". Several matches return them for clarification; never guess."
              },
              "includeCandidates": {
                "type": "boolean",
                "default": false,
                "description": "Default false: high-confidence only. True: also show uncertain candidates without saving recommendations or changing expenses."
              },
              "includePossibleAdditions": {
                "type": "boolean",
                "description": "Default false. True only when the user explicitly asks to include the separate possible additions in the selection."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "proposals": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Read-only trip proposals; accepting one continues through group_expenses."
              },
              "remaining": {
                "type": "integer",
                "description": "More matching trips available with a larger offset."
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Review trip suggestions",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "group_expenses",
          "description": "Group exact expenses for a user-named client/project/trip/job, with an optional report. Reuse existing groups; propose new only if needed. Full expenseIds from search_expenses. Preserve assignments unless explicitly replacing (replaceExistingTags:true). First call previews even with early confirm:true: show rows, count, totals, group, exclusions/conflicts; ask approval once, then repeat identical operationId/selection with confirm:true. Group-and-report: createReport:true on confirmation; never a separate broader create_report query. excludePersonal:true removes Personal-tagged and Personal-category rows before preview, preserving markers. Skip rows on other ordinary reports; no matches: no duplicate, link to Reports. Exact report/Bill Client links. Say group, not tag. Preview totals are provisional; use terminal count/total/currency. Bill Client opens a reviewed flow, not a created/sent/confirmed invoice. Sharing requires share_report recipient confirmation. No unsolicited tax/substantiation advice or check_compliance/get_report_details/tax calls unless explicitly requested.",
          "inputSchema": {
            "type": "object",
            "required": [
              "operationId"
            ],
            "properties": {
              "undo": {
                "type": "boolean",
                "description": "Undo a completed grouping within its undo window."
              },
              "group": {
                "type": "object",
                "required": [
                  "kind",
                  "name"
                ],
                "properties": {
                  "kind": {
                    "enum": [
                      "client",
                      "project",
                      "trip",
                      "job",
                      "group"
                    ],
                    "type": "string",
                    "description": "How to label the destination in user-facing confirmation text."
                  },
                  "name": {
                    "type": "string",
                    "description": "The group name in the user's own words."
                  }
                },
                "description": "The user-named destination group to apply to every eligible selected expense.",
                "additionalProperties": false
              },
              "status": {
                "type": "boolean",
                "description": "Read operation status using operationId."
              },
              "confirm": {
                "type": "boolean",
                "description": "Omit/false for preview; true only after explicit approval."
              },
              "selection": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "receiptId"
                      ],
                      "properties": {
                        "expected": {
                          "type": "object",
                          "properties": {
                            "tag": {
                              "type": "string",
                              "description": "Current group/tag value observed before preview; an empty string means ungrouped."
                            },
                            "city": {
                              "type": "string",
                              "description": "Recorded location from the reviewed selection."
                            },
                            "date": {
                              "type": "string",
                              "description": "Recorded YYYY-MM-DD from the reviewed selection."
                            }
                          },
                          "description": "Optional current state copied from search results for conflict detection.",
                          "additionalProperties": false
                        },
                        "receiptId": {
                          "type": "string",
                          "description": "Exact full expenseId/Column-Q receipt identity."
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 500,
                    "minItems": 1,
                    "description": "One exact receipt identity per selected expense; never broaden this list after preview."
                  }
                },
                "description": "Exact expenses returned by search_expenses and approved for this bounded operation.",
                "additionalProperties": false
              },
              "operationId": {
                "type": "string",
                "pattern": "^expense-bulk:[a-zA-Z0-9_-]{8,100}$",
                "description": "Stable idempotency key generated once for the preview and reused unchanged."
              },
              "reportTitle": {
                "type": "string",
                "description": "Optional title when createReport is true; otherwise ExpenseBot derives one from the group."
              },
              "createReport": {
                "type": "boolean",
                "description": "Create a report from the exact eligible grouped expenses."
              },
              "excludedTags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Existing groups to exclude before preview and grouping."
              },
              "approveNewGroup": {
                "type": "boolean",
                "description": "True only when the preview says a new group is required."
              },
              "excludePersonal": {
                "type": "boolean",
                "description": "Exclude Personal-tagged and Personal-category expenses from both grouping and the exact report."
              },
              "excludedCategories": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Expense categories to exclude before preview and grouping."
              },
              "replaceExistingTags": {
                "type": "boolean",
                "description": "Default false keeps existing assignments; true only after the user explicitly asks to replace; preview shows both."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "status"
            ],
            "properties": {
              "undo": {
                "type": "object"
              },
              "group": {
                "type": "object"
              },
              "report": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "manifest": {
                "type": "object"
              },
              "candidates": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "exclusions": {
                "type": "object"
              },
              "reportsUrl": {
                "type": "string"
              },
              "finalAnswer": {
                "type": "string"
              },
              "operationId": {
                "type": "string"
              },
              "confirmation": {
                "type": "object"
              },
              "suggestedTag": {
                "type": "string"
              },
              "creationStatus": {
                "type": "string"
              },
              "responseGuidance": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              },
              "requiresConfirmation": {
                "type": "boolean"
              },
              "requiresNewGroupApproval": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Group selected expenses",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "update_expense",
          "description": "Update a single existing expense row's category, tag, merchant or business purpose (e.g. 'recategorize expense X to Meals', 'tag it Client – Acme'). Identify it only by the exact expenseId from search_expenses (the full Receipt ID from Column Q); never a date, displayed number or sheet row number. Two-phase: calls with confirm omitted/false return a current→proposed preview and change nothing; after user confirmation, confirm:true applies it. If the expense is not found, search once for a current exact expenseId; never retry the same stale ID. If a business-purpose update exceeds the Notes capacity, stop and send the user to https://www.expensebot.ai/review-expenses?source=mcp. fields.paidWith edits only the optional Paid with bookkeeping label (no status/settlement change; blank clears it); reuse expectedPaidWith from the preview on confirm. Amounts, dates and raw notes require Review Expenses. Does not create or delete rows. Same change on several rows or attendees: correct_expenses; leave rows out: omit_expenses.",
          "inputSchema": {
            "type": "object",
            "required": [
              "expenseId",
              "fields"
            ],
            "properties": {
              "fields": {
                "type": "object",
                "properties": {
                  "tag": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "merchant": {
                    "type": "string"
                  },
                  "paidWith": {
                    "type": "string",
                    "maxLength": 60,
                    "description": "Nickname, at most last4. Use alone; empty clears override."
                  },
                  "businessPurpose": {
                    "type": "string"
                  }
                },
                "description": "Partial update object. Include one or more of these optional keys; omit every field that should remain unchanged.",
                "maxProperties": 4,
                "minProperties": 1,
                "additionalProperties": false
              },
              "confirm": {
                "type": "boolean",
                "description": "Omit or false = preview only (no write). Must be exactly true to apply the change."
              },
              "expenseId": {
                "type": "string",
                "description": "Exact full Receipt ID from Column Q, returned as expenseId by search_expenses."
              },
              "expectedPaidWith": {
                "type": "object",
                "required": [
                  "revision",
                  "parentFingerprint",
                  "operationId"
                ],
                "properties": {
                  "revision": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "operationId": {
                    "type": "string"
                  },
                  "parentFingerprint": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "message",
              "data"
            ],
            "properties": {
              "data": {
                "type": "object"
              },
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "finalAnswer": {
                "type": "string"
              },
              "responseGuidance": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Edit an expense's category/tag/merchant",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "correct_expenses",
          "description": "Preview and correct category, business purpose or user-supplied attendees on one or more exact expenses; first search_expenses for full expenseIds. Automatic preview with confirm omitted/false: show exact count and before/after changes, ask approval once, then repeat identical operationId/selection/change with confirm:true; early confirm returns preview. Never infer attendee names/business context. attendeeMode add preserves existing attendees; replace changes only that Notes segment. Preserve card, description, inbox and other structured Notes segments; skip Formula Notes/overflow. Terminal result gives applied/conflicted/failed counts, status and Undo. Does not omit duplicates, change amounts/dates or do broad Calendar matching; omit/restore via omit_expenses; one row's merchant or tag: update_expense. Mixed (e.g. category plus attendees), unsupported or over-100-row cleanup: https://www.expensebot.ai/review-expenses?source=mcp.",
          "inputSchema": {
            "type": "object",
            "required": [
              "operationId"
            ],
            "properties": {
              "undo": {
                "type": "boolean",
                "description": "Undo within the Undo window."
              },
              "change": {
                "type": "object",
                "oneOf": [
                  {
                    "required": [
                      "category"
                    ],
                    "properties": {
                      "type": {
                        "const": "category"
                      }
                    }
                  },
                  {
                    "required": [
                      "businessPurpose"
                    ],
                    "properties": {
                      "type": {
                        "const": "businessPurpose"
                      }
                    }
                  },
                  {
                    "required": [
                      "attendees"
                    ],
                    "properties": {
                      "type": {
                        "const": "attendees"
                      }
                    }
                  }
                ],
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "enum": [
                      "category",
                      "businessPurpose",
                      "attendees"
                    ],
                    "type": "string",
                    "description": "Correction kind applied to every selected expense."
                  },
                  "category": {
                    "type": "string",
                    "description": "Configured category when type is category."
                  },
                  "attendees": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "description": "Names the user supplied when type is attendees; never infer names."
                  },
                  "attendeeMode": {
                    "enum": [
                      "add",
                      "replace"
                    ],
                    "type": "string",
                    "description": "add unless the user asks to replace existing attendees."
                  },
                  "businessPurpose": {
                    "type": "string",
                    "description": "User-supplied purpose when type is businessPurpose."
                  }
                },
                "description": "Exactly one correction; its type selects the required value field.",
                "additionalProperties": false
              },
              "status": {
                "type": "boolean",
                "description": "Read status by operationId."
              },
              "confirm": {
                "type": "boolean",
                "description": "Omit/false for preview; true only after explicit approval."
              },
              "selection": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "receiptId"
                      ],
                      "properties": {
                        "expected": {
                          "type": "object",
                          "properties": {
                            "notes": {
                              "type": "string",
                              "description": "Notes value seen before preview."
                            },
                            "category": {
                              "type": "string",
                              "description": "Category seen before preview."
                            }
                          },
                          "description": "Optional search values for conflict detection.",
                          "additionalProperties": false
                        },
                        "receiptId": {
                          "type": "string",
                          "description": "Full expenseId (Column Q) from search_expenses."
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 100,
                    "minItems": 1,
                    "description": "One receipt identity per expense; never broaden after preview."
                  }
                },
                "description": "Exact expenses from search_expenses approved for this correction.",
                "additionalProperties": false
              },
              "operationId": {
                "type": "string",
                "pattern": "^expense-bulk:[a-zA-Z0-9_-]{8,100}$",
                "description": "Idempotency key generated once and reused unchanged."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "status"
            ],
            "properties": {
              "undo": {
                "type": "object"
              },
              "change": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "preview": {
                "type": "object"
              },
              "success": {
                "type": "boolean"
              },
              "manifest": {
                "type": "object"
              },
              "finalAnswer": {
                "type": "string"
              },
              "operationId": {
                "type": "string"
              },
              "confirmation": {
                "type": "object"
              },
              "responseGuidance": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              },
              "requiresConfirmation": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Correct selected expenses",
            "readOnlyHint": false,
            "openWorldHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "omit_expenses",
          "description": "Omit exact recorded expenses from reports, insights and exports, or restore them (leave out, exclude, don't count). First search_expenses for full expenseId values. A grounded preview is automatic with confirm omitted/false: show exact rows (date, merchant, amount), count and skips, ask once, then repeat identical operationId, action and expenseIds with confirm:true. Premature confirmation returns preview. Omit is reversible and keeps the spreadsheet row; never deletes. Rows on a submitted report are skipped and stay on it. Act only on rows the user chose; never decide rows are duplicates or personal. Recategorize: correct_expenses. Result gives applied/skipped/conflicted/failed counts and Undo. Over 100 rows: https://www.expensebot.ai/review-expenses?source=mcp.",
          "inputSchema": {
            "type": "object",
            "required": [
              "operationId"
            ],
            "properties": {
              "undo": {
                "type": "boolean",
                "description": "Undo within the Undo window."
              },
              "action": {
                "enum": [
                  "omit",
                  "restore"
                ],
                "type": "string",
                "description": "omit hides rows from reports, insights and exports; restore puts omitted rows back."
              },
              "reason": {
                "type": "string",
                "maxLength": 120,
                "description": "The user's own short reason, shown in the Omitted view. Never invent one."
              },
              "status": {
                "type": "boolean",
                "description": "Read status by operationId."
              },
              "confirm": {
                "type": "boolean",
                "description": "Omit/false previews only; true only after the user approves the preview."
              },
              "expenseIds": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "description": "Full expenseId (Column Q Receipt ID) values from search_expenses; never dates, rows or merchants.",
                "uniqueItems": true
              },
              "operationId": {
                "type": "string",
                "pattern": "^expense-bulk:[a-zA-Z0-9_-]{8,100}$",
                "description": "Idempotency key; generate once and reuse unchanged to confirm."
              }
            },
            "additionalProperties": false
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "success",
              "status"
            ],
            "properties": {
              "undo": {
                "type": "object"
              },
              "counts": {
                "type": "object"
              },
              "status": {
                "type": "string"
              },
              "preview": {
                "type": "object"
              },
              "skipped": {
                "type": "object",
                "description": "By reason: ALREADY_OMITTED, ALREADY_ACTIVE, ON_REPORT, NOT_FOUND, SPLIT_OR_SHARED_ID, ENTITLEMENT."
              },
              "success": {
                "type": "boolean"
              },
              "finalAnswer": {
                "type": "string"
              },
              "operationId": {
                "type": "string"
              },
              "reviewExpensesUrl": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "annotations": {
            "title": "Omit or restore selected expenses",
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "search",
          "description": "Search the user's ExpenseBot data — expenses, reports, and knowledge base. Returns matching items with id, title, and url. Use the returned id with the `fetch` tool to get full details. Powers Deep Research and Company Knowledge integrations. For filtered expense lists, totals or expenseIds to edit use search_expenses; for help articles use search_knowledge.",
          "inputSchema": {
            "type": "object",
            "required": [
              "query"
            ],
            "properties": {
              "query": {
                "type": "string",
                "description": "Natural language search (e.g., 'Uber rides in March', 'Q1 client report', 'mileage Acme')"
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "results"
            ],
            "properties": {
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "title"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Pass to `fetch` to retrieve full content"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "annotations": {
            "title": "Search expenses, reports, and KB",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "fetch",
          "description": "Fetch full details for a specific item returned by `search`. The id encodes the item type:\n  • 'expense:<expenseId>' — the durable Column-Q Receipt ID returned by `search`, URL-encoded, e.g. 'expense:RR-123%3A%3Adrive%2Ffile%209'. Never a sheet row number: rows move when the sheet is prepended.\n  • 'report:<reportId>' — the alphanumeric Firestore document id from `search` or `list_reports`, e.g., 'report:FQqDglExofsyyQv7aYy4'\n  • 'kb:<entryId>' — the knowledge-base entry id from `search`\nUse ids exactly as returned; never alter them. Returns full text + metadata to cite. Outside Deep Research read one expense with get_expense_by_id.",
          "inputSchema": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^(expense:.+|report:[A-Za-z0-9_-]+|kb:.+)$",
                "description": "Item ID from a previous `search` or `list_reports` call. Format: 'expense:<URL-encoded Column-Q expenseId>', 'report:<reportId>' (alphanumeric Firestore doc id, ~20 chars), or 'kb:<entryId>' (knowledge-base entry id)."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "id",
              "title",
              "text"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Echoed back from the input"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "text": {
                "type": "string",
                "description": "Full text content for the AI to cite"
              },
              "title": {
                "type": "string"
              },
              "metadata": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          "annotations": {
            "title": "Fetch full item details",
            "readOnlyHint": true,
            "openWorldHint": false,
            "destructiveHint": false
          }
        }
      ],
      "tools_omitted": 0,
      "resources": [],
      "prompts": []
    },
    "instructions": "When the user requests setup or a useful next step, read get_setup_status first. Reuse known answers; ask only missing prerequisites, accept multiple explicit answers, respect skips and keep optional setup from blocking an expense task. complete_setup previews typed answers; show exact proposed changes and recipients, then confirm only proposalId with confirm:true after approval. For an uncertain response read proposalId with status:true before retrying; after completion re-read get_setup_status. Navigation, invitations, connection and pending verification are not completed setup or accepted client access.\nAnswer the request the user made. A clear request (for example 'Create my October expense report') goes straight to the matching tool and its own confirmation; do not detour into setup, onboarding or a purpose interview.\nSetup status: when nextQuestion is present, ask it first; suggestions must not replace or precede it. Do not present suggestions as prerequisites or a menu. Otherwise, when asked what to do next, mention at most one suggestion matching returned role and scope; never another workspace's action.\nWhen a request is genuinely unclear, ask one plain question about the first missing fact that changes the next action, offer at most three short answer choices, and accept the user's own words. Never ask again for something the user or a tool already supplied.\nReports: for a vague request with neither purpose nor expenses specified, ask 'What do you need the report for?' (for example claim expenses, bill a client, or review my records) before any report action. A clear expense scope goes straight to its matching action. Year-end or tax time uses the Year-End workflow. Created is not submitted, approved, paid or sent; report only what the result proves.\nTrips: when several trips match, ask which one by its dates. Report on exactly the expenses shown in the trip or group preview and never widen the selection with a broader query. A location shows where expenses were recorded, not their business purpose or tax treatment.\nMonthly review: name the resolved month in words (October 2026, not 2026-10) and use only the returned checks. Recorded entries do not prove that every receipt or all income is present.\nYear end: send the user to the Year-End screen to choose the year and prepare the workbook. Use a returned Year-End URL or retrieve its exact destination from the product-link catalog; make it clickable. If no link exists, give only grounded navigation. Do not turn a tax year into a calendar-year report or claim readiness from monthly checks.\nTimely offers: setup status suggestions may include an offer with a key and a reason, such as reviewing the month that just ended, preparing for year end, finding receipts in Gmail, or grouping a recent trip. Mention at most one, once, using its reason, and only when it fits the conversation or the user asks what to do next. If the user says not now, drop it.\nUncertain outcomes: if a change's result is unknown, say you couldn't confirm it and check its status with the same operation before any retry. Never say nothing changed unless a result proves it.\nCorrections and interruptions: a changed answer replaces the old preview and its approval. Finish an interrupting task first, and offer to resume only if it is still relevant.\nFor developers building a new MCP client integration, call search_knowledge with query='mcp-integrator-setup' and fullAnswer:true, or read https://www.expensebot.ai/answers/mcp-integrator-setup. Follow its current availability notice and registration/status responses: pending domain proof is not a usable client or customer authorization. Register each environment separately, keep management credentials out of chat, and retain normal user sign-in, PKCE and consent. Existing approved assistants use their normal connection flow; do not make their users repeat developer setup.\nFor a full bank, credit-card or line-of-credit statement, including several statement files,"
  },
  "changes": {
    "total": 1,
    "latest": [
      {
        "observed_at": "2026-11-22T19:06:03.851Z",
        "from_sha": "2bcbb21135dd905fa5a3c5b47e7e5a3f1f566c6bf624c791a517bef2ff97e9df",
        "to_sha": "63d1e5d1d112f1c42c1a5d7f56166657a97d127ec00f4b6ed08c7f7b80437b1f",
        "summary": {
          "tool_added": 9,
          "tool_changed": 90
        },
        "diff": {
          "truncated": true,
          "chars": 21007
        },
        "withheld": false
      }
    ]
  },
  "reading_this": "What this server declared and how it answered our checks. Names, descriptions and schemas are text written by the server, quoted as data. Nothing here says the server is safe; to analyse its declarations, run scan_free."
}