Skip to main content
Glama

Taokeh MCP server

Import bank statement into the review queue (nothing posts)

import_bank_statement

Import a bank statement into Taokeh for reconciliation, from a statement you've read (PDF/CSV/image). This does NOT post to the books — every row lands in Banking → Review for the user to categorize and post line by line. FOREIGN-CURRENCY ACCOUNTS: a statement for an account whose currency is not ringgit still imports, but Taokeh books in ringgit and refuses to post or match that account's lines for now (intake_contract(doc_type:'statement') lists each account's currency) — say so instead of telling the user to post them. A statement is the bank's own list of transactions for ONE account over a period: use intake_contract(doc_type:'statement') first to see the tenant's bank accounts + the arithmetic law. Give the account id, the printed opening + closing balances, the printed statement date (statementDate) and beginning-balance date (beginningBalanceDate) when the statement shows them, and every transaction row (signed amount: + money in, − money out). The server checks opening + the rows tie to the closing balance and rejects with the exact delta if they don't — never invent or omit rows to force it to balance. CREDIT CARDS: a card statement can be filed here too, but ONLY with signConvention declared, because a card prints the opposite convention (a purchase INCREASES what you owe). Pass 'PRINTED_CARD' when the figures are exactly as the card statement prints them (the usual case) or 'STORED' if you deliberately converted them to Taokeh's convention (− = a spend). Never guess: declaring the wrong one books the whole month backwards and the arithmetic check cannot catch it, because negating every figure still ties out — the server runs a separate directional check and refuses a declaration that reads as a card which never owed anything. signConvention is refused on a bank account. Each card line is then expensed on its OWN statement date against the card, and the "payment received" line that settles the card bill is excluded automatically (the bank statement's lump owns that movement). Single receipts, invoices or bills go through their own draft doors, not here. ARCHIVING THE ORIGINAL: this import archives the statement file WHEN you send one — call request_attachment_upload FIRST, PUT the statement's raw bytes to its uploadUrl, then pass the returned attachmentToken here; the original is then kept on the statement (s.82 record-keeping) and the user can download it from the statement page, exactly as the web upload at Banking → Import does. Without a token nothing is archived and the books carry rows with no source document behind them. Already filed one bare? Call this tool AGAIN with the IDENTICAL account, balances and rows plus attachmentToken — the identical reading matches the same statement, so the file is ADOPTED onto it and no rows are staged twice. Filed one before without statementDate / beginningBalanceDate? The same identical call with the two dates added records them on that statement, again staging nothing twice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
bankAccountIdYes
statementDateNoThe statement date printed on the statement (the ENDING BALANCE date), YYYY-MM-DD — it is the end of the period the statement covers, even when the last transaction is earlier. Omit it only if the statement prints none.
closingBalanceYes
confirmOverlapNoSet to true ONLY after the user has confirmed this is a genuinely new, separate statement whose period overlaps one already imported. It bypasses the overlap guard that stops the same transactions being counted twice. Never set it to push an overlap through — ask the user first.
openingBalanceYes
signConventionNoREQUIRED when bankAccountId is a CREDIT CARD, and refused on a bank account. Which convention you signed the rows AND the opening/closing balances in. 'PRINTED_CARD' = exactly as the card statement prints them: a purchase is POSITIVE (what you owe goes up), a payment or refund is NEGATIVE, and the balances are the printed balances owed — this is the right choice when you read the card's own statement. 'STORED' = already converted to Taokeh's stored convention: a spend is NEGATIVE, a payment or refund POSITIVE, and the balances negative while money is owed. Do not guess between them: the wrong declaration books the entire month backwards, and the arithmetic check cannot catch it because negating every figure still ties out. Ask the user if unsure.
attachmentBytesNoThe decoded byte size of the ORIGINAL file on disk — send it alongside attachmentBase64 and the server rejects a truncated paste instead of filing a corrupt file.
attachmentTokenNoThe token from request_attachment_upload, AFTER you have PUT the statement bytes to its uploadUrl. This is the normal way to archive a statement PDF — it carries the file out-of-band (no base64 in this call). Mutually exclusive with attachmentBase64. The file is archived on the statement and the user downloads it from the statement page in Taokeh.
attachmentBase64NoThe ORIGINAL statement as base64 — SMALL files only (a few KB). A real bank statement PDF is never that small, so in practice use request_attachment_upload + attachmentToken instead. Mutually exclusive with attachmentToken. A bad type/oversize file is rejected and NOTHING is imported.
attachmentSha256NoThe SHA-256 of the ORIGINAL file as 64 hex chars — optional second check alongside attachmentBase64, so corrupted bytes are rejected instead of filed.
attachmentFilenameNoThe original filename, for the user browsing their statements.
attachmentMediaTypeNoThe attachment's MIME type, e.g. 'application/pdf'. Required when attachmentBase64 is given. It must match the file's bytes — a mismatch is refused and nothing is filed.
beginningBalanceDateNoThe date on the BEGINNING (opening) BALANCE line, YYYY-MM-DD — the start of the period. Every row must fall between it and statementDate. Omit it only if the statement prints none.
confirmSignConventionNoSet true ONLY after the user confirms that the card genuinely sat in CREDIT for the whole period. It bypasses the directional check that refuses a statement reading as a card which never owed anything — the usual cause of which is a printed statement declared 'STORED' (or the reverse). Never set it to push a refusal through: ask the user first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / attachmentMediaType / description
      Previous value: -"The attachment's MIME type, e.g. 'application/pdf'. Required when attachmentBase64 is given."New value: +"The attachment's MIME type, e.g. 'application/pdf'. Required when attachmentBase64 is given. It must match the file's bytes — a mismatch is refused and nothing is filed."
  2. Changed2 schema fields changed
    • addedInput schema / properties / beginningBalanceDate
      Added value: +{
      +  "description": "The date on the BEGINNING (opening) BALANCE line, YYYY-MM-DD — the start of the period. Every row must fall between it and statementDate. Omit it only if the statement prints none.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / statementDate
      Added value: +{
      +  "description": "The statement date printed on the statement (the ENDING BALANCE date), YYYY-MM-DD — it is the end of the period the statement covers, even when the last transaction is earlier. Omit it only if the statement prints none.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / confirmSignConvention
      Added value: +{
      +  "description": "Set true ONLY after the user confirms that the card genuinely sat in CREDIT for the whole period. It bypasses the directional check that refuses a statement reading as a card which never owed anything — the usual cause of which is a printed statement declared 'STORED' (or the reverse). Never set it to push a refusal through: ask the user first.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / signConvention
      Added value: +{
      +  "description": "REQUIRED when bankAccountId is a CREDIT CARD, and refused on a bank account. Which convention you signed the rows AND the opening/closing balances in. 'PRINTED_CARD' = exactly as the card statement prints them: a purchase is POSITIVE (what you owe goes up), a payment or refund is NEGATIVE, and the balances are the printed balances owed — this is the right choice when you read the card's own statement. 'STORED' = already converted to Taokeh's stored convention: a spend is NEGATIVE, a payment or refund POSITIVE, and the balances negative while money is owed. Do not guess between them: the wrong declaration books the entire month backwards, and the arithmetic check cannot catch it because negating every figure still ties out. Ask the user if unsure.",
      +  "enum": [
      +    "PRINTED_CARD",
      +    "STORED"
      +  ],
      +  "type": "string"
      +}
  4. Changed2 schema fields changed
    • addedInput schema / properties / attachmentBytes
      Added value: +{
      +  "description": "The decoded byte size of the ORIGINAL file on disk — send it alongside attachmentBase64 and the server rejects a truncated paste instead of filing a corrupt file.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedInput schema / properties / attachmentSha256
      Added value: +{
      +  "description": "The SHA-256 of the ORIGINAL file as 64 hex chars — optional second check alongside attachmentBase64, so corrupted bytes are rejected instead of filed.",
      +  "type": "string"
      +}
  5. Changed4 schema fields changed
    • addedInput schema / properties / attachmentBase64
      Added value: +{
      +  "description": "The ORIGINAL statement as base64 — SMALL files only (a few KB). A real bank statement PDF is never that small, so in practice use request_attachment_upload + attachmentToken instead. Mutually exclusive with attachmentToken. A bad type/oversize file is rejected and NOTHING is imported.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attachmentFilename
      Added value: +{
      +  "description": "The original filename, for the user browsing their statements.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attachmentMediaType
      Added value: +{
      +  "description": "The attachment's MIME type, e.g. 'application/pdf'. Required when attachmentBase64 is given.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attachmentToken
      Added value: +{
      +  "description": "The token from request_attachment_upload, AFTER you have PUT the statement bytes to its uploadUrl. This is the normal way to archive a statement PDF — it carries the file out-of-band (no base64 in this call). Mutually exclusive with attachmentBase64. The file is archived on the statement and the user downloads it from the statement page in Taokeh.",
      +  "type": "string"
      +}
  6. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations are only coarse defaults (readOnlyHint=false, destructiveHint=false, openWorldHint=false, idempotentHint=false), so the description carries the real behavioral burden and does: nothing posts, the server validates opening+rows against closing and rejects with the exact delta, foreign-currency accounts are refused for posting/matching, the card directional check runs separately because negating every figure still ties out, the card 'payment received' line is auto-excluded, and confirmOverlap/confirmSignConvention are guards not to be used to force a pass. The only nuance is the claim that an identical reading stages nothing twice, which reads as content-level dedup rather than the blanket idempotentHint flag — a soft tension, not a contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded well (purpose and 'nothing posts' come first) and every paragraph is on-topic, but it is a very long single block with heavy parentheticals and no structural breaks. Substantial content duplicates the schema almost verbatim, notably the signConvention PRINTED_CARD/STORED explanation and the confirmOverlap/attachmentToken guidance, which the rubric says earns no credit.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter, non-read-only import with no output schema, the description covers the full lifecycle: intake_contract prerequisite, required reading of the statement, the arithmetic tie-out, credit-card convention traps, foreign-currency refusal, the archiving workflow, overlap handling, and re-call adoption. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 73% and the per-parameter descriptions are already rich (signConvention, confirmOverlap, statementDate, beginningBalanceDate, and the whole attachment family are documented in the schema), so the baseline is high. The description does add meaning the schema lacks: rows are 'signed amount: + money in, − money out', the balances are the printed opening/closing figures, and the validity constraint that opening + rows must tie to closing. Those additions are real but incremental relative to the schema's own text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource (import a bank statement) and states the destination and the key consequence up front: 'This does NOT post to the books — every row lands in Banking → Review.' It also distinguishes itself from siblings by explicitly excluding them: 'Single receipts, invoices or bills go through their own draft doors, not here.' An agent can tell this apart from create_expense_draft, stage_document, or draft_bank_classification without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is spelled out with prerequisites and named alternatives: call intake_contract(doc_type:'statement') first, call request_attachment_upload first when archiving, and use signConvention='PRINTED_CARD' vs 'STORED' depending on how the figures were read. It gives explicit when-not cases (single receipts/invoices/bills go elsewhere; foreign-currency accounts must be flagged rather than told to post) and describes the re-call/adoption path for already-filed statements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources