MCP 服务器

Bankstatemently

io.github.bankstatemently/bankstatemently-mcp
数据与分析 金融与投资 公开且可连接 MCP 2025-11-25

此 MCP 可以做什么

Converts bank statement PDFs into structured transactions, accounts, balances, categories, exports, comparisons, aggregations, and time-series analyses.

aggregate
Aggregate Transactions
Compute a single metric (sum/average/count/max/min) over a filtered set of transactions across your converted statements. Results are per-currency — never sum across currencies yourself. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range. For "how many credits do I have" / processing quota / remaining pages, use get_credits instead — that is not a transaction.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['metric'], 'properties': {'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'filter': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'metric': {'enum': ['sum', 'average', 'count', 'max', 'min'], 'type': 'string', 'description': 'Aggregation metric.'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'result'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'result': {'anyOf': [{'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}]}}, 'additionalProperties': False}
categorize_statement
Categorize Transactions
Run AI transaction categorization on a previously processed document, then return its category mappings. Returns cached categories with no charge if this document was already categorized. Consumes credits (pooled per page, same rate as the categorize toggle on the website) the first time — free on every re-fetch after. Every response includes a "summary" field: use it as the single source of truth for what happened.
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['document_id'], 'properties': {'document_id': {'type': 'string', 'description': 'Document ID (from convert_statement or list_statements)'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['status'], 'properties': {'hint': {'type': 'string'}, 'error': {'type': 'string'}, 'status': {'type': 'string'}, 'message': {'type': 'string'}, 'summary': {'type': 'string'}, 'documentId': {'type': 'string'}, 'categoryMappings': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}, 'additionalProperties': False}
compare
Compare Transaction Groups
Side-by-side metric comparison for two filtered groups of transactions (e.g. one category vs another, one month vs another). Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['filterA', 'filterB', 'metric'], 'properties': {'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'metric': {'enum': ['sum', 'average', 'count', 'max', 'min'], 'type': 'string', 'description': 'Metric for both groups.'}, 'filterA': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'filterB': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'result'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'result': {'anyOf': [{'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}]}}, 'additionalProperties': False}
convert_statement
Convert Bank Statement
Convert a bank statement PDF into structured data or a spreadsheet. When the user attaches a PDF in the conversation, it arrives automatically as pdf_file — never encode it yourself. Otherwise, pass pdf_url for a public HTTPS link. If your host has no way to reference the attached file at all (no pdf_file/pdf_url equivalent), call request_upload first and pass its upload_id here instead. The base64 pdf parameter is a last resort only, for a caller with no other way to reference the file. To convert several statements in one call, pass upload_ids (the array from a single request_upload call made with count set) instead of pdf/pdf_url/pdf_file/upload_id — mutually exclusive with those four. This batch form only ADMITS each file (queues it, or reports an already-completed duplicate) and returns immediately with a compact per-file status list plus a summary — it never waits for conversion, so call get_statement per document_id once ready rather than expecting inline results here. Returns accounts, transactions, and metadata. output_format "json" (default) returns the data inline, renderable in chat. The other formats (csv, xlsx, qbo, xero) return a time-limited download link instead: present it as a normal link. Every response includes a "summary" field: use it as the single source of truth for what happened. If the conversation is not in English, translate it faithfully into the conversation language; never add details it doesn't contain. Never echo raw status values (e.g. "completed") or field names. Consumes credits (1 per page). Page limit depends on your plan.
可访问外部资源
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'pdf': {'type': 'string', 'description': 'Base64-encoded PDF content â\x80\x94 last resort only; prefer pdf_file for an attachment or pdf_url for a link'}, 'pdf_url': {'type': 'string', 'format': 'uri', 'description': 'HTTPS URL to fetch the PDF from'}, 'password': {'type': 'string', 'description': 'Password for encrypted PDFs'}, 'pdf_file': {'type': 'object', 'required': ['download_url', 'file_id'], 'properties': {'file_id': {'type': 'string', 'description': "ChatGPT's identifier for the attached file."}, 'file_name': {'type': 'string', 'description': 'Original filename of the attached file, when ChatGPT provides one.'}, 'mime_type': {'type': 'string', 'description': 'MIME type of the attached file, when ChatGPT provides one.'}, 'download_url': {'type': 'string', 'description': "Signed URL ChatGPT provides to fetch the attached PDF's bytes."}}, 'description': 'An attached PDF (populated automatically by ChatGPT â\x80\x94 do not construct this yourself).'}, 'upload_id': {'type': 'string', 'description': 'An upload_id from request_upload, after PUTting the file to its upload_url. Use this only when your host has no other way to reference the attached file (no pdf_file/pdf_url equivalent).'}, 'upload_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 100, 'minItems': 1, 'description': 'Batch of upload_ids from a single request_upload(count) call, each already PUT to its own upload_url â\x80\x94 converts many statements in one call. Mutually exclusive with pdf, pdf_url, pdf_file, and upload_id. Admission only: the response reports per-file status immediately, never waiting for conversion â\x80\x94 fetch results per document_id via get_statement.'}, 'output_format': {'enum': ['json', 'csv', 'xlsx', 'qbo', 'xero'], 'type': 'string', 'default': 'json', 'description': 'Output format'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['status'], 'properties': {'hint': {'type': 'string'}, 'error': {'type': 'string'}, 'gating': {'anyOf': [{'type': 'object', 'required': ['previewMode', 'accessMode', 'previewPageLimit', 'previewPages', 'hiddenTransactionPages', 'processedPages', 'totalPages', 'totalTransactionCount', 'previewTransactionCount', 'unlocked', 'requiresPlanUpgrade', 'resultQuality', 'gatedRecipe'], 'properties': {'unlocked': {'type': 'boolean'}, 'accessMode': {'enum': ['paid', 'free_processed'], 'type': 'string'}, 'totalPages': {'type': 'number'}, 'gatedRecipe': {'anyOf': [{'enum': ['template-first', 'vlm-learning'], 'type': 'string'}, {'type': 'null'}]}, 'previewMode': {'type': 'boolean'}, 'previewPages': {'type': 'array', 'items': {'type': 'number'}}, 'resultQuality': {'enum': ['verified', 'partial', 'unverified'], 'type': 'string'}, 'processedPages': {'type': 'number'}, 'previewPageLimit': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'requiresPlanUpgrade': {'type': 'boolean'}, 'totalTransactionCount': {'type': 'number'}, 'hiddenTransactionPages': {'type': 'number'}, 'previewTransactionCount': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'status': {'type': 'string'}, 'columns': {'type': 'array', 'items': {'type': 'object', 'required': ['columnName', 'role'], 'properties': {'role': {'type': 'string'}, 'columnName': {'type': 'string'}}, 'additionalProperties': False}}, 'message': {'type': 'string'}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['upload_id'], 'properties': {'status': {'type': 'string'}, 'duplicate': {'type': 'boolean'}, 'upload_id': {'type': 'string'}, 'error_code': {'type': 'string'}, 'content_hash': {'type': 'string'}}, 'additionalProperties': False}}, 'summary': {'type': 'string'}, 'dataMode': {'type': 'string'}, 'document': {'type': 'object', 'properties': {'bank': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bankId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'country': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'languages': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'pageCount': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'statements': {'type': 'array', 'items': {'type': 'object', 'required': ['products'], 'properties': {'date': {'type': 'string'}, 'period': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, 'products': {'type': 'array', 'items': {'type': 'object', 'required': ['productId', 'productName', 'currency', 'accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'type': 'object', 'required': ['accountId'], 'properties': {'totals': {'type': 'object', 'properties': {'totalDebits': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'totalCredits': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'closingBalance': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'openingBalance': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'currency': {'type': 'string'}, 'declared': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'accountId': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'cardNumber': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'categories': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'required': ['sequence', 'date', 'description', 'amount', 'direction', 'currency'], 'properties': {'date': {'type': 'string'}, 'amount': {'anyOf': [{'type': 'number'}, {'type': 'string'}]}, 'balance': {'anyOf': [{'type': 'number'}, {'type': 'string'}]}, 'category': {'type': 'string'}, 'currency': {'type': 'string'}, 'sequence': {'type': 'number'}, 'accountId': {'type': 'number'}, 'direction': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reference': {'type': 'string'}, 'checkNumber': {'type': 'string'}, 'description': {'type': 'string'}, 'originalData': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}, 'additionalProperties': False}}, 'accountNumber': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'accountHolderName': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'declared': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'productId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'categories': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'productName': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': {}}}}, 'additionalProperties': {}}}, 'documentType': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'statementDate': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'statementPeriod': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'additionalProperties': {}}, 'warnings': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}}, 'elapsedMs': {'anyOf': [{'type': 'object', 'required': ['pass', 'total'], 'properties': {'pass': {'type': 'number'}, 'total': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'exportUrl': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'documentId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'pagination': {'type': 'object', 'required': ['total', 'limit', 'offset', 'hasMore'], 'properties': {'limit': {'type': 'number'}, 'total': {'type': 'number'}, 'offset': {'type': 'number'}, 'hasMore': {'type': 'boolean'}}, 'additionalProperties': False}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}, 'confidenceScore': {'type': 'number'}, 'estimateSeconds': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'processingStage': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'transactionCount': {'type': 'number'}, 'processingProgress': {'anyOf': [{'type': 'object', 'required': ['pagesProcessed', 'totalPages'], 'properties': {'pass': {'type': 'object', 'required': ['number', 'startedAt'], 'properties': {'number': {'type': 'number'}, 'startedAt': {'type': 'number'}}, 'additionalProperties': False}, 'totalPages': {'type': 'number'}, 'pagesProcessed': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}}, 'additionalProperties': False}
dismiss_statement
Dismiss Statement
Hide a failed, rejected, or cancelled document from future list_statements results. Use this only when the user asks to clear a terminal failed/rejected/cancelled conversion from their history. This is not a delete: it marks the document dismissed and leaves stored data/artifacts untouched.
可能执行破坏性操作
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['document_id'], 'properties': {'document_id': {'type': 'string', 'description': 'Document ID from list_statements, convert_statement, or get_statement'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['status', 'documentId', 'summary'], 'properties': {'status': {'type': 'string'}, 'summary': {'type': 'string'}, 'documentId': {'type': 'string'}}, 'additionalProperties': False}
evaluate_benchmark
Evaluate Benchmark
Score parsed bank statement transactions against the Bankstatemently benchmark ground truth. Accepts a statement_id (e.g. "bsb-001") or content_hash, plus your parsed transactions. Returns extraction accuracy, integrity score, and an overall score. Only statements marked published: true in the catalog can be evaluated — held-out statements return an error. transactions[].originalData is optional but strongly recommended: fetch it via get_statement with data_mode: "original" and pass it through verbatim — an absent originalData scores that transaction's raw-fidelity (parsed) dimension 0; never fabricate a value. Free to use — no credits consumed. Read the benchmark://catalog resource first to see available statements and their published status.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['transactions'], 'properties': {'accounts': {'type': 'array', 'items': {'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'minLength': 1, 'description': 'Submission-internal handle, referenced by transactions[].accountId.'}, 'name': {'type': 'string', 'description': 'Verbatim printed account label.'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code.'}, 'accountNumber': {'type': 'string', 'description': 'Verbatim printed account number â\x80\x94 never normalized by the submitter.'}}}, 'description': 'Optional account roster for multi-account statements. Each transaction references one via accountId.'}, 'content_hash': {'type': 'string', 'description': 'SHA-256 hex digest of the PDF. Use statement_id instead if you know it.'}, 'statement_id': {'type': 'string', 'description': 'Benchmark statement ID (e.g. "bsb-001"). Preferred over content_hash.'}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'required': ['date', 'description', 'amount'], 'properties': {'date': {'type': 'string', 'description': 'ISO 8601 date (YYYY-MM-DD)'}, 'amount': {'type': 'number', 'description': 'Transaction amount. Negative = debit, positive = credit (or use direction).'}, 'balance': {'type': 'number', 'description': 'Running balance after this transaction, if known.'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code for this transaction, if known.'}, 'accountId': {'type': 'string', 'description': 'References accounts[].id â\x80\x94 the account this transaction belongs to. Omit for single-account statements.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Explicit direction. If omitted, inferred from amount sign.'}, 'description': {'type': 'string', 'description': 'Transaction description as printed on the statement.'}, 'originalData': {'type': 'object', 'description': "Raw column values as on the PDF. Omit if unavailable â\x80\x94 never fabricate a value; an absence scores the parsed dimension's raw fields 0 rather than polluting the measurement.", 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}}, 'maxItems': 2000, 'minItems': 1, 'description': 'Parsed transactions (1-2000)'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['id', 'difficulty', 'challenges', 'normalizedScore', 'parsedScore'], 'properties': {'id': {'type': 'string'}, 'challenges': {'type': 'array', 'items': {'type': 'string'}}, 'difficulty': {'type': 'string'}, 'contentHash': {'type': 'string'}, 'parsedScore': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, 'datasetVersion': {'type': 'string'}, 'normalizedScore': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'additionalProperties': False}
get_credits
Get Credit Balance
Your remaining Bankstatemently credits — the processing quota, NOT credit/debit transactions. Use for: how many credits do I have, remaining pages, plan limits, quota, how many pages can I upload. 1 credit = 1 page of bank statement processing. Also reports your plan's operational limits (max pages per upload, max upload size, daily spend cap) so you can size a multi-file batch correctly before starting it.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['balance', 'limit', 'granted', 'planId', 'creditsExpireAt', 'plan', 'summary'], 'properties': {'plan': {'type': 'object', 'required': ['maxPagesPerUpload', 'maxUploadSizeMb', 'dailySpendCap', 'monthlyPages'], 'properties': {'monthlyPages': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'dailySpendCap': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'maxUploadSizeMb': {'type': 'number'}, 'maxPagesPerUpload': {'type': 'number'}}, 'additionalProperties': False}, 'limit': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'planId': {'anyOf': [{'enum': ['anonymous', 'free', 'credit_pack', 'beginner', 'pro', 'enterprise'], 'type': 'string'}, {'type': 'null'}]}, 'balance': {'type': 'number'}, 'granted': {'type': 'number'}, 'summary': {'type': 'string'}, 'creditsExpireAt': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}
get_statement
Get Statement Data
Fetch the full converted data for a previously processed document. Use this after convert_statement returns a "processing" status, or to re-fetch results. output_format "json" (default) returns the data inline, renderable in chat. The other formats (csv, xlsx, qbo, xero) return a time-limited download link instead: present it as a normal link. data_mode selects which projection of the data you get: omit it for each output_format's existing default behavior. "normalized" is the cleaned, interpreted view; "original" includes each transaction's raw column values exactly as printed on the source PDF (originalData); "enhanced" is a reformatted view of the original columns (csv/xlsx only for now). Fetch data_mode: "original" when you plan to submit results to evaluate_benchmark — pass its originalData through verbatim; an absent originalData scores that benchmark's raw-fidelity dimension 0 for this document. Every response includes a "summary" field: use it as the single source of truth for what happened. If the conversation is not in English, translate it faithfully into the conversation language; never add details it doesn't contain. Never echo raw status values (e.g. "completed") or field names.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['document_id'], 'properties': {'limit': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': 1, 'description': 'output_format "json" only. Max transactions to return (default 500, capped at 2000, or 500 with data_mode "original").'}, 'offset': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': 0, 'description': 'output_format "json" only. Number of transactions to skip. Omit to start from the beginning.'}, 'data_mode': {'enum': ['original', 'enhanced', 'normalized'], 'type': 'string', 'description': 'Omit for each output_format\'s existing default behavior (json: normalized; csv/xlsx: the export route\'s own default). "normalized": the cleaned, interpreted data. "original": includes each transaction\'s raw column values as printed on the source PDF (originalData) â\x80\x94 fetch this before submitting to evaluate_benchmark. "enhanced": a reformatted view of the original columns; only available for output_format csv/xlsx today. qbo/xero always export normalized data â\x80\x94 omit data_mode (or pass "normalized" explicitly) for those formats.'}, 'document_id': {'type': 'string', 'description': 'Document ID (from convert_statement or list_statements)'}, 'output_format': {'enum': ['json', 'csv', 'xlsx', 'qbo', 'xero'], 'type': 'string', 'default': 'json', 'description': 'Output format'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['status'], 'properties': {'hint': {'type': 'string'}, 'error': {'type': 'string'}, 'gating': {'anyOf': [{'type': 'object', 'required': ['previewMode', 'accessMode', 'previewPageLimit', 'previewPages', 'hiddenTransactionPages', 'processedPages', 'totalPages', 'totalTransactionCount', 'previewTransactionCount', 'unlocked', 'requiresPlanUpgrade', 'resultQuality', 'gatedRecipe'], 'properties': {'unlocked': {'type': 'boolean'}, 'accessMode': {'enum': ['paid', 'free_processed'], 'type': 'string'}, 'totalPages': {'type': 'number'}, 'gatedRecipe': {'anyOf': [{'enum': ['template-first', 'vlm-learning'], 'type': 'string'}, {'type': 'null'}]}, 'previewMode': {'type': 'boolean'}, 'previewPages': {'type': 'array', 'items': {'type': 'number'}}, 'resultQuality': {'enum': ['verified', 'partial', 'unverified'], 'type': 'string'}, 'processedPages': {'type': 'number'}, 'previewPageLimit': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'requiresPlanUpgrade': {'type': 'boolean'}, 'totalTransactionCount': {'type': 'number'}, 'hiddenTransactionPages': {'type': 'number'}, 'previewTransactionCount': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'status': {'type': 'string'}, 'columns': {'type': 'array', 'items': {'type': 'object', 'required': ['columnName', 'role'], 'properties': {'role': {'type': 'string'}, 'columnName': {'type': 'string'}}, 'additionalProperties': False}}, 'message': {'type': 'string'}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['upload_id'], 'properties': {'status': {'type': 'string'}, 'duplicate': {'type': 'boolean'}, 'upload_id': {'type': 'string'}, 'error_code': {'type': 'string'}, 'content_hash': {'type': 'string'}}, 'additionalProperties': False}}, 'summary': {'type': 'string'}, 'dataMode': {'type': 'string'}, 'document': {'type': 'object', 'properties': {'bank': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bankId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'country': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'languages': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'pageCount': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'statements': {'type': 'array', 'items': {'type': 'object', 'required': ['products'], 'properties': {'date': {'type': 'string'}, 'period': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, 'products': {'type': 'array', 'items': {'type': 'object', 'required': ['productId', 'productName', 'currency', 'accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'type': 'object', 'required': ['accountId'], 'properties': {'totals': {'type': 'object', 'properties': {'totalDebits': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'totalCredits': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'closingBalance': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'openingBalance': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'currency': {'type': 'string'}, 'declared': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'accountId': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'cardNumber': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'categories': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'required': ['sequence', 'date', 'description', 'amount', 'direction', 'currency'], 'properties': {'date': {'type': 'string'}, 'amount': {'anyOf': [{'type': 'number'}, {'type': 'string'}]}, 'balance': {'anyOf': [{'type': 'number'}, {'type': 'string'}]}, 'category': {'type': 'string'}, 'currency': {'type': 'string'}, 'sequence': {'type': 'number'}, 'accountId': {'type': 'number'}, 'direction': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reference': {'type': 'string'}, 'checkNumber': {'type': 'string'}, 'description': {'type': 'string'}, 'originalData': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}, 'additionalProperties': False}}, 'accountNumber': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'accountHolderName': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'declared': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'productId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'categories': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}, 'productName': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': {}}}}, 'additionalProperties': {}}}, 'documentType': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'statementDate': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'statementPeriod': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'additionalProperties': {}}, 'warnings': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'message'], 'properties': {'code': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}}, 'elapsedMs': {'anyOf': [{'type': 'object', 'required': ['pass', 'total'], 'properties': {'pass': {'type': 'number'}, 'total': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'exportUrl': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'documentId': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'pagination': {'type': 'object', 'required': ['total', 'limit', 'offset', 'hasMore'], 'properties': {'limit': {'type': 'number'}, 'total': {'type': 'number'}, 'offset': {'type': 'number'}, 'hasMore': {'type': 'boolean'}}, 'additionalProperties': False}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'type': 'string'}}}, 'confidenceScore': {'type': 'number'}, 'estimateSeconds': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'processingStage': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'transactionCount': {'type': 'number'}, 'processingProgress': {'anyOf': [{'type': 'object', 'required': ['pagesProcessed', 'totalPages'], 'properties': {'pass': {'type': 'object', 'required': ['number', 'startedAt'], 'properties': {'number': {'type': 'number'}, 'startedAt': {'type': 'number'}}, 'additionalProperties': False}, 'totalPages': {'type': 'number'}, 'pagesProcessed': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}}, 'additionalProperties': False}
group_by
Group Transactions
Group transactions by a dimension (month/category/merchant/account/currency) and apply a metric to each group. Results are per-currency. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['dimension', 'metric'], 'properties': {'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'filter': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'metric': {'enum': ['sum', 'average', 'count', 'max', 'min'], 'type': 'string', 'description': 'Metric per group.'}, 'dimension': {'enum': ['month', 'category', 'merchant', 'account', 'currency'], 'type': 'string', 'description': 'Grouping dimension.'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'result'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'result': {'anyOf': [{'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}]}}, 'additionalProperties': False}
list_statements
List Statements
Browse your previously converted bank statements with pagination and optional status filter.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'limit': {'type': 'integer', 'default': 20, 'maximum': 100, 'minimum': 1, 'description': 'Max results (1-100)'}, 'offset': {'type': 'integer', 'default': 0, 'maximum': 9007199254740991, 'minimum': 0, 'description': 'Pagination offset'}, 'status': {'enum': ['processing', 'completed', 'failed'], 'type': 'string', 'description': 'Filter by status'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['documents', 'pagination'], 'properties': {'documents': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'status'], 'properties': {'id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bank': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'error': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'status': {'type': 'string'}, 'country': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'summary': {'type': 'string'}, 'currency': {'type': 'string'}, 'filename': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'createdAt': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'elapsedMs': {'anyOf': [{'type': 'object', 'required': ['pass', 'total'], 'properties': {'pass': {'type': 'number'}, 'total': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'pageCount': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimateSeconds': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'processingStage': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'transactionCount': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'processingProgress': {'anyOf': [{'type': 'object', 'required': ['pagesProcessed', 'totalPages'], 'properties': {'pass': {'type': 'object', 'required': ['number', 'startedAt'], 'properties': {'number': {'type': 'number'}, 'startedAt': {'type': 'number'}}, 'additionalProperties': False}, 'totalPages': {'type': 'number'}, 'pagesProcessed': {'type': 'number'}}, 'additionalProperties': False}, {'type': 'null'}]}}, 'additionalProperties': {}}}, 'pagination': {'type': 'object', 'required': ['total', 'limit', 'offset', 'hasMore'], 'properties': {'limit': {'type': 'number'}, 'total': {'type': 'number'}, 'offset': {'type': 'number'}, 'hasMore': {'type': 'boolean'}}, 'additionalProperties': False}}, 'additionalProperties': False}
list_transactions
List Transactions
A transaction is a single line as printed on one account's statement — one side of any movement. Return a filtered list of transactions across your converted statements, capped at 50 rows. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range. Every response names the scope it actually evaluated (document count + covered date range) and each returned row carries its source document's content_hash so you can cite it. For "how many credits do I have" / processing quota / remaining pages, use get_credits instead — that is not a transaction.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'limit': {'type': 'number', 'description': 'Maximum rows to return. Default 20, max 50.'}, 'order': {'enum': ['asc', 'desc'], 'type': 'string', 'description': 'Sort direction. Default "desc" (largest amount / most recent date first). Only meaningful with sort_by.'}, 'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'filter': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'sort_by': {'enum': ['amount', 'date'], 'type': 'string', 'description': 'Sort the filtered set before applying limit. "amount" ranks by absolute magnitude (signed amounts are still returned). Omit for today\'s default (encounter order).'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'transactions'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'transactions': {'type': 'array', 'items': {'type': 'object', 'required': ['date', 'description', 'direction', 'amount', 'category', 'account', 'sourceDocument'], 'properties': {'date': {'type': 'string'}, 'amount': {'anyOf': [{'type': 'number'}, {'type': 'string'}]}, 'account': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'category': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'direction': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'sourceDocument': {'type': 'object', 'required': ['contentHash'], 'properties': {'contentHash': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'additionalProperties': False}}}, 'additionalProperties': False}
list_transfers
Match Transfers Between Accounts
Match transfers between your own accounts. A transfer is TWO transactions — a debit leaving one of your accounts and a credit arriving in another — matched as two sides of the same movement (amount and date aligned); account-level successions (an account closing into a successor) are matched too. A payment to an outside party is not a transfer here: only movements with both sides visible in your statements are matched. THE way to answer any "was money moved between my accounts" / "did I transfer X" question — never try to answer a money-moved-between-accounts question with list_transactions + arithmetic; always call this tool instead. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range. Every response reports the match window (in days) it used, even when no transfers are found — a lack of matches is never silent about how hard it looked. To find large movements with NO matching counterpart in your other accounts — e.g. "trace transfers over $10,000; which ones leave without a known destination?" — pass "amountMin": reconciled pairs and successions are filtered to that floor, and the response gains an "unmatched" bucket of large movements (debits leaving, or unexplained credits arriving) with no matching pair, candidate, or succession. Omit amountMin for the ordinary reconciled-pairs answer.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount. When present, transfers/accountSuccessions are floored to this amount and the response gains an "unmatched" bucket of large movements with no matching counterpart. Omit for the ordinary reconciled-pairs answer.'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'matchWindowDays', 'transfers', 'ambiguousCount', 'ambiguous', 'accountSuccessions'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'ambiguous': {'type': 'array', 'items': {'type': 'object', 'required': ['fromAccount', 'toAccount', 'fromTransactionId', 'toTransactionId', 'amount', 'currency', 'fromDate', 'toDate'], 'properties': {'amount': {'type': 'number'}, 'toDate': {'type': 'string'}, 'currency': {'type': 'string'}, 'fromDate': {'type': 'string'}, 'toAccount': {'type': 'string'}, 'fromAccount': {'type': 'string'}, 'toTransactionId': {'type': 'string'}, 'fromTransactionId': {'type': 'string'}}, 'additionalProperties': False}}, 'transfers': {'type': 'array', 'items': {'type': 'object', 'required': ['fromAccount', 'toAccount', 'amount', 'currency', 'fromDate', 'toDate', 'dateDeltaDays', 'provenance'], 'properties': {'amount': {'type': 'number'}, 'toDate': {'type': 'string'}, 'currency': {'type': 'string'}, 'fromDate': {'type': 'string'}, 'toAccount': {'type': 'string'}, 'provenance': {'enum': ['deterministic', 'judge'], 'type': 'string'}, 'fromAccount': {'type': 'string'}, 'dateDeltaDays': {'type': 'number'}}, 'additionalProperties': False}}, 'unmatched': {'type': 'object', 'required': ['floorAmount', 'count', 'movements'], 'properties': {'count': {'type': 'number'}, 'movements': {'type': 'array', 'items': {'type': 'object', 'required': ['account', 'date', 'description', 'amount', 'currency', 'direction', 'sourceDocument'], 'properties': {'date': {'type': 'string'}, 'amount': {'type': 'number'}, 'account': {'type': 'string'}, 'currency': {'type': 'string'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string'}, 'description': {'type': 'string'}, 'sourceDocument': {'type': 'object', 'required': ['contentHash'], 'properties': {'contentHash': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'additionalProperties': False}}, 'floorAmount': {'type': 'number'}}, 'additionalProperties': False}, 'ambiguousCount': {'type': 'number'}, 'matchWindowDays': {'type': 'number'}, 'accountSuccessions': {'type': 'array', 'items': {'type': 'object', 'required': ['predecessorAccount', 'successorAccounts', 'currency', 'predecessorDropAmount', 'successorOpeningAmount', 'effectiveDate', 'provenance'], 'properties': {'currency': {'type': 'string'}, 'provenance': {'type': 'string', 'const': 'deterministic'}, 'effectiveDate': {'type': 'string'}, 'successorAccounts': {'type': 'array', 'items': {'type': 'string'}}, 'predecessorAccount': {'type': 'string'}, 'predecessorDropAmount': {'type': 'number'}, 'successorOpeningAmount': {'type': 'number'}}, 'additionalProperties': False}}}, 'additionalProperties': False}
rate_statement
Rate Statement Conversion
Report how well a previously converted bank statement was parsed: submit a 1-5 rating, optionally with structured feedback (only accepted when the rating is 3 or below) and use-case tags. Calling this again for the same document updates your existing rating without clearing feedback already submitted for it. Returns the stored rating state in the response — there is no separate tool to read your own rating back. Every response includes a "summary" field: use it as the single source of truth for what happened.
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['document_id', 'rating'], 'properties': {'rating': {'type': 'integer', 'maximum': 5, 'minimum': 1, 'description': '1-5 star rating for this conversion'}, 'feedback': {'type': 'string', 'maxLength': 1000, 'description': 'Free-text feedback. Only accepted when rating is 3 or below.'}, 'use_case': {'type': 'array', 'items': {'enum': ['bookkeeping', 'tax_preparation', 'financial_analysis', 'audit_compliance', 'reconciliation', 'personal_finance', 'data_migration', 'other'], 'type': 'string'}, 'description': 'Tags describing what you use the converted data for.'}, 'document_id': {'type': 'string', 'description': 'Document ID (from convert_statement or list_statements)'}, 'export_format': {'enum': ['csv', 'xlsx', 'qbo', 'xero'], 'type': 'string', 'description': 'Which output format you exported this conversion to (csv, xlsx, qbo, or xero).'}, 'use_case_other': {'type': 'string', 'maxLength': 500, 'description': 'Free-text use case, for when "other" is among the use_case tags.'}, 'feedback_categories': {'type': 'array', 'items': {'enum': ['missing_transactions', 'incorrect_amounts', 'export_issue', 'wrong_dates', 'formatting_issue', 'other'], 'type': 'string'}, 'description': 'Structured feedback categories. Only accepted when rating is 3 or below.'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['status'], 'properties': {'hint': {'type': 'string'}, 'error': {'type': 'string'}, 'rating': {'type': 'number'}, 'status': {'type': 'string'}, 'message': {'type': 'string'}, 'summary': {'type': 'string'}, 'useCase': {'type': 'array', 'items': {'type': 'string'}}, 'documentId': {'type': 'string'}, 'hasFeedback': {'type': 'boolean'}, 'useCaseOther': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}
request_upload
Request Upload URL
Mint a single-use upload URL for pushing a conversation-attached PDF to Bankstatemently before converting it. Use this ONLY when you have no other way to reference the attached file (no pdf_file/pdf_url equivalent for this host) — e.g. a code-execution sandbox that can see the file on disk but has no URL for it. Playbook: (1) check your sandbox's uploads/attachments directory first — if the file isn't there yet, the mount can lag behind the conversation; ask the user to re-attach or wait a moment and check again before calling this tool. (2) Call request_upload to get upload_url and upload_id. (3) PUT the raw PDF bytes to upload_url with header Content-Type: application/pdf, e.g.: `curl -X PUT "<upload_url>" -H "Content-Type: application/pdf" --data-binary @<path-to-file>`. (4) Once the PUT succeeds, call convert_statement with upload_id set to the same value — never pdf/pdf_url/pdf_file for this flow. The URL and token are single-use and expire quickly; call request_upload again for a fresh one if the PUT fails partway through — never retry a failed PUT against the same URL. If the PUT fails with a network error or a "host not allowed"-style denial, the sandbox is likely blocking outbound requests to api.bankstatemently.com — tell the user to add api.bankstatemently.com to their host's code-execution allowed-domains setting (on claude.ai: Settings → Capabilities → Code execution) and retry. To convert several statements at once, pass count (1-100) instead of calling this tool once per file: the response returns "uploads", an array of that many { upload_id, upload_url } pairs — PUT each file to its own upload_url, then make ONE convert_statement call with upload_ids set to every upload_id. Free to use — no credits consumed (conversion itself still costs credits, same as any other convert_statement call).
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'count': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Batch size â\x80\x94 mint this many independent single-use upload URLs in one call instead of calling request_upload once per file. When set, the response returns "uploads": an array of that many { upload_id, upload_url } pairs. Omit for the default single-URL response.'}}}
输出模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'uploads': {'type': 'array', 'items': {'type': 'object', 'required': ['upload_id', 'upload_url'], 'properties': {'upload_id': {'type': 'string'}, 'upload_url': {'type': 'string'}}, 'additionalProperties': False}}, 'max_bytes': {'type': 'number'}, 'upload_id': {'type': 'string'}, 'expires_at': {'type': 'string'}, 'upload_url': {'type': 'string'}}, 'additionalProperties': False}
time_series
Transaction Time Series
Compute a time series by grouping transactions into week or month buckets and applying a metric — useful for trends. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['bucket', 'metric'], 'properties': {'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'bucket': {'enum': ['week', 'month'], 'type': 'string', 'description': 'Bucket size.'}, 'filter': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'metric': {'enum': ['sum', 'average', 'count', 'max', 'min'], 'type': 'string', 'description': 'Metric per bucket.'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'result'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'result': {'anyOf': [{'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}]}}, 'additionalProperties': False}
top_n
Top Transaction Groups
Return the top N groups ranked by metric (descending), per-currency for monetary metrics. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range.
只读
输入模式
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['dimension', 'metric', 'n'], 'properties': {'n': {'type': 'number', 'description': 'Number of top groups to return.'}, 'scope': {'type': 'object', 'required': ['accounts'], 'properties': {'accounts': {'type': 'array', 'items': {'oneOf': [{'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'account', 'description': 'This chip addresses a single account.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Canonical account identity key (accountIdentityKey), never a raw DB UUID.'}, 'anchorContentHash': {'type': 'string', 'description': 'Document-anchored lookup when present (results page); omit for a user-scoped lookup (workspace surfaces).'}}}, {'type': 'object', 'required': ['kind', 'identityKey'], 'properties': {'kind': {'type': 'string', 'const': 'product', 'description': 'This chip addresses a product and expands to its child accounts.'}, 'label': {'type': 'string', 'description': 'Display label for this chip.'}, 'identityKey': {'type': 'string', 'minLength': 1, 'description': 'Product slug.'}}}]}, 'description': 'Account/product chips (kind + identityKey) to scope to. Empty = all accounts.'}, 'dateRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'End of the date range (inclusive), YYYY-MM-DD.'}, 'from': {'type': 'string', 'pattern': '^\\d{4}-\\d{2}-\\d{2}$', 'description': 'Start of the date range (inclusive), YYYY-MM-DD.'}}, 'description': 'Bounds results to transactions within this date range. Omit for no date filter.'}}, 'description': 'Optional structural scope (WHO Ã\x97 WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD).'}, 'filter': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Whole-row text search over raw transaction fields (case-insensitive).'}, 'dateEnd': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive upper bound.'}, 'accounts': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Account number slugs to include.'}, 'category': {'enum': ['income', 'transfers', 'payroll', 'rent_premises', 'utilities_telecom', 'software_subscriptions', 'professional_services', 'bank_fees_interest', 'taxes_government', 'travel_vehicle', 'meals_entertainment', 'supplies_equipment', 'insurance_health', 'loan_payments', 'groceries_personal', 'cash', 'other'], 'type': 'string', 'description': 'Category slug, e.g. "meals_entertainment", "groceries_personal".'}, 'currency': {'type': 'string', 'description': 'ISO 4217 currency code. E.g. "USD", "HKD".'}, 'merchant': {'type': 'string', 'description': 'Substring match against description or counterparty (case-insensitive).'}, 'amountMax': {'type': 'number', 'description': 'Inclusive maximum absolute amount.'}, 'amountMin': {'type': 'number', 'description': 'Inclusive minimum absolute amount.'}, 'dateStart': {'type': 'string', 'description': 'ISO date (YYYY-MM-DD). Inclusive lower bound.'}, 'direction': {'enum': ['credit', 'debit'], 'type': 'string', 'description': 'Semantic direction.'}}, 'description': 'Subset of transactions to operate on. All fields are optional and combined with AND logic.'}, 'metric': {'enum': ['sum', 'average', 'count', 'max', 'min'], 'type': 'string', 'description': 'Metric to rank by.'}, 'dimension': {'enum': ['month', 'category', 'merchant', 'account', 'currency'], 'type': 'string', 'description': 'Grouping dimension.'}}}
输出模式
{'type': 'object', '$defs': {'__schema0': {'anyOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'null'}, {'type': 'array', 'items': {'$ref': '#/$defs/__schema0'}}, {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}]}}, '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['scope', 'result'], 'properties': {'scope': {'type': 'object', 'required': ['documentCount', 'dateRange'], 'properties': {'dateRange': {'anyOf': [{'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string'}, 'from': {'type': 'string'}}, 'additionalProperties': False}, {'type': 'null'}]}, 'documentCount': {'type': 'number'}}, 'additionalProperties': False}, 'result': {'anyOf': [{'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}, {'type': 'array', 'items': {'type': 'object', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'$ref': '#/$defs/__schema0'}}}]}}, 'additionalProperties': False}
已更改
top_n
2026年10月1日 02:44
已更改
get_credits
2026年10月1日 02:44
已更改
get_credits
2026年9月27日 02:43
已添加
list_transfers
2026年9月17日 12:40
已添加
time_series
2026年9月17日 12:40
已添加
compare
2026年9月17日 12:40
已添加
top_n
2026年9月17日 12:40
已添加
group_by
2026年9月17日 12:40
已添加
aggregate
2026年9月17日 12:40
已添加
list_transactions
2026年9月17日 12:40
已添加
evaluate_benchmark
2026年9月17日 12:40
已添加
rate_statement
2026年9月17日 12:40
已添加
get_credits
2026年9月17日 12:40
已添加
dismiss_statement
2026年9月17日 12:40
已添加
list_statements
2026年9月17日 12:40
已添加
categorize_statement
2026年9月17日 12:40
已添加
get_statement
2026年9月17日 12:40
已添加
convert_statement
2026年9月17日 12:40
已添加
request_upload
2026年9月17日 12:40