{"name":"beancount","displayName":"Beancount.io MCP Server","version":"1.0.0","description":"Talk to your Beancount ledger from Claude, Cursor, and any MCP client.","endpoint":"https://beancount.io/api-gateway/mcp","transport":"streamable-http","transports":["streamable-http"],"capabilities":{"tools":{},"resources":{},"streaming":true},"tools":[{"name":"runBqlQuery","description":"Execute a BQL (Beancount Query Language) query against the user's ledger and return results. BQL: SELECT cols [WHERE expr] [GROUP BY] [ORDER BY] [LIMIT n] | JOURNAL | BALANCES. Columns: date, year, month, flag, payee, narration, account, number, currency, cost, change, balance, position, tags, links, meta. An unaggregated query returns one row per posting, not per transaction, so LIMIT 5 can span 3 transactions; GROUP BY and DISTINCT return one row per group or value. LIMIT bounds the returned rows. Reference: https://beancount.github.io/docs/beancount_query_language/","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","description":"The BQL query to execute"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["query"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"runBqlQueryStructured","description":"Execute BQL and return the typed table (column names, types, and rows) or structured text result. Uses the same query contract as REST JSON and GraphQL queryShell.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","description":"The BQL query to execute"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["query"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"resultType":{"type":"string","enum":["table","text"]},"rowCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Result rows returned, after LIMIT. An unaggregated query returns one row per posting (not per transaction); GROUP BY and DISTINCT return one row per group or value."},"truncated":{"type":"boolean","description":"True when the result hit the 1000-row ceiling and rows were dropped. Add a LIMIT or a narrower WHERE to see a complete result."},"table":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dtype":{"type":"string"}},"required":["name","dtype"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}]}}},"t":{"type":"string"}},"required":["types","rows"],"additionalProperties":false},"text":{"type":"object","properties":{"contents":{"type":"string"},"t":{"type":"string"}},"required":["contents"],"additionalProperties":false}},"required":["resultType","rowCount","truncated"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"listLedgers","description":"List the ledgers this credential can reach — every one when `page` and `limit` are omitted. A pinned credential returns its one ledger; for an unpinned credential, ledger tools take one of these as `ledger: owner/name`.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"page":{"description":"1-based page number, defaults to 1.","type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"description":"Page size, at most 100.","type":"integer","minimum":1,"maximum":100}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"array","items":{}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"checkLedger","description":"Check one ledger's validity in one call: bean-check errors with file and line, entry counts per directive type, and the latest commit.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"errors":{"type":"array","items":{}},"entriesCount":{"type":"array","items":{}},"latestCommit":{}},"required":["errors","entriesCount","latestCommit"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"getLedgerContext","description":"Read a ledger's working vocabulary in one call: attributes, open accounts, currencies, payees, years, and source files. Counts accompany truncated lists so a large ledger does not flood context.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payeeLimit":{"description":"How many payees to return; defaults to 50.","type":"integer","minimum":1,"maximum":500},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"attributes":{},"accounts":{"type":"array","items":{"type":"string"}},"currencies":{"type":"array","items":{"type":"string"}},"payees":{"type":"array","items":{"type":"string"}},"payeeCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"years":{"type":"array","items":{"type":"string"}},"sourceFiles":{"type":"array","items":{"type":"string"}},"sourceFileCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["attributes","accounts","currencies","payees","payeeCount","years","sourceFiles","sourceFileCount"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"getEntryContext","description":"Read the source context around one entry, addressed by the entry_hash listLedgerEntries returns; updateEntrySource and deleteEntrySource take the same hash and this result's sha256sum. Same data as the entry-context resource.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entryHash":{"type":"string","description":"The entry's hash."},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["entryHash"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"listLedgerEntries","description":"List journal entries, each with the entry_hash getEntryContext, updateEntrySource, and deleteEntrySource take. Narrows by account, filter, time, and directiveTypes; pages with limit and offset; total counts every match. Same data as the journal resource.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account":{"description":"Account filter, e.g. Assets:Bank.","type":"string"},"filter":{"description":"Filter expression: payee, narration, tag, or link.","type":"string"},"time":{"description":"Time expression, e.g. 2026-08.","type":"string"},"directiveTypes":{"description":"Directive types to include, e.g. [\"Transaction\"].","type":"array","items":{"type":"string"}},"limit":{"description":"Page size, 1-1000; defaults to 20.","type":"integer","minimum":1,"maximum":1000},"offset":{"description":"Entries to skip; defaults to 0.","type":"integer","minimum":0,"maximum":9007199254740991},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"total":{"type":"number"},"data":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"is_empty":{"type":"boolean"}},"required":["total","data","is_empty"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"listLedgerFiles","description":"List files and directories in the ledger repo, one directory level at a time, directories first.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dir_path":{"description":"Directory path to list. Omit for root; '.' is also accepted.","type":"string"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}}},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"type":{"type":"string","enum":["file","dir"]}},"required":["path","type"],"additionalProperties":false}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"readLedgerFiles","description":"Read one or more beancount ledger files in a single call. `content` is raw text; the 1-based startLine/endLine it spans and the file's totalLines come alongside it, not in the text. Use start_line/end_line per file to limit tokens for large files.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"File path within the ledger repo, e.g. 'main.bean'"},"start_line":{"description":"First line to return (1-based). Default: 1","type":"integer","minimum":1,"maximum":9007199254740991},"end_line":{"description":"Last line to return (inclusive). Default: end of file","type":"integer","minimum":1,"maximum":9007199254740991}},"required":["path"]},"description":"One or more files to read. Each entry may limit to a line range."},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["files"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"startLine":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"endLine":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalLines":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"content":{"type":"string"}},"required":["path","startLine","endLine","totalLines","content"],"additionalProperties":false}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"addLedgerEntries","description":"Append entries [{type,entry}] to the ledger. Supports transaction, commodity, price, note, balance, open, close, budget, document, event. Budget interval uses lowercase daily/weekly/monthly/quarterly/yearly. One posting per transaction may omit its amount and is written elided. An unbalanced transaction is refused with UNBALANCED, and entries that would add bean-check errors (a second open for an open account, a balance against an unopened account) with VALIDATION_FAILED naming each error, unless allowInvalid records them deliberately. ledger is required unless pinned.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entries":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"transaction"},"entry":{"type":"object","properties":{"date":{"type":"string"},"flag":{"type":"string"},"payee":{"anyOf":[{"type":"string"},{"type":"null"}]},"narration":{"anyOf":[{"type":"string"},{"type":"null"}]},"postings":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"units":{"anyOf":[{"type":"object","properties":{"number":{"type":"string"},"currency":{"type":"string"}},"required":["number","currency"],"additionalProperties":false},{"type":"null"}]},"price":{"anyOf":[{"type":"object","properties":{"number":{"type":"string"},"currency":{"type":"string"}},"required":["number","currency"],"additionalProperties":false},{"type":"null"}]},"flag":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["account"],"additionalProperties":false}},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"links":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"meta":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["date","flag","postings"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"open"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"},"currencies":{"type":"array","items":{"type":"string"}}},"required":["date","account","currencies"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"close"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"}},"required":["date","account"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"balance"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"},"amount":{"type":"object","properties":{"number":{"type":"string"},"currency":{"type":"string"}},"required":["number","currency"],"additionalProperties":false}},"required":["date","account","amount"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"price"},"entry":{"type":"object","properties":{"date":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"object","properties":{"number":{"type":"string"},"currency":{"type":"string"}},"required":["number","currency"],"additionalProperties":false}},"required":["date","currency","amount"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"commodity"},"entry":{"type":"object","properties":{"date":{"type":"string"},"currency":{"type":"string"}},"required":["date","currency"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"note"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"},"content":{"type":"string"}},"required":["date","account","content"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"budget"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"},"interval":{"type":"string","enum":["daily","weekly","monthly","quarterly","yearly"]},"amount":{"type":"object","properties":{"number":{"type":"string"},"currency":{"type":"string"}},"required":["number","currency"],"additionalProperties":false}},"required":["date","account","interval","amount"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"document"},"entry":{"type":"object","properties":{"date":{"type":"string"},"account":{"type":"string"},"filename":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"links":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["date","account","filename"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"event"},"entry":{"type":"object","properties":{"date":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}},"required":["date","type","description"],"additionalProperties":false}},"required":["type","entry"],"additionalProperties":false}]}},"allowInvalid":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["entries"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"success":{"type":"boolean"},"message":{"type":"string"},"files":{"type":"array","items":{"type":"string"}},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","success","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"appendLedgerText","description":"Append Beancount directive text as you would write it into a file; postings indented under their transaction. Routes each directive to its file by type and date (path overrides) and inserts it in date order. Max 50 directives. Non-directive text, and text introducing new bean-check errors (UNBALANCED when a transaction does not balance), are refused unless allowInvalid. dry_run returns the diff and projected errors without committing. Adds directives without rewriting files, unlike updateLedgerFiles. Syntax: https://beancount.github.io/docs/beancount_language_syntax/","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","description":"e.g. `2026-01-02 * \"Cafe\" \"\"` plus indented postings."},"path":{"description":"Target file; omit to auto-route.","type":"string"},"dry_run":{"default":false,"type":"boolean"},"allowInvalid":{"default":false,"type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["text"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"dry_run":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Directives parsed out of the text"},"diff":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"diff":{"type":"string"}},"required":["path","diff"],"additionalProperties":false},"description":"Unified diff per file; dry runs only"},"appendedUnsorted":{"type":"array","items":{"type":"string"},"description":"Files not in date order, so these went at the end"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","dry_run","count","diff","appendedUnsorted","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"insertReceiptTransaction","description":"Promote the caller-owned temporary receipt named by receiptObjectKey into receipt storage and append the confirmed transaction. input carries date, payee, description, postings [{account,amountNumber,amountCurrency}], and documentAccount. ledger is required unless pinned. Applies immediately.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"receiptObjectKey":{"type":"string","description":"Caller-owned temporary object key (starts with tmp/)"},"input":{"type":"object","properties":{"date":{"type":"string"},"payee":{"type":"string"},"description":{"type":"string"},"postings":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"amountNumber":{"type":"string","description":"Decimal amount string, e.g. '25.50'"},"amountCurrency":{"type":"string"}},"required":["account","amountNumber","amountCurrency"],"additionalProperties":false}},"documentAccount":{"type":"string","description":"Account the stored receipt document attaches to"}},"required":["date","payee","description","postings","documentAccount"],"additionalProperties":false},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["receiptObjectKey","input"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"success":{"type":"boolean"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","success","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"parseReceipt","description":"Parse the caller-owned temporary image/PDF named by objectKey and recommend accounts. Pinned credentials may omit ledger; others must select it. Consumes extraction and recommendation tokens, without inserting entries.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"objectKey":{"type":"string","description":"S3 object key of the uploaded receipt file (starts with tmp/)"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["objectKey"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}]},"payee":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"},"sourceAccount":{"type":"string"},"targetAccount":{"type":"string"}},"required":["date","payee","description","amount"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"parseFile","description":"Parse a caller-owned temporary upload into transaction rows. s3ObjectKey comes from the upload operation; fileFormat names the format (csv, pdf, xlsx, json, etc.). Consumes AI quota. Does not write ledger entries.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"s3ObjectKey":{"type":"string"},"fileFormat":{"type":"string"}},"required":["s3ObjectKey","fileFormat"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"payee":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"}},"required":["date","payee","description","amount"],"additionalProperties":false}}},"required":["rows"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"generateTempAssetUploadUrl","description":"Create a presigned PUT URL bound to the current user. Optional filename and mimeType preserve the upload metadata. Upload the bytes to uploadUrl before using objectKey in an ingestion workflow.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"anyOf":[{"type":"string"},{"type":"null"}]},"mimeType":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"uploadUrl":{"type":"string"},"objectKey":{"type":"string"},"expiresIn":{"type":"number"}},"required":["uploadUrl","objectKey","expiresIn"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"createLedgerFiles","description":"Create new text files in one atomic commit; each file gets plain UTF-8 content. Each new/resulting file is limited to 1 MiB of UTF-8 bytes, including dry runs. dry_run previews without committing: the same refusal as the commit, plus a unified diff per touched file and bean-check's verdict over the projected contents.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","description":"One sentence describing what these changes do. Shown to the user for approval and used verbatim as the commit message."},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"File path relative to ledger root"},"content":{"type":"string","description":"Plain UTF-8 text content of the whole file (NOT base64)."}},"required":["path","content"],"additionalProperties":false}},"dry_run":{"default":false,"description":"If true, validates all operations and returns a preview without committing.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["description","files"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"dry_run":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"operations":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"path":{"type":"string"}},"required":["operation","path"],"additionalProperties":false}},"diff":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"diff":{"type":"string"}},"required":["path","diff"],"additionalProperties":false},"description":"Unified diff per touched file for dry runs; empty on commits."},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","dry_run","count","operations","diff","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"updateLedgerFiles","description":"Change existing text files in one atomic commit: per file, either replace an exact text (old_string must appear exactly once) with new_string, or overwrite the whole file with content. Each new/resulting file is limited to 1 MiB of UTF-8 bytes, including dry runs. dry_run previews without committing: the same refusal as the commit, plus a unified diff per touched file and bean-check's verdict over the projected contents.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","description":"One sentence describing what these changes do. Shown to the user for approval and used verbatim as the commit message."},"files":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"object","properties":{"path":{"type":"string","description":"File path relative to ledger root"},"old_string":{"type":"string","description":"Exact text to replace — must appear exactly once in the file."},"new_string":{"type":"string","description":"Replacement text."}},"required":["path","old_string","new_string"],"additionalProperties":false},{"type":"object","properties":{"path":{"type":"string","description":"File path relative to ledger root"},"content":{"type":"string","description":"Plain UTF-8 text content of the whole file (NOT base64)."}},"required":["path","content"],"additionalProperties":false}]}},"dry_run":{"default":false,"description":"If true, validates all operations and returns a preview without committing.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["description","files"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"dry_run":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"operations":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"path":{"type":"string"}},"required":["operation","path"],"additionalProperties":false}},"diff":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"diff":{"type":"string"}},"required":["path","diff"],"additionalProperties":false},"description":"Unified diff per touched file for dry runs; empty on commits."},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","dry_run","count","operations","diff","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"deleteLedgerFiles","description":"Delete files in one atomic commit. Each new/resulting file is limited to 1 MiB of UTF-8 bytes, including dry runs. dry_run previews without committing: the same refusal as the commit, plus a unified diff per touched file and bean-check's verdict over the projected contents.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","description":"One sentence describing what these changes do. Shown to the user for approval and used verbatim as the commit message."},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"File path relative to ledger root"}},"required":["path"],"additionalProperties":false}},"dry_run":{"default":false,"description":"If true, validates all operations and returns a preview without committing.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["description","files"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"dry_run":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"operations":{"type":"array","items":{"type":"object","properties":{"operation":{"type":"string"},"path":{"type":"string"}},"required":["operation","path"],"additionalProperties":false}},"diff":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"diff":{"type":"string"}},"required":["path","diff"],"additionalProperties":false},"description":"Unified diff per touched file for dry runs; empty on commits."},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","dry_run","count","operations","diff","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"updateEntrySource","description":"Replace one entry's source text with newContent, addressed by entryHash (listLedgerEntries' entry_hash) and sha256sum from getEntryContext. Returns the entry's new hash as newEntryHash; the request's entryHash is stale after the commit. A replacement that would take a free ledger past its directive limit is RESOURCE_LIMIT_REACHED.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entryHash":{"type":"string"},"sha256sum":{"type":"string"},"newContent":{"type":"string"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["entryHash","sha256sum","newContent"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"message":{"type":"string"},"entryHash":{"type":"string"},"newSha256sum":{"type":"string"},"newEntryHash":{"type":"string","description":"The entry's public ID after the commit, re-read post-commit — use it for the next edit, not the request's entryHash."},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","message","entryHash","newSha256sum","newEntryHash","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"deleteEntrySource","description":"Delete one entry's source text, addressed by entryHash (listLedgerEntries' entry_hash) and sha256sum from getEntryContext.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entryHash":{"type":"string"},"sha256sum":{"type":"string"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["entryHash","sha256sum"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"message":{"type":"string"},"entryHash":{"type":"string"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","message","entryHash","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"deleteEntrySources","description":"Delete several entries' source text in one commit; entries is a list of {entryHash, sha256sum}. Returns the deleted count.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"entryHash":{"type":"string"},"sha256sum":{"type":"string"}},"required":["entryHash","sha256sum"],"additionalProperties":false}},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["entries"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"message":{"type":"string"},"deletedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","message","deletedCount","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"renameLedgerFile","description":"Move oldPath to newPath preserving content in one atomic commit. Refuses when oldPath is still `include`d unless updateIncludes rewrites those lines in the same commit. Pinned credentials can omit ledger.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"oldPath":{"type":"string"},"newPath":{"type":"string"},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"updateIncludes":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["oldPath","newPath"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string","description":"What was written and how many new bean-check errors it introduced."},"oldPath":{"type":"string"},"newPath":{"type":"string"},"updatedIncludes":{"type":"array","items":{"type":"string"}},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false},"description":"Files (and lines, when known) the write landed in"},"entryHashes":{"type":"array","items":{"type":"string"},"description":"Entry hashes the write created or touched, when known"},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"required":["summary","oldPath","newPath","updatedIncludes","wrote","entryHashes","validation"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"setLedgerStar","description":"Set starred:true to star a ledger or false to unstar it for the authenticated user. ledger selects owner/name and defaults to the credential pin.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"starred":{"type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["starred"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"isStarred":{"type":"boolean"},"message":{"type":"string"}},"required":["success","isStarred"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"refreshManagedPrices","description":"Re-fetch the ledger's managed price feeds now and return each source's status (the ledgerManagedPrices records). Never edits the ledger. ledger is required unless pinned.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"freshness":{"type":"string","enum":["recent","stale","unavailable"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["alias","freshness","error"],"additionalProperties":{}}}},"required":["sources"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"syncBankTransactions","description":"Pull new transactions from a linked bank into staging; nothing is written to the ledger. dry_run reports what would be pulled.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item_id":{"type":"string","description":"The linked bank's id (item_id)."},"dry_run":{"description":"Validate and report what would change, without changing anything.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["item_id"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false}},"entryHashes":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"additionalProperties":{}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"importStagedBankTransactions","description":"Write staged bank transactions into the ledger as directives, each booked against the given target account. dry_run returns the result and projected validation without committing.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"transactions":{"minItems":1,"type":"array","items":{"type":"object","properties":{"transaction_id":{"type":"string"},"target_account":{"type":"string","description":"The ledger account to book this against."},"source_account":{"type":"string"}},"required":["transaction_id","target_account"]},"description":"The staged transactions to write."},"filename":{"description":"Which ledger file to append to. Must exist.","type":"string"},"dry_run":{"description":"Validate and report what would change, without changing anything.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["transactions"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false}},"entryHashes":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"additionalProperties":{}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"discardStagedBankTransactions","description":"Remove staged bank transactions so they are never imported. dry_run reports what would be removed.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"transaction_ids":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The staged transactions to remove."},"dry_run":{"description":"Validate and report what would change, without changing anything.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["transaction_ids"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"summary":{"type":"string"},"wrote":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"line":{"description":"1-based line the directive landed on, when known","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["path"],"additionalProperties":false}},"entryHashes":{"type":"array","items":{"type":"string"}},"validation":{"type":"object","properties":{"errorsBefore":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorsAfter":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"newErrors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"source":{"description":"`file:line` of the offending directive, when known","type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["errorsBefore","errorsAfter","newErrors"],"additionalProperties":false}},"additionalProperties":{}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"reconcileBankAccounts","description":"Re-read which accounts a linked bank shares; accounts the bank no longer shares can be deleted along with their staged transactions. dry_run reports the changes without applying them.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item_id":{"type":"string","description":"The linked bank's id (item_id)."},"dry_run":{"description":"Validate and report what would change, without changing anything.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["item_id"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"mapBankAccount","description":"Point a linked bank account at a ledger account; replaces any existing mapping.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"type":"string","description":"The linked bank account's id (account_id)."},"ledger_account":{"type":"string","description":"The ledger account to map it to."},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["account_id","ledger_account"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"setBankAccountCurrency","description":"Set a linked bank account's currency; replaces the current value.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"type":"string","description":"The linked bank account's id (account_id)."},"currency":{"type":"string","description":"The account's currency, e.g. USD."},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["account_id","currency"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"refreshBankConnection","description":"Re-read a linked bank connection's health status from the bank.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item_id":{"type":"string","description":"The linked bank's id (item_id)."},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["item_id"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"unlinkBankConnection","description":"Sever a linked bank connection. Linking a new bank happens in a browser through the bank's own widget, not here. dry_run reports what would be removed.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item_id":{"type":"string","description":"The linked bank's id (item_id)."},"dry_run":{"description":"Validate and report what would change, without changing anything.","type":"boolean"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["item_id"]},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"listBankConnections","description":"List linked bank connections (item_id) and their accounts (account_id), the ids the bank sync, import, and connection tools take.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"connections":{"type":"array","items":{}},"accounts":{"type":"array","items":{}}},"required":["connections","accounts"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"listStagedBankTransactions","description":"List bank transactions staged for import (the ids importStagedBankTransactions and discardStagedBankTransactions take); optional accountId filter.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accountId":{"type":"string"},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"array","items":{}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"createPullRequest","description":"Propose a set of file changes as a pull request. Requires title, description, clearCommitMessage, and changes [{path,content}]; an omitted baseBranch targets main. A repository server failure is SERVICE_UNAVAILABLE naming the failed step.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"baseBranch":{"default":"main","type":"string"},"clearCommitMessage":{"type":"string","minLength":1},"fastForward":{"description":"Skip the diff-less verification and open the pull request even when the branch does not differ from base","anyOf":[{"type":"boolean"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"}},"required":["path","content"],"additionalProperties":false}},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["title","description","clearCommitMessage","changes"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"prNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prUrl":{"type":"string"},"baseBranch":{"description":"The created PR's actual base ref, read back — never a default","type":"string"},"headBranch":{"description":"The created PR's actual head ref, read back — never a default","type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"mergePullRequest","description":"Merge a pull request into its base branch; the merge applies immediately. A merge that would take a free ledger past its directive limit is RESOURCE_LIMIT_REACHED. A repository server failure is SERVICE_UNAVAILABLE naming the failed step.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"},"prNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The pull request's number."}},"required":["prNumber"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"prNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prUrl":{"type":"string"},"baseBranch":{"description":"The created PR's actual base ref, read back — never a default","type":"string"},"headBranch":{"description":"The created PR's actual head ref, read back — never a default","type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"rejectPullRequest","description":"Reject a pull request by closing it without merging; applies immediately.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"},"prNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The pull request's number."}},"required":["prNumber"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"prNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prUrl":{"type":"string"},"baseBranch":{"description":"The created PR's actual base ref, read back — never a default","type":"string"},"headBranch":{"description":"The created PR's actual head ref, read back — never a default","type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"createLedger","description":"Create a ledger owned by the authenticated user. Requires name; accepts description, private, and template: STARTER (default, including null) has options and accounts without transactions or opening balances; SAMPLE has demonstration transactions.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","maxLength":100,"pattern":"^[a-z0-9_-]+$","description":"The ledger's name: lowercase letters, numbers, hyphens, and underscores, up to 100 characters."},"description":{"description":"A short description shown with the ledger.","anyOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"true or omitted keeps the ledger visible only to its owner and collaborators; false makes it public, readable by anyone.","anyOf":[{"type":"boolean"},{"type":"null"}]},"template":{"description":"STARTER (the default) has options and accounts without transactions; SAMPLE has demonstration transactions.","anyOf":[{"type":"string","enum":["STARTER","SAMPLE"]},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fullName":{"type":"string"},"sshUrl":{"type":"string"},"httpUrl":{"type":"string"},"empty":{"type":"boolean"},"private":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"size":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissions":{"type":"object","properties":{"admin":{"type":"boolean"},"pull":{"type":"boolean"},"push":{"type":"boolean"}},"required":["admin","pull","push"],"additionalProperties":false},"isStarred":{"type":"boolean"}},"required":["id","name","fullName","sshUrl","httpUrl","empty","private","createdAt","updatedAt","size"],"additionalProperties":false},{"type":"object","properties":{"ledgerId":{"type":"string"}},"required":["ledgerId"],"additionalProperties":false}]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"updateLedger","description":"Change a ledger's name, description, or privacy; omitted fields stay as they are.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"pattern":"^[a-z0-9_-]+$","description":"The ledger's name: lowercase letters, numbers, hyphens, and underscores, up to 100 characters."},{"type":"null"}]},"description":{"description":"A short description shown with the ledger.","anyOf":[{"type":"string"},{"type":"null"}]},"private":{"description":"true makes the ledger visible only to its owner and collaborators; false makes it public, readable by anyone; omitted leaves it as it is.","anyOf":[{"type":"boolean"},{"type":"null"}]},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fullName":{"type":"string"},"sshUrl":{"type":"string"},"httpUrl":{"type":"string"},"empty":{"type":"boolean"},"private":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"size":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissions":{"type":"object","properties":{"admin":{"type":"boolean"},"pull":{"type":"boolean"},"push":{"type":"boolean"}},"required":["admin","pull","push"],"additionalProperties":false},"isStarred":{"type":"boolean"}},"required":["id","name","fullName","sshUrl","httpUrl","empty","private","createdAt","updatedAt","size"],"additionalProperties":false},{"type":"object","properties":{"ledgerId":{"type":"string"}},"required":["ledgerId"],"additionalProperties":false}]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"deleteLedger","description":"Permanently delete a ledger, including its history.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fullName":{"type":"string"},"sshUrl":{"type":"string"},"httpUrl":{"type":"string"},"empty":{"type":"boolean"},"private":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"size":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissions":{"type":"object","properties":{"admin":{"type":"boolean"},"pull":{"type":"boolean"},"push":{"type":"boolean"}},"required":["admin","pull","push"],"additionalProperties":false},"isStarred":{"type":"boolean"}},"required":["id","name","fullName","sshUrl","httpUrl","empty","private","createdAt","updatedAt","size"],"additionalProperties":false},{"type":"object","properties":{"ledgerId":{"type":"string"}},"required":["ledgerId"],"additionalProperties":false}]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"setLedgerCollaborator","description":"Add a collaborator to a ledger, or change an existing collaborator's permission (read, write, or admin).","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"collaborator":{"type":"string","minLength":1},"permission":{"description":"read, write, or admin; omitted or null uses the repository default.","anyOf":[{"type":"string","enum":["read","write","admin"]},{"type":"null"}]},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["collaborator"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"removeLedgerCollaborator","description":"Remove a collaborator's access to a ledger.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"collaborator":{"type":"string","minLength":1},"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"required":["collaborator"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}},{"name":"leaveLedger","description":"Remove the authenticated user's own access to a ledger they collaborate on.","inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ledger":{"description":"Target ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.","type":"string"}},"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retryAfter":{"type":"number"}},"required":["code","message","hint"],"additionalProperties":false}},"required":["ok"],"additionalProperties":false}}],"resources":[{"name":"transactionCategorySuggestions","description":"Suggest a target account for each supplied transaction using the ledger's open accounts and recent history. transactions is a JSON-encoded array of {rowIndex, date, payee, description, amount}. Requires assisted-categorization authority and consumes AI quota.","uriTemplate":"beancount://{owner}/{name}/import/suggest-categories{?transactions}","mimeType":"application/json"},{"name":"tempAssetDownloadUrl","description":"Presign a download for an objectKey owned by the current user. Returns downloadUrl and expiresIn in seconds. Foreign, malformed, and permanent object keys are refused.","uriTemplate":"beancount://temp-assets/download-url{?objectKey}","mimeType":"application/json"},{"name":"publicUserProfile","description":"Profile, activities, and repositories for username. Authenticated self-views retain existing private enrichment; other targets use the public view.","uriTemplate":"beancount://social/profile{?username}","mimeType":"application/json"},{"name":"userFollowers","description":"Public social discovery. page defaults to 1 and limit to 20; total is the page size. Upstream failure returns an empty page.","uriTemplate":"beancount://social/followers{?username,page,limit}","mimeType":"application/json"},{"name":"userFollowing","description":"Public social discovery. page defaults to 1 and limit to 20; total is the page size. Upstream failure returns an empty page.","uriTemplate":"beancount://social/following{?username,page,limit}","mimeType":"application/json"},{"name":"userStarredRepos","description":"Public social discovery. page defaults to 1 and limit to 20; total is the page size. Upstream failure returns an empty page.","uriTemplate":"beancount://social/starred-repositories{?username,page,limit}","mimeType":"application/json"},{"name":"getFeed","description":"Read your merged blog, release, and ledger activity. Requires a session or account-wide OAuth credential with ledger.read.","uriTemplate":"beancount://account/feed{?offset,limit,source,locale}","mimeType":"application/json"},{"name":"userProfile","description":"Read your account profile and limits. An explicit userId must be your own user ID.","uriTemplate":"beancount://account/profile{?userId}","mimeType":"application/json"},{"name":"health","description":"Public application health probe; not a dependency readiness check.","uriTemplate":"beancount://configuration/health","mimeType":"application/json"},{"name":"featureFlags","description":"Public static feature configuration. The legacy userId does not affect the result.","uriTemplate":"beancount://configuration/feature-flags{?userId}","mimeType":"application/json"},{"name":"ledgerArchive","description":"Download archive bytes as an MCP base64 blob, up to 8 MiB. `archive` is a Git reference and its format, `<ref>.zip` or `<ref>.tar.gz` (for example `main.zip`), as on REST. A larger archive is refused; read `beancount://{owner}/{name}/archive-download-url` for an HTTP URL that streams it at any size. Every call rechecks ledger read authority and spends the shared archive-download budget.","uriTemplate":"beancount://{owner}/{name}/archive/{archive}","mimeType":"application/octet-stream"},{"name":"ledgerAssetDownloadUrl","description":"Issue a presigned asset URL after resolving ledgerRepoId and checking current file-read authority. filename is relative to the repository's asset directory. The service enforces any credential ledger pin.","uriTemplate":"beancount://assets/download-url{?ledgerRepoId,filename}","mimeType":"application/json"},{"name":"ledgerArchiveDownloadUrl","description":"Get the authenticated HTTP URL for main.zip. Fetch it with the same session cookie, OAuth bearer token, or API key; no credential is embedded in the URL. This resource discovers a URL and does not deliver archive bytes.","uriTemplate":"beancount://{owner}/{name}/archive-download-url","mimeType":"application/json"},{"name":"pullRequestDetails","description":"Read pull request metadata, file statistics, and diff with current repository read authority.","uriTemplate":"beancount://{owner}/{name}/pull-request{?prNumber}","mimeType":"application/json"},{"name":"ledgerCollaborators","description":"List ledger collaborators and permissions. Requires ledger.admin and current collaborator-inspection authority. Defaults to page 1, limit 10.","uriTemplate":"beancount://{owner}/{name}/collaborators{?page,limit}","mimeType":"application/json"},{"name":"ledgerCollaboratorPermission","description":"Read one collaborator's permission and user information. Requires collaborator username, ledger.admin, and current collaborator-inspection authority.","uriTemplate":"beancount://{owner}/{name}/collaborators/permission{?collaborator}","mimeType":"application/json"},{"name":"latestLedgerCommit","description":"Read the latest commit on a ledger branch","uriTemplate":"beancount://{owner}/{name}/latest-commit{?branchName}","mimeType":"application/json"},{"name":"ledgerCommits","description":"List commits with branch and pagination controls","uriTemplate":"beancount://{owner}/{name}/commits{?branch,page,limit}","mimeType":"application/json"},{"name":"ledgerCommitDetails","description":"Read commit metadata, parents, file statistics, and unified diff","uriTemplate":"beancount://{owner}/{name}/commit-details{?sha}","mimeType":"application/json"},{"name":"ledgerJournal","description":"Read the journal with pagination and all subtype filters. Subtype filters are JSON-encoded string arrays.","uriTemplate":"beancount://{owner}/{name}/journal{?account,filter,time,limit,offset,directiveTypes,transactionSubtypes,documentSubtypes,customSubtypes}","mimeType":"application/json"},{"name":"ledgerPlaintextJournal","description":"Read Beancount journal text with account, time, and expression filters. Subtype filters are JSON-encoded string arrays.","uriTemplate":"beancount://{owner}/{name}/plaintext-journal{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerAccountJournal","description":"Read account entries with changes and running balances. Subtype filters are JSON-encoded string arrays.","uriTemplate":"beancount://{owner}/{name}/account-journal{?account,filter,time,filter_account,limit,offset,with_children,conversion,directiveTypes,transactionSubtypes,documentSubtypes,customSubtypes}","mimeType":"application/json"},{"name":"ledgerSourceFiles","description":"List the ledger's source files. Subtype filters are JSON-encoded string arrays.","uriTemplate":"beancount://{owner}/{name}/source-files","mimeType":"application/json"},{"name":"ledgerIncomeStatement","description":"Financial statement with account, filter, time, conversion, and interval parameters. Returns the same structured data as REST.","uriTemplate":"beancount://{owner}/{name}/statements/income-statement{?account,filter,time,conversion,interval,shape}","mimeType":"application/json"},{"name":"ledgerBalanceSheet","description":"Balance sheet with report-only current earnings in equity and its interval series under the configured account names. Accepts account, filter, time, conversion, interval, and shape; returns the same structured data as REST.","uriTemplate":"beancount://{owner}/{name}/statements/balance-sheet{?account,filter,time,conversion,interval,shape}","mimeType":"application/json"},{"name":"ledgerAccounts","description":"Account names, optionally restricted to open or closed accounts.","uriTemplate":"beancount://{owner}/{name}/accounts{?status}","mimeType":"application/json"},{"name":"ledgerOptions","description":"The effective Beancount options: title, the five account-root names, the current conversions and earnings accounts, comma rendering, and the operating currencies. Values are what the ledger resolves, defaults included, so a client need not parse option lines. `operatingCurrency` is what the ledger reports in; the currencies its postings use are a separate vocabulary read.","uriTemplate":"beancount://{owner}/{name}/options","mimeType":"application/json"},{"name":"accessibleLedgers","description":"List the caller's accessible ledgers, restricted to the credential's ledger pin when present","uriTemplate":"beancount://catalog/ledgers{?page,limit}","mimeType":"application/json"},{"name":"ownedLedgers","description":"List the caller's owned ledgers","uriTemplate":"beancount://catalog/ledgers/owned{?page,limit}","mimeType":"application/json"},{"name":"searchLedgers","description":"Search ledgers with ownership, visibility, sorting, and pagination filters","uriTemplate":"beancount://catalog/ledgers/search{?page,limit,q,topic,includeDesc,uid,priorityOwnerId,teamId,starredBy,private,isPrivate,template,archived,mode,exclusive,sort,order}","mimeType":"application/json"},{"name":"ledgerMetadata","description":"Read ledger metadata, visibility, repository URLs, and caller permissions.","uriTemplate":"beancount://{owner}/{name}/metadata","mimeType":"application/json"},{"name":"ledgerPayees","description":"Every payee that appears on a transaction. The list a client should reconcile against before inventing a new payee string.","uriTemplate":"beancount://{owner}/{name}/payees","mimeType":"application/json"},{"name":"ledgerNarrations","description":"Every narration string that appears on a transaction.","uriTemplate":"beancount://{owner}/{name}/narrations","mimeType":"application/json"},{"name":"ledgerCurrencies","description":"Every currency the ledger's postings are denominated in. Writing an entry in a currency absent from this list is usually a typo.","uriTemplate":"beancount://{owner}/{name}/currencies","mimeType":"application/json"},{"name":"ledgerTags","description":"Every `#tag` that appears on a directive.","uriTemplate":"beancount://{owner}/{name}/tags","mimeType":"application/json"},{"name":"ledgerLinks","description":"Every `^link` that appears on a directive.","uriTemplate":"beancount://{owner}/{name}/links","mimeType":"application/json"},{"name":"ledgerYears","description":"Every year that has at least one directive — the ledger's span, without reading it.","uriTemplate":"beancount://{owner}/{name}/years","mimeType":"application/json"},{"name":"ledgerCommodities","description":"Commodity pairs held in the ledger, with the prices recorded for them.","uriTemplate":"beancount://{owner}/{name}/commodities","mimeType":"application/json"},{"name":"ledgerManagedPrices","description":"One record per managed price include (`include \"https://beancount.io/prices/BTC-USD\"`): the feed's commodity pair and source, the revision serving, when it was observed and fetched, when it next refreshes, and `freshness` — `recent` within ten minutes of the latest observation, `stale` beyond it, `unavailable` when no revision has validated (then `error` says why). Check it before trusting a valuation built on a managed feed. Empty when the ledger has no managed include.","uriTemplate":"beancount://{owner}/{name}/managed-prices","mimeType":"application/json"},{"name":"ledgerEvents","description":"Event directives in date order, with optional account, time, and Fava-expression filters.","uriTemplate":"beancount://{owner}/{name}/events{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerErrors","description":"What `bean-check` reports for this ledger. An empty list means the ledger is currently valid.","uriTemplate":"beancount://{owner}/{name}/errors","mimeType":"application/json"},{"name":"ledgerAttributes","description":"Accounts, currencies, payees, and links as one document — the summary the other endpoints break out individually.","uriTemplate":"beancount://{owner}/{name}/attributes","mimeType":"application/json"},{"name":"ledgerOverview","description":"Net worth now and over time. `shape=summary` (the default) returns the net-worth series in one currency; `shape=fava` returns the account hierarchies and income/expense series the dashboard charts.","uriTemplate":"beancount://{owner}/{name}/overview{?account,filter,time,conversion,interval,shape}","mimeType":"application/json"},{"name":"ledgerDocuments","description":"Document directives with account, time, and Fava-expression filters.","uriTemplate":"beancount://{owner}/{name}/documents{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerTrialBalance","description":"Every account's debit and credit totals — the statement that proves the books balance.","uriTemplate":"beancount://{owner}/{name}/trial-balance{?account,filter,time,interval,conversion}","mimeType":"application/json"},{"name":"ledgerIntervalTotals","description":"Balances grouped by period — the series behind a spending-over-time view, without the view. `shape=summary` (the default) states one currency and drops zero accounts; `shape=fava` returns the raw per-currency balances.","uriTemplate":"beancount://{owner}/{name}/interval-totals{?account,filter,time,interval,conversion,accountName,shape}","mimeType":"application/json"},{"name":"ledgerAccountReport","description":"Balances and changes for a single account over the selected period.","uriTemplate":"beancount://{owner}/{name}/account-report/{accountName}{?account,filter,time,interval,conversion}","mimeType":"application/json"},{"name":"ledgerAccountLastEntries","description":"The most recent directive touching each account — how stale each part of the ledger is.","uriTemplate":"beancount://{owner}/{name}/account-last-entries{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerEntriesCount","description":"How many transactions, opens, balances, and so on the ledger holds.","uriTemplate":"beancount://{owner}/{name}/entries-count{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerPostingsPerAccount","description":"Posting counts for the filtered Statistics report stream. An account filter selects matching entries and counts every posting on those entries, including counterpart accounts. Time filters use the same clamped report stream as entries-count.","uriTemplate":"beancount://{owner}/{name}/postings-per-account{?account,filter,time}","mimeType":"application/json"},{"name":"ledgerPayeeTransactions","description":"The single most recent transaction recorded against this payee, or null if there is none. This is Fava's autocomplete lookup — a template for the next entry, not a history. For every transaction by a payee, query the journal or BQL instead.","uriTemplate":"beancount://{owner}/{name}/payee-transactions/{payee}","mimeType":"application/json"},{"name":"ledgerNarrationTransactions","description":"The single most recent transaction recorded against this narration string, or null if there is none. Fava's autocomplete lookup, like payee-transactions. An explicit empty narration is valid. In MCP, read `beancount://{owner}/{name}/narration-transactions?narration=` for empty text. Nonempty values also support the existing path alias `beancount://{owner}/{name}/narration-transactions/{narration}`; percent-encode the value once.","uriTemplate":"beancount://{owner}/{name}/narration-transactions{?narration}","mimeType":"application/json"},{"name":"ledgerPayeeAccounts","description":"Every account in the ledger, re-sorted by how recently and often this payee was booked against it (exponential decay). Accounts the payee never touched are still present, at the back — the leading entries are the suggestion, not the whole list. Reach for the first few when categorising a new transaction for this payee.","uriTemplate":"beancount://{owner}/{name}/payee-accounts/{payee}","mimeType":"application/json"},{"name":"ledgerEntryContext","description":"The ledger text surrounding a directive, addressed by its hash — what to read before editing it.","uriTemplate":"beancount://{owner}/{name}/entry-context/{entryHash}","mimeType":"application/json"},{"name":"ledgerAccountDirectives","description":"Each account's open and close directives — which accounts are usable on a given date.","uriTemplate":"beancount://{owner}/{name}/account-directives","mimeType":"application/json"},{"name":"bankList","description":"Every bank connection linked to this ledger.","uriTemplate":"beancount://{owner}/{name}/banks","mimeType":"application/json"},{"name":"bank","description":"Status and institution details for a single bank connection.","uriTemplate":"beancount://{owner}/{name}/banks/{itemId}","mimeType":"application/json"},{"name":"bankAccountsForItem","description":"The accounts one bank connection shares.","uriTemplate":"beancount://{owner}/{name}/banks/{itemId}/accounts","mimeType":"application/json"},{"name":"bankAccounts","description":"Accounts across every linked bank, with their institution and ledger-account mapping.","uriTemplate":"beancount://{owner}/{name}/bank-accounts","mimeType":"application/json"},{"name":"bankUnsyncedTransactions","description":"Transactions pulled from a bank that have not been written into the ledger — what `importStagedBankTransactions` writes.","uriTemplate":"beancount://{owner}/{name}/bank-transactions/unsynced{?accountId}","mimeType":"application/json"},{"name":"bankSuggestedCategories","description":"A ledger account suggested for each staged transaction, drawn from the ledger's own history. Requires ledger-content read, bank-connection read, and AI-use authority.","uriTemplate":"beancount://{owner}/{name}/bank-transactions/suggested-categories{?accountId}","mimeType":"application/json"},{"name":"bankSuggestedMapping","description":"Which ledger account each of a bank's accounts most likely corresponds to. Requires ledger-content read, bank-connection read, and AI-use authority.","uriTemplate":"beancount://{owner}/{name}/banks/{itemId}/suggested-mapping","mimeType":"application/json"},{"name":"ledgerFile","description":"The text of one file in the ledger repository, addressed by its path. Reading it needs no tool call, so an agent can pull a file into context without spending a tool slot.","uriTemplate":"beancount://{owner}/{name}/files/{+path}","mimeType":"text/plain"}],"auth":{"type":"oauth2","authorizationUrl":"https://beancount.io/api-gateway/oauth/auth","tokenUrl":"https://beancount.io/api-gateway/oauth/token","scopes":["ledger.read","ledger.write","ledger.admin"]},"openapi":"https://beancount.io/api-gateway/v1/openapi.json"}