jaz-clio 9.6.2 → 9.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-api
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill whenever you call, debug, or review code that touches the Jaz
6
6
  REST API. Covers field names, response shapes, 148 production gotchas, error
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-cli
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill when running Clio CLI commands, building shell scripts with
6
6
  Clio, debugging auth issues, understanding --json output, paginating results,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-conversion
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill when migrating accounting data into Jaz, importing from Xero,
6
6
  QuickBooks, Sage, MYOB, or Excel exports. Covers the full conversion pipeline:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-kit
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill when an accountant, bookkeeper, or owner is running real books
6
6
  in Jaz across one or more organizations from the terminal: setting up a
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-pseudo-sql
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill when answering ad-hoc data questions that aren't covered by
6
6
  download_export (canonical reports: anomaly, audit, aging, P&L, BS, GL,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-jobs
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill for recurring accounting workflows: month/quarter/year-end
6
6
  close, bank reconciliation, GST/VAT filing, payment runs, credit control,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-recipes
3
- version: 9.6.2
3
+ version: 9.6.3
4
4
  description: >-
5
5
  Use this skill when modeling complex multi-step accounting transactions:
6
6
  anything that spans multiple periods, involves changing amounts, or requires
package/cli.mjs CHANGED
@@ -761,14 +761,14 @@ bulk_finalize_drafts only handles invoices/bills/credit-notes; journals need thi
761
761
 
762
762
  Each row: resourceId plus any of reference, valueDate, notes, tags, saveAsDraft; omitted fields keep their value. Drafts only: rows send no lines, which a recorded (ACTIVE) journal requires; edit those with quick_fix_transactions or update_journal.
763
763
 
764
- Response: { updated: [{resourceId}], failed: [{resourceId, error, errorCode, status}], updatedCount, failedCount }. Per-row execution: partial results are normal; retry only failed[].resourceId. errorCode + status come from the underlying JazApiError when available.`,params:{items:{type:"array",description:"Journal updates (max 500). Each row needs resourceId; other fields optional.",items:{type:"object",properties:{resourceId:{type:"string",description:"Journal resourceId"},reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD"},notes:{type:"string"},tags:jo,saveAsDraft:{type:"boolean",description:"false = finalize (lift DRAFT to ACTIVE)"}},required:["resourceId"]}}},required:["items"],group:"journals",readOnly:!1,isDestructive:!0,searchHint:"bulk update finalize multiple draft journals at once batch promote",execute:async(e,t)=>{let r=t.items;ht(r,"items",500,"journal updates");let n=[],i=[];for(let o of r)try{let s=Ui(o.tags,"items[].tags"),a=s&&await Yo("journal",o.resourceId,()=>vs(e.client,o.resourceId));await FC(e.client,o.resourceId,{reference:o.reference,valueDate:o.valueDate,internalNotes:o.notes,tags:s&&Ki(a?.tags,s),saveAsDraft:o.saveAsDraft},a),n.push({resourceId:o.resourceId})}catch(s){let a=s instanceof Error?s.message:String(s),c={resourceId:o.resourceId,error:a};if(s instanceof gr){c.status=s.status;let u=s.body;if(u&&typeof u=="object"){let d=u.errorCode;typeof d=="string"&&(c.errorCode=d)}}i.push(c)}return{updated:n,failed:i,updatedCount:n.length,failedCount:i.length}}},{name:"import_bank_statement",description:`Import a bank statement from a URL or an attached file (max 10 MB). Processing is async; check magic workflows for status. ${rs}`,params:{accountResourceId:{type:"string",description:"Bank account resourceId to import into"},sourceUrl:{type:"string",description:"URL of the bank statement file"}},required:["accountResourceId"],acceptsHostFile:!0,group:"bank",readOnly:!1,searchHint:"import bank statement CSV OFX file upload",backgroundJob:dge("BANK_STATEMENT","sourceUrl","bank statement"),execute:async(e,t)=>{let r=SE({sourceUrl:t.sourceUrl});return[...r,...e.file_blob?["file"]:[]].length!==1?iA(["sourceUrl"],{provided:r,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"bank-reconciliation.modal.import-bank-feed"}):oC(e.client,{businessTransactionType:"BANK_STATEMENT",accountResourceId:t.accountResourceId,sourceUrl:t.sourceUrl,sourceFile:e.file_blob?.data,sourceFileName:e.file_blob?.fileName})}},{name:"add_bank_records",description:`Create bank statement entries via JSON POST (1-100 records per call). For CSV/OFX file imports, use import_bank_statement instead.
764
+ Response: { updated: [{resourceId}], failed: [{resourceId, error, errorCode, status}], updatedCount, failedCount }. Per-row execution: partial results are normal; retry only failed[].resourceId. errorCode + status come from the underlying JazApiError when available.`,params:{items:{type:"array",description:"Journal updates (max 500). Each row needs resourceId; other fields optional.",items:{type:"object",properties:{resourceId:{type:"string",description:"Journal resourceId"},reference:{type:"string"},valueDate:{type:"string",description:"YYYY-MM-DD"},notes:{type:"string"},tags:jo,saveAsDraft:{type:"boolean",description:"false = finalize (lift DRAFT to ACTIVE)"}},required:["resourceId"]}}},required:["items"],group:"journals",readOnly:!1,isDestructive:!0,searchHint:"bulk update finalize multiple draft journals at once batch promote",execute:async(e,t)=>{let r=t.items;ht(r,"items",500,"journal updates");let n=[],i=[];for(let o of r)try{let s=Ui(o.tags,"items[].tags"),a=s&&await Yo("journal",o.resourceId,()=>vs(e.client,o.resourceId));await FC(e.client,o.resourceId,{reference:o.reference,valueDate:o.valueDate,internalNotes:o.notes,tags:s&&Ki(a?.tags,s),saveAsDraft:o.saveAsDraft},a),n.push({resourceId:o.resourceId})}catch(s){let a=s instanceof Error?s.message:String(s),c={resourceId:o.resourceId,error:a};if(s instanceof gr){c.status=s.status;let u=s.body;if(u&&typeof u=="object"){let d=u.errorCode;typeof d=="string"&&(c.errorCode=d)}}i.push(c)}return{updated:n,failed:i,updatedCount:n.length,failedCount:i.length}}},{name:"import_bank_statement",description:`Import a bank statement from a URL or an attached file (max 10 MB). Processing is async; check magic workflows for status. ${rs}`,params:{accountResourceId:{type:"string",description:"Bank account resourceId to import into"},sourceUrl:{type:"string",description:"URL of the bank statement file"}},required:["accountResourceId"],acceptsHostFile:!0,group:"bank",readOnly:!1,fetchesCallerUrl:!0,searchHint:"import bank statement CSV OFX file upload",backgroundJob:dge("BANK_STATEMENT","sourceUrl","bank statement"),execute:async(e,t)=>{let r=SE({sourceUrl:t.sourceUrl});return[...r,...e.file_blob?["file"]:[]].length!==1?iA(["sourceUrl"],{provided:r,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"bank-reconciliation.modal.import-bank-feed"}):oC(e.client,{businessTransactionType:"BANK_STATEMENT",accountResourceId:t.accountResourceId,sourceUrl:t.sourceUrl,sourceFile:e.file_blob?.data,sourceFileName:e.file_blob?.fileName})}},{name:"add_bank_records",description:`Create bank statement entries via JSON POST (1-100 records per call). For CSV/OFX file imports, use import_bank_statement instead.
765
765
 
766
766
  Fields per record:
767
767
  - amount (required): positive = cash-in, negative = cash-out
768
768
  - transactionDate (required): YYYY-MM-DD
769
769
  - description, payerOrPayee, reference: optional strings
770
770
 
771
- Returns {data: {errors: []}} on success. accountResourceId must be a bank-type CoA account (find via list_bank_accounts).`,params:{accountResourceId:{type:"string",description:"Bank account resourceId (from list_bank_accounts)"},records:{type:"array",items:{type:"object",properties:{amount:{type:"number",description:"Positive = cash-in, negative = cash-out"},transactionDate:{type:"string",description:"Date (YYYY-MM-DD)"},description:{type:"string",description:"Description"},payerOrPayee:{type:"string",description:"Payer or payee name"},reference:{type:"string",description:"Reference"}},required:["amount","transactionDate"]},description:"Array of 1-100 bank records"}},required:["accountResourceId","records"],group:"bank",readOnly:!1,searchHint:"add manual bank transaction records entries",execute:async(e,t)=>gU(e.client,t.accountResourceId,t.records)},{name:"create_transaction_from_document",description:`Create a business transaction (invoice/bill/credit note/quote/order/purchase request) from a SINGLE file (max 10 MB), a URL, or raw HTML (e.g. an email body) using AI extraction. Processing is async: the result is a workflow id, not the record. ${rs} Quotes/orders land DRAFT/PENDING: relay the result \`next\`. When the host conversation provides a file with the call, omit all source arguments; the file is used automatically. For a FOLDER, a .zip, a Dropbox/Drive/OneDrive folder share link, or several/mixed documents at once, use classify_documents (then extract_documents) instead, not this per-file.`,params:{businessTransactionType:{type:"string",enum:[...qZ],description:"Type of transaction to create"},sourceUrl:{type:"string",description:"URL the Jaz server fetches, or a Telegram file link (downloaded here)."},attachmentId:{type:"string",description:'Pass "email-body" to use the inbound email body (email channel). No other attachment-id source.'},html:{type:"string",description:"Raw HTML (e.g. email body), rendered to PDF then extracted."},internalNotes:{type:"string",description:"Internal notes on the record (max 3000 chars)."}},required:["businessTransactionType"],group:"magic",readOnly:!1,acceptsHostFile:!0,searchHint:"create transaction from attachment URL or email HTML AI extraction",backgroundJob:dge("MAGIC_WORKFLOW","sourceUrl","document"),execute:async(e,t)=>{let r=t.businessTransactionType,n=t.internalNotes;if(t.attachmentId==="email-body"){let a=SE({sourceUrl:t.sourceUrl,html:t.html});if(a.length>0||e.file_blob)return iA(["attachmentId (email-body)","sourceUrl","html"],{provided:["attachmentId (email-body)",...a],hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let c=e.html_blob;return c?uge(r,await gf(e.client,{businessTransactionType:r,html:c,internalNotes:n})):vE('attachmentId "email-body" requires an inbound email body, and this run has none.',"That value only works on the email channel. Pass sourceUrl or html instead.")}if(t.attachmentId)return vE('This tool has no attachment-id source. "email-body" is the only accepted value, and only on the email channel.',`Use one of: ${tO({acceptsLocalPath:!1,acceptsAttachmentId:!1})}.`);let i=SE({sourceUrl:t.sourceUrl,html:t.html}),o=i.length+(e.file_blob?1:0);if(o===1&&e.file_blob)return uge(r,await gf(e.client,{businessTransactionType:r,sourceFile:e.file_blob.data,sourceFileName:e.file_blob.fileName,internalNotes:n}));if(o!==1)return iA(["sourceUrl","html"],{provided:i,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:GSr[r]??"purchases.modal.import-bills"});let s=t.sourceUrl;return uge(r,await gf(e.client,{businessTransactionType:r,sourceUrl:s,html:t.html,internalNotes:n}))}},{name:"get_magic_workflow_status",description:"Get the current status of specific magic workflow(s) by resourceId(s). Returns workflow details including status, document type, and results.",params:{workflowIds:{type:"array",items:{type:"string"},description:"One or more workflow resourceIds to check"}},required:["workflowIds"],group:"magic",readOnly:!0,searchHint:"check AI extraction workflow status progress",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>{let r=t.workflowIds;if(r.length===0)throw new Error("workflowIds must be non-empty");return Nlt(e,r,n=>RD(e.client,{filter:{resourceId:{in:n}},limit:n.length}))}},{name:"wait_for_magic_workflows",description:"Poll magic extraction workflow(s) until each reaches a terminal state (transaction created (a draft is ready), OCR succeeded/failed, or errored) or until the wait budget elapses. Use after create_transaction_from_document / extract_documents to know when drafts are ready; a workflow whose result said it runs in the background answers with that note instead. Returns each workflow's current status plus the still-pending ids; if any are still pending after the budget, call again to keep waiting. Batched into one request per poll.",params:{workflowIds:{type:"array",items:{type:"string"},description:"One or more magic workflow resourceIds to wait on."},maxWaitSeconds:{type:"number",description:"Maximum seconds to wait before returning current status (default 120). Returns immediately once all workflows are terminal."},pollIntervalSeconds:{type:"number",description:"Seconds between polls (default 5)."}},required:["workflowIds"],group:"magic",readOnly:!0,isConcurrencySafe:!0,maxResultSizeChars:2e4,searchHint:"wait for AI extraction workflows to finish poll until done",execute:async(e,t)=>{let r=t.workflowIds;if(!Array.isArray(r))throw new Error("workflowIds must be an array");if(r.length===0)return{allTerminal:!0,pending:[],timedOut:!1,workflows:[]};let n=(s,a,c)=>Math.min(c,Math.max(a,s)),i=n(typeof t.maxWaitSeconds=="number"?t.maxWaitSeconds:120,1,600),o=n(typeof t.pollIntervalSeconds=="number"?t.pollIntervalSeconds:5,2,60);return Nlt(e,r,async s=>{let a=await KZ(e.client,s,{timeout:i*1e3,interval:o*1e3});return{allTerminal:a.pending.length===0,pending:a.pending,timedOut:a.timedOut,workflows:a.workflows}})}},...DU,{name:"create_claim_from_attachment",description:`Create an employee-expense claim DRAFT from a receipt via AI extraction: from a SINGLE file, a URL (sourceURL), or raw HTML (e.g. an email body). When the host conversation provides a file with the call, omit all source arguments; the file is used automatically. On the email channel, pass attachmentId "email-body" to use the inbound email body. The draft is born BOUND to the uploader's own employee automatically; to file for someone else pass employeeResourceId (server requires a claims Manager/Admin). Optional contact, claim profile, currency, value date. Returns a workflow handle; the claim appears in Drafts asynchronously (no manual bind step). ${rs}`,params:{sourceURL:{type:"string",description:"URL of the receipt, or a Telegram file link (downloaded here)."},attachmentId:{type:"string",description:'Pass "email-body" to use the inbound email body (email channel). No other attachment-id source.'},html:{type:"string",description:"Raw HTML (e.g. email body), rendered to PDF then extracted."},contactResourceId:{type:"string",description:"Vendor/merchant contact to pre-bind (UUID)"},claimProfileResourceId:{type:"string",description:"Claim profile to bind on the draft (UUID)"},employeeResourceId:{type:"string",description:"Employee to file the claim for (UUIDv4). Omit to auto-bind the uploader's own employee; naming another requires a claims Manager/Admin."},currencyCode:{type:"string",description:"Currency override (ISO 4217)"},valueDate:{type:"string",description:"Value date override (YYYY-MM-DD)"},internalNotes:{type:"string",description:"Internal notes override"}},required:[],group:"magic",readOnly:!1,acceptsHostFile:!0,searchHint:"create claim draft from receipt attachment OCR extraction email body html",backgroundJob:dge("MAGIC_CLAIM","sourceURL","receipt"),execute:async(e,t)=>{let r={contactResourceId:t.contactResourceId,claimProfileResourceId:t.claimProfileResourceId,employeeResourceId:t.employeeResourceId,currencyCode:t.currencyCode,valueDate:t.valueDate,internalNotes:t.internalNotes};if(t.attachmentId==="email-body"){let o=SE({sourceURL:t.sourceURL,html:t.html});if(o.length>0||e.file_blob)return iA(["attachmentId (email-body)","sourceURL","html"],{provided:["attachmentId (email-body)",...o],hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let s=e.html_blob;return s?KI(e.client,{html:s,...r}):vE('attachmentId "email-body" requires an inbound email body, and this run has none.',"That value only works on the email channel. Pass sourceURL or html instead.")}if(t.attachmentId)return vE('Claims have no attachment-id source. "email-body" is the only accepted value, and only on the email channel.',`Use one of: ${tO({acceptsLocalPath:!1,acceptsAttachmentId:!1})}.`);let n=SE({sourceURL:t.sourceURL,html:t.html}),i=n.length+(e.file_blob?1:0);return i===1&&e.file_blob?KI(e.client,{sourceFile:e.file_blob.data,sourceFileName:e.file_blob.fileName,...r}):i!==1?iA(["sourceURL","html"],{provided:n,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"employees.modal.import-claims"}):KI(e.client,{sourceURL:t.sourceURL,html:t.html,...r})}},{name:"classify_documents",description:'Use this when the user points at a FOLDER, a .zip, a Dropbox / Google Drive / OneDrive folder share link, or a pile/batch of mixed documents. Sort a ZIP or share link of MIXED accounting documents: classifies each file into invoice / bill / customer credit note / supplier credit note / quote / order / purchase request / bank statement by its FOLDER NAME within the source (e.g. files under an "invoices/" folder become invoices), WITHOUT creating anything. Returns a manifest (per-file type + confidence + counts) plus a collectionId. If nothing is extractable it returns `hint` (why + what to do) and `summary.skippedExtensions`: relay it, do NOT call extract_documents; review it, then call extract_documents with that collectionId to create the drafts. The source is FETCHED BY THE JAZ SERVER: a direct .zip/file link, or a Dropbox / Google Drive / OneDrive share link. A local path works only when this tool runs on your own machine.',params:{source:{type:"string",description:"Fetched by the Jaz server: a direct .zip/file link or a Dropbox/Drive/OneDrive share link."},type:{type:"string",enum:[...tU],valueAliases:rU,description:"Optional: force every file to this type instead of auto-classifying by folder."}},acceptsHostFile:!0,required:[],group:"magic",readOnly:!1,searchHint:"classify auto-sort a Dropbox Google Drive OneDrive folder share link or zip or a pile batch of mixed invoices bills documents create docs from a folder link before extraction",maxResultSizeChars:2e4,execute:async(e,t)=>{if(t.source&&e.file_blob)return vE("Two sources: a `source` and an attached file. Provide exactly one.","Drop `source` to use the attached file, or omit the attachment to use `source`.");if(!t.source&&e.file_blob){let o=e.file_blob.fileName;if(!(oSr(o).toLowerCase()===".zip"||e.file_blob.data.type==="application/zip"))return vE(`classify_documents sorts a .zip or folder of many documents; "${o}" is a single file.`,"For one document use create_transaction_from_document with the same attached file.");let c=rSr(Yct(aSr(),"clio-hostfile-"));try{let u=Yct(c,"upload.zip");if(!Hct(u).startsWith(Hct(c)+sSr))throw new Error("refusing to write outside the temp directory");nSr(u,Buffer.from(await e.file_blob.data.arrayBuffer()));let d=await FD({source:c,type:t.type?eh(t.type)??void 0:void 0});return{...lAe(d),collectionId:pAe(d,e.client.scopeKey),...cAe(d)}}finally{try{iSr(c,{recursive:!0,force:!0})}catch{}}}let r=t.source;if(!r)return iA(["source"],{provided:[],hostFileAvailable:ih(e.mcpSurface),acceptsAttachmentId:!1});if(!/^https:\/\//i.test(r)&&!o8())return hat({acceptsAttachmentId:!1});let n=await FD({source:r,type:t.type?eh(t.type)??void 0:void 0}),i=pAe(n,e.client.scopeKey);return{...lAe(n),collectionId:i,...cAe(n)}}},{name:"extract_documents",description:`Create draft transactions from a classified document collection (see classify_documents). Uploads each file to the right AI-extraction endpoint (invoices/bills/credit notes via business-transaction extraction, bank statements via statement import), de-duplicates identical files, and returns the workflow ids (wait_for_magic_workflows reads them). Processing is async; drafts appear once the workflows reach a terminal state. ${rs} Pass the collectionId from classify_documents. Returns \`whereToSee[]\`: the screen each landed type appears on + its uploaded/failed split (+ \`next\` for quotes/orders): relay those links (no \`navigate\`) and, unless the result says it runs in the background, say drafts are still arriving. An unbuildable link is omitted, named in \`partialFailures\`.`,params:{collectionId:{type:"string",description:"The collectionId returned by classify_documents."},documentTypes:{type:"array",items:{type:"string",enum:[...tU],valueAliases:rU},description:"Optional: only extract these document types (default: every uploadable file in the collection)."},bankAccountId:{type:"string",description:"Bank account resourceId for bank-statement imports, required if the collection contains bank statements."},internalNotes:{type:"string",description:"Internal notes on every draft (max 3000 chars), e.g. the collectionId."}},required:["collectionId"],group:"magic",readOnly:!1,searchHint:"extract create drafts from a classified document collection invoices bills credit notes",maxResultSizeChars:2e4,backgroundJob:eDr,execute:async(e,t)=>{let{documentTypes:r,unresolved:n}=jlt(t);if(n.length>0)return{error:`Unrecognized documentTypes: ${n.join(", ")}.`,hint:`Use one or more of: ${tU.join(", ")}. Omit documentTypes entirely to extract everything in the collection.`};let i=e.client.scopeKey,o=t.collectionId,s=hAe(o,i);if(!s)throw new Error(`Collection "${o}" not found or expired; re-run classify_documents.`);let a=t.bankAccountId,c=await Iat({plan:s,client:e.client,bankAccountId:a,documentTypes:r,internalNotes:t.internalNotes});c.failed===0&&yat(o,i);let u=[...new Set(c.files.filter(p=>p.status==="uploaded").map(p=>p.type))],d=[],f=[];if(u.length>0){let{dashboardUrl:p}=$D(e.platform??"jaz");for(let h of u)try{let m=sOe[h];if(!m){f.push(`link for ${h} unavailable: no destination mapped`);continue}let A=m.key===null?void 0:qD(m.key,void 0,{dashboardUrl:p,orgResourceId:e.org?.resourceId}).url;d.push({type:h,label:m.label,...A?{url:A}:{},...m.next?{next:m.next}:{},uploaded:c.files.filter(g=>g.type===h&&g.status==="uploaded").length,failed:c.files.filter(g=>g.type===h&&g.status==="failed").length,...h==="BANK_STATEMENT"&&a?{bankAccountId:a}:{}})}catch(m){f.push(`link for ${h} unavailable: ${RE(m)}`)}}return{...f.length>0?{partialFailures:f}:{},...d.length>0?{whereToSee:d}:{},...c}}},{name:"get_attachments",description:`Get attachments for a record (${tge}).`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"}},required:["transactionType","transactionId"],group:"attachments",readOnly:!0,searchHint:"list attachments files on a transaction",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>gi(e.client,t.transactionType,t.transactionId)},{name:"add_attachment",description:`Add an attachment to a record (${tge}). Provide EXACTLY ONE source: sourceUrl (downloaded here, uploaded as bytes), attachmentId (links existing), or a file attached to the call. Two is refused.`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"},attachmentId:{type:"string",description:"Attachment ID to link (alternative to sourceUrl). Only: invoices, bills, journals, scheduled_journals, customer-credit-notes, supplier-credit-notes."},sourceUrl:{type:"string",description:"Source file URL, downloaded and uploaded as multipart file"},attachmentType:{type:"string",enum:["INTERNAL","EXTERNAL"],description:"Only: invoices, customer-credit-notes, sale-quotes, sale-orders, purchase-requests, purchase-orders."}},required:["transactionType","transactionId"],group:"attachments",readOnly:!1,acceptsHostFile:!0,searchHint:"upload attach file to a transaction",execute:async(e,t)=>{let r=SE({attachmentId:t.attachmentId,sourceUrl:t.sourceUrl});if(r.length+(e.file_blob?1:0)!==1){let s=t.transactionType;return iA(["attachmentId","sourceUrl"],{provided:r,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!XB.includes(s),fetchedBy:"agent"})}let n=t.transactionType;if(t.attachmentId&&XB.includes(n))return{error:`link-by-id (attachmentId) is not supported on ${n}.`,status:422,hint:`${n} accept file uploads only; pass sourceUrl instead of attachmentId.`,repair:{tool:"add_attachment",arguments:{transactionType:n,transactionId:t.transactionId},reason:"This record takes a file or a sourceUrl, not a link-by-id; re-send with one of those."}};let i,o;if(t.sourceUrl){let s=await df(t.sourceUrl),a=await wc(s,{timeoutMs:GI,maxBytes:wM});if(!a.ok)throw new Error(`Failed to download ${t.sourceUrl}: ${a.status}`);let c=await a.arrayBuffer(),u=a.headers.get("content-type")??"application/octet-stream";i=new Blob([c],{type:u}),o=th(t.sourceUrl,"attachment")}else!t.attachmentId&&e.file_blob&&(i=e.file_blob.data,o=e.file_blob.fileName);return XV(e.client,{businessTransactionType:t.transactionType,businessTransactionResourceId:t.transactionId,file:i,fileName:o,attachmentId:t.attachmentId,attachmentType:t.attachmentType})}},{name:"delete_attachment",description:`Delete an attachment from a record (${tge}).`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"},attachmentResourceId:{type:"string",description:"Attachment resourceId (from get_attachments response)"}},required:["transactionType","transactionId","attachmentResourceId"],group:"attachments",readOnly:!1,searchHint:"delete remove attachment file from transaction",isDestructive:!0,execute:async(e,t)=>{let r=t.transactionId,n=t.attachmentResourceId;Xi(r,"transactionId","Nothing was deleted. Source the transaction resourceId from a search_* result."),Xi(n,"attachmentResourceId","Nothing was deleted. Source the attachment resourceId from get_attachments.");let i=await ZV(e.client,t.transactionType,r,n);return Ult(i,"deleted","attachmentResourceId",n)}},{name:"read_spreadsheet_rows",description:"Parse rows from a CSV/Excel URL. Returns rows as JSON objects keyed by header (max 500/call, paginatable via offset/limit). Excel response includes availableSheets[]; re-call with sheetIndex if the first sheet is Instructions. Use BEFORE bulk_upsert_* when the user attaches a tabular file.",params:{sourceUrl:{type:"string",description:"URL of the CSV or Excel attachment."},offset:{type:"number",description:"0-based row offset. Default 0."},limit:{type:"number",description:"Rows to return (1-500). Default 200."},kind:{type:"string",description:"csv | excel. Auto-detected from URL/Content-Type if omitted.",enum:["csv","excel"]},sheetIndex:{type:"number",description:"Excel only: 0-based sheet index. Default 0. Response lists availableSheets[]."}},required:["sourceUrl"],group:"attachments",readOnly:!0,searchHint:"read parse csv excel xlsx file content rows columns from attachment url for bulk import upload spreadsheet",isConcurrencySafe:!0,maxResultSizeChars:6e4,execute:async(e,t)=>dst({sourceUrl:t.sourceUrl,offset:t.offset,limit:t.limit,kind:t.kind,sheetIndex:t.sheetIndex})},{name:"list_comment_threads",description:"List the comment threads on a bill, invoice, supplier credit note, customer credit note or bank record. A record has at most one open thread. Each thread returns its newest commentLimit comments, oldest first: 5 by default, 0 for counts only. commentsTruncated says when older ones exist; read them with list_comments. Times (createdAt, updatedAt, resolvedAt) are epoch milliseconds in UTC. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,bankAccountResourceId:Sv,limit:{type:"number",description:"Threads per page, 1 to 50. Default 20."},offset:fge,commentLimit:{type:"number",description:"Newest comments returned per thread, 0 to 50. Default 5; 0 returns counts only. Older ones: list_comments."}},required:["entityType","entityId"],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"comment threads discussion on a bill invoice credit note bank record, open or resolved, who said what, replies, mentions",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>{let r=mA(t);return tat(e.client,r.entityType,r.entityId,{bankAccountResourceId:r.bankAccountResourceId,limit:r.limit,offset:r.offset,commentLimit:r.commentLimit})}},{name:"list_comments",description:"Read the comments of one thread on a record, newest first, a page at a time. Use it for comments older than the ones list_comment_threads returned. Times (createdAt, updatedAt) are epoch milliseconds in UTC. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,bankAccountResourceId:Sv,limit:{type:"number",description:"Comments per page, 1 to 50. Default 20."},offset:fge},required:["entityType","entityId","threadId"],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"read older comments of one thread newest first, page through a long comment thread on a bill invoice credit note bank record",isConcurrencySafe:!0,execute:async(e,t)=>{let r=mA(t);return rat(e.client,r.entityType,r.entityId,r.threadId,{bankAccountResourceId:r.bankAccountResourceId,limit:r.limit,offset:r.offset})}},{name:"add_comment",description:"Post a comment on a bill, invoice, supplier credit note, customer credit note or bank record. The caller is the author, and the text is published under the caller's name as their own words to teammates: write it as the caller would, in the first person, never naming the caller or calling them the user, and never mentioning Clio or its permissions, rules or confirmations. Anything to ask the caller goes in the reply to the caller, not in a comment. A record has one open thread: without threadId the comment joins it or starts one, and a resolved thread accepts none. To mention someone, write <@userResourceId> in content where the name belongs, with the userResourceId from search_org_users (not the org-user record id); the saved text fills in the name. Only members whose own status is ACTIVE can be mentioned (the row's top-level status from search_org_users, not user.status; an invited member who has not joined is PENDING and cannot), at most 20: any other id refuses the whole comment. A plain @Name is just text and notifies no one. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,content:{type:"string",description:"Comment text, 1 to 4000 characters. Mentions are <@userResourceId> markup."},threadId:{type:"string",description:"Open thread to reply in. Omit it to join the open thread of the record, or start one."},bankAccountResourceId:Sv},required:["entityType","entityId","content"],group:"collaboration",readOnly:!1,searchHint:"add post write comment reply start thread mention a teammate on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return nat(e.client,r.entityType,r.entityId,{content:r.content,threadId:r.threadId},{bankAccountResourceId:r.bankAccountResourceId})}},{name:"update_comment",description:"Edit a comment the caller wrote, replacing its whole text, which stays the caller's own words to teammates: first person, never naming the caller or calling them the user, never mentioning Clio or its permissions, rules or confirmations. Anything to ask the caller goes in the reply to the caller, not in a comment. Only the author can, and only while its thread is open: a resolved thread refuses changes. Mentions work as in add_comment: write <@userResourceId> to add one, and keep the <Name@userResourceId> markup from content (text shows only @Name) for each mention to keep; leaving it out removes the mention. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,commentId:Blt,content:{type:"string",description:"New comment text, 1 to 4000 characters."},bankAccountResourceId:Sv},required:["entityType","entityId","threadId","commentId","content"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"edit change fix my own comment text on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return iat(e.client,r.entityType,r.entityId,r.threadId,r.commentId,{content:r.content},{bankAccountResourceId:r.bankAccountResourceId})}},{name:"delete_comment",description:"Delete a comment the caller wrote. Only the author can, and only while its thread is open: a resolved thread refuses changes. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,commentId:Blt,bankAccountResourceId:Sv},required:["entityType","entityId","threadId","commentId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"delete remove my own comment from a thread on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return oat(e.client,r.entityType,r.entityId,r.threadId,r.commentId,{bankAccountResourceId:r.bankAccountResourceId})}},{name:"mark_thread_resolved",description:"Resolve a comment thread on a record. A resolved thread accepts no new comments: the next comment without threadId starts a new thread. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,bankAccountResourceId:Sv},required:["entityType","entityId","threadId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"resolve close thread mark discussion done on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return sat(e.client,r.entityType,r.entityId,r.threadId,{bankAccountResourceId:r.bankAccountResourceId})}},{name:"list_notifications",description:"Notifications addressed to the caller: comments and mentions on records, newest first, unread by default. The Jaz API reads the newest 500 items of the last 365 days; truncated says when older ones exist. Each item names its record and threadId. Times (createdAt, readAt) are epoch milliseconds in UTC.",params:{status:{type:"string",enum:["unread","all"],description:"unread (default) or all."},limit:{type:"number",description:"Notifications per page, 1 to 50. Default 20."},offset:fge},required:[],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"notifications unread mentions comments on my records inbox what did I miss, newest first",isConcurrencySafe:!0,execute:async(e,t)=>{let r=mA(t);return aat(e.client,{status:r.status,limit:r.limit,offset:r.offset})}},{name:"mark_notification_read",description:"Mark one notification read, or unread with read set to false.",params:{notificationId:{type:"string",description:"Notification id from list_notifications."},read:{type:"boolean",description:"true marks it read (default), false marks it unread."}},required:["notificationId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"mark one notification read or unread, dismiss a mention or comment notification",execute:async(e,t)=>{let r=mA(t);return cat(e.client,r.notificationId,r.read!==!1)}},{name:"mark_all_notifications_read",description:"Mark every unread notification of the caller read. Returns marked and more: when more is true, call again.",params:{},required:[],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"mark all notifications read, clear the inbox, dismiss every unread mention and comment",execute:async e=>lat(e.client)},{name:"validate_invoice_draft",description:"Check if an invoice draft is ready to finalize. Returns missing fields, structured validation report, and ready status. Use before finalize_invoice to prevent errors.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate invoice draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=await go(e.client,r),i=await gi(e.client,"invoices",r);return ts(n.data,rl,i.data.length)}},{name:"validate_bill_draft",description:"Check if a bill draft is ready to finalize. Returns missing fields, structured validation report, and ready status. Use before finalize_bill to prevent errors.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate bill draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=await fo(e.client,r),i=await gi(e.client,"bills",r);return ts(n.data,xa,i.data.length)}},{name:"validate_journal_draft",description:"Check if a journal draft is ready to finalize. Returns missing fields (accounts, amounts, date), structured validation, and ready status.",params:{resourceId:{type:"string",description:"Journal resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate journal draft readiness for posting",isConcurrencySafe:!0,execute:async(e,t)=>{let r=await vs(e.client,t.resourceId);return ts(r.data,ou,0,"journalEntries")}},{name:"validate_credit_note_draft",description:"Check if a credit note draft (customer or supplier) is ready to finalize. Returns missing fields, structured validation, and ready status.",params:{resourceId:{type:"string",description:"Credit note resourceId"},type:{type:"string",enum:["customer","supplier"],description:'Credit note type: "customer" or "supplier"'}},required:["resourceId","type"],group:"drafts",readOnly:!0,searchHint:"validate credit note draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=t.type,i=n==="customer"?await Ws(e.client,r):await Ks(e.client,r),o=n==="customer"?"customer-credit-notes":"supplier-credit-notes",s=await gi(e.client,o,r);return ts(i.data,_o,s.data.length)}},br("list_bank_rules","List bank reconciliation rules (action shortcuts). Shows rule name, action type, and target bank account.","bank_rules",(e,t,r)=>u8(e,{limit:r,offset:t}),"list automatic bank reconciliation rules"),ri("get_bank_rule","Get full bank rule details including configuration (allocation percentages, accounts, tax settings).","bank_rules",(e,t)=>nO(e,t),"get bank rule details conditions actions"),Nt({name:"search_bank_rules",description:"Search bank rules.",group:"bank_rules",fields:fx,defaults:px,fetcher:d8,searchHint:"find bank rules auto-reconciliation matching criteria by name"}),{name:"create_bank_rule",description:`Bank reconciliation rule: auto-matches bank records. Use directly on request; don't just list existing.
771
+ Returns {data: {errors: []}} on success. accountResourceId must be a bank-type CoA account (find via list_bank_accounts).`,params:{accountResourceId:{type:"string",description:"Bank account resourceId (from list_bank_accounts)"},records:{type:"array",items:{type:"object",properties:{amount:{type:"number",description:"Positive = cash-in, negative = cash-out"},transactionDate:{type:"string",description:"Date (YYYY-MM-DD)"},description:{type:"string",description:"Description"},payerOrPayee:{type:"string",description:"Payer or payee name"},reference:{type:"string",description:"Reference"}},required:["amount","transactionDate"]},description:"Array of 1-100 bank records"}},required:["accountResourceId","records"],group:"bank",readOnly:!1,searchHint:"add manual bank transaction records entries",execute:async(e,t)=>gU(e.client,t.accountResourceId,t.records)},{name:"create_transaction_from_document",description:`Create a business transaction (invoice/bill/credit note/quote/order/purchase request) from a SINGLE file (max 10 MB), a URL, or raw HTML (e.g. an email body) using AI extraction. Processing is async: the result is a workflow id, not the record. ${rs} Quotes/orders land DRAFT/PENDING: relay the result \`next\`. When the host conversation provides a file with the call, omit all source arguments; the file is used automatically. For a FOLDER, a .zip, a Dropbox/Drive/OneDrive folder share link, or several/mixed documents at once, use classify_documents (then extract_documents) instead, not this per-file.`,params:{businessTransactionType:{type:"string",enum:[...qZ],description:"Type of transaction to create"},sourceUrl:{type:"string",description:"URL the Jaz server fetches, or a Telegram file link (downloaded here)."},attachmentId:{type:"string",description:'Pass "email-body" to use the inbound email body (email channel). No other attachment-id source.'},html:{type:"string",description:"Raw HTML (e.g. email body), rendered to PDF then extracted."},internalNotes:{type:"string",description:"Internal notes on the record (max 3000 chars)."}},required:["businessTransactionType"],group:"magic",readOnly:!1,fetchesCallerUrl:!0,acceptsHostFile:!0,searchHint:"create transaction from attachment URL or email HTML AI extraction",backgroundJob:dge("MAGIC_WORKFLOW","sourceUrl","document"),execute:async(e,t)=>{let r=t.businessTransactionType,n=t.internalNotes;if(t.attachmentId==="email-body"){let a=SE({sourceUrl:t.sourceUrl,html:t.html});if(a.length>0||e.file_blob)return iA(["attachmentId (email-body)","sourceUrl","html"],{provided:["attachmentId (email-body)",...a],hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let c=e.html_blob;return c?uge(r,await gf(e.client,{businessTransactionType:r,html:c,internalNotes:n})):vE('attachmentId "email-body" requires an inbound email body, and this run has none.',"That value only works on the email channel. Pass sourceUrl or html instead.")}if(t.attachmentId)return vE('This tool has no attachment-id source. "email-body" is the only accepted value, and only on the email channel.',`Use one of: ${tO({acceptsLocalPath:!1,acceptsAttachmentId:!1})}.`);let i=SE({sourceUrl:t.sourceUrl,html:t.html}),o=i.length+(e.file_blob?1:0);if(o===1&&e.file_blob)return uge(r,await gf(e.client,{businessTransactionType:r,sourceFile:e.file_blob.data,sourceFileName:e.file_blob.fileName,internalNotes:n}));if(o!==1)return iA(["sourceUrl","html"],{provided:i,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:GSr[r]??"purchases.modal.import-bills"});let s=t.sourceUrl;return uge(r,await gf(e.client,{businessTransactionType:r,sourceUrl:s,html:t.html,internalNotes:n}))}},{name:"get_magic_workflow_status",description:"Get the current status of specific magic workflow(s) by resourceId(s). Returns workflow details including status, document type, and results.",params:{workflowIds:{type:"array",items:{type:"string"},description:"One or more workflow resourceIds to check"}},required:["workflowIds"],group:"magic",readOnly:!0,searchHint:"check AI extraction workflow status progress",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>{let r=t.workflowIds;if(r.length===0)throw new Error("workflowIds must be non-empty");return Nlt(e,r,n=>RD(e.client,{filter:{resourceId:{in:n}},limit:n.length}))}},{name:"wait_for_magic_workflows",description:"Poll magic extraction workflow(s) until each reaches a terminal state (transaction created (a draft is ready), OCR succeeded/failed, or errored) or until the wait budget elapses. Use after create_transaction_from_document / extract_documents to know when drafts are ready; a workflow whose result said it runs in the background answers with that note instead. Returns each workflow's current status plus the still-pending ids; if any are still pending after the budget, call again to keep waiting. Batched into one request per poll.",params:{workflowIds:{type:"array",items:{type:"string"},description:"One or more magic workflow resourceIds to wait on."},maxWaitSeconds:{type:"number",description:"Maximum seconds to wait before returning current status (default 120). Returns immediately once all workflows are terminal."},pollIntervalSeconds:{type:"number",description:"Seconds between polls (default 5)."}},required:["workflowIds"],group:"magic",readOnly:!0,isConcurrencySafe:!0,maxResultSizeChars:2e4,searchHint:"wait for AI extraction workflows to finish poll until done",execute:async(e,t)=>{let r=t.workflowIds;if(!Array.isArray(r))throw new Error("workflowIds must be an array");if(r.length===0)return{allTerminal:!0,pending:[],timedOut:!1,workflows:[]};let n=(s,a,c)=>Math.min(c,Math.max(a,s)),i=n(typeof t.maxWaitSeconds=="number"?t.maxWaitSeconds:120,1,600),o=n(typeof t.pollIntervalSeconds=="number"?t.pollIntervalSeconds:5,2,60);return Nlt(e,r,async s=>{let a=await KZ(e.client,s,{timeout:i*1e3,interval:o*1e3});return{allTerminal:a.pending.length===0,pending:a.pending,timedOut:a.timedOut,workflows:a.workflows}})}},...DU,{name:"create_claim_from_attachment",description:`Create an employee-expense claim DRAFT from a receipt via AI extraction: from a SINGLE file, a URL (sourceURL), or raw HTML (e.g. an email body). When the host conversation provides a file with the call, omit all source arguments; the file is used automatically. On the email channel, pass attachmentId "email-body" to use the inbound email body. The draft is born BOUND to the uploader's own employee automatically; to file for someone else pass employeeResourceId (server requires a claims Manager/Admin). Optional contact, claim profile, currency, value date. Returns a workflow handle; the claim appears in Drafts asynchronously (no manual bind step). ${rs}`,params:{sourceURL:{type:"string",description:"URL of the receipt, or a Telegram file link (downloaded here)."},attachmentId:{type:"string",description:'Pass "email-body" to use the inbound email body (email channel). No other attachment-id source.'},html:{type:"string",description:"Raw HTML (e.g. email body), rendered to PDF then extracted."},contactResourceId:{type:"string",description:"Vendor/merchant contact to pre-bind (UUID)"},claimProfileResourceId:{type:"string",description:"Claim profile to bind on the draft (UUID)"},employeeResourceId:{type:"string",description:"Employee to file the claim for (UUIDv4). Omit to auto-bind the uploader's own employee; naming another requires a claims Manager/Admin."},currencyCode:{type:"string",description:"Currency override (ISO 4217)"},valueDate:{type:"string",description:"Value date override (YYYY-MM-DD)"},internalNotes:{type:"string",description:"Internal notes override"}},required:[],group:"magic",readOnly:!1,fetchesCallerUrl:!0,acceptsHostFile:!0,searchHint:"create claim draft from receipt attachment OCR extraction email body html",backgroundJob:dge("MAGIC_CLAIM","sourceURL","receipt"),execute:async(e,t)=>{let r={contactResourceId:t.contactResourceId,claimProfileResourceId:t.claimProfileResourceId,employeeResourceId:t.employeeResourceId,currencyCode:t.currencyCode,valueDate:t.valueDate,internalNotes:t.internalNotes};if(t.attachmentId==="email-body"){let o=SE({sourceURL:t.sourceURL,html:t.html});if(o.length>0||e.file_blob)return iA(["attachmentId (email-body)","sourceURL","html"],{provided:["attachmentId (email-body)",...o],hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let s=e.html_blob;return s?KI(e.client,{html:s,...r}):vE('attachmentId "email-body" requires an inbound email body, and this run has none.',"That value only works on the email channel. Pass sourceURL or html instead.")}if(t.attachmentId)return vE('Claims have no attachment-id source. "email-body" is the only accepted value, and only on the email channel.',`Use one of: ${tO({acceptsLocalPath:!1,acceptsAttachmentId:!1})}.`);let n=SE({sourceURL:t.sourceURL,html:t.html}),i=n.length+(e.file_blob?1:0);return i===1&&e.file_blob?KI(e.client,{sourceFile:e.file_blob.data,sourceFileName:e.file_blob.fileName,...r}):i!==1?iA(["sourceURL","html"],{provided:n,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"employees.modal.import-claims"}):KI(e.client,{sourceURL:t.sourceURL,html:t.html,...r})}},{name:"classify_documents",description:'Use this when the user points at a FOLDER, a .zip, a Dropbox / Google Drive / OneDrive folder share link, or a pile/batch of mixed documents. Sort a ZIP or share link of MIXED accounting documents: classifies each file into invoice / bill / customer credit note / supplier credit note / quote / order / purchase request / bank statement by its FOLDER NAME within the source (e.g. files under an "invoices/" folder become invoices), WITHOUT creating anything. Returns a manifest (per-file type + confidence + counts) plus a collectionId. If nothing is extractable it returns `hint` (why + what to do) and `summary.skippedExtensions`: relay it, do NOT call extract_documents; review it, then call extract_documents with that collectionId to create the drafts. The source is FETCHED BY THE JAZ SERVER: a direct .zip/file link, or a Dropbox / Google Drive / OneDrive share link. A local path works only when this tool runs on your own machine.',params:{source:{type:"string",description:"Fetched by the Jaz server: a direct .zip/file link or a Dropbox/Drive/OneDrive share link."},type:{type:"string",enum:[...tU],valueAliases:rU,description:"Optional: force every file to this type instead of auto-classifying by folder."}},acceptsHostFile:!0,required:[],group:"magic",readOnly:!1,searchHint:"classify auto-sort a Dropbox Google Drive OneDrive folder share link or zip or a pile batch of mixed invoices bills documents create docs from a folder link before extraction",maxResultSizeChars:2e4,execute:async(e,t)=>{if(t.source&&e.file_blob)return vE("Two sources: a `source` and an attached file. Provide exactly one.","Drop `source` to use the attached file, or omit the attachment to use `source`.");if(!t.source&&e.file_blob){let o=e.file_blob.fileName;if(!(oSr(o).toLowerCase()===".zip"||e.file_blob.data.type==="application/zip"))return vE(`classify_documents sorts a .zip or folder of many documents; "${o}" is a single file.`,"For one document use create_transaction_from_document with the same attached file.");let c=rSr(Yct(aSr(),"clio-hostfile-"));try{let u=Yct(c,"upload.zip");if(!Hct(u).startsWith(Hct(c)+sSr))throw new Error("refusing to write outside the temp directory");nSr(u,Buffer.from(await e.file_blob.data.arrayBuffer()));let d=await FD({source:c,type:t.type?eh(t.type)??void 0:void 0});return{...lAe(d),collectionId:pAe(d,e.client.scopeKey),...cAe(d)}}finally{try{iSr(c,{recursive:!0,force:!0})}catch{}}}let r=t.source;if(!r)return iA(["source"],{provided:[],hostFileAvailable:ih(e.mcpSurface),acceptsAttachmentId:!1});if(!/^https:\/\//i.test(r)&&!o8())return hat({acceptsAttachmentId:!1});let n=await FD({source:r,type:t.type?eh(t.type)??void 0:void 0}),i=pAe(n,e.client.scopeKey);return{...lAe(n),collectionId:i,...cAe(n)}}},{name:"extract_documents",description:`Create draft transactions from a classified document collection (see classify_documents). Uploads each file to the right AI-extraction endpoint (invoices/bills/credit notes via business-transaction extraction, bank statements via statement import), de-duplicates identical files, and returns the workflow ids (wait_for_magic_workflows reads them). Processing is async; drafts appear once the workflows reach a terminal state. ${rs} Pass the collectionId from classify_documents. Returns \`whereToSee[]\`: the screen each landed type appears on + its uploaded/failed split (+ \`next\` for quotes/orders): relay those links (no \`navigate\`) and, unless the result says it runs in the background, say drafts are still arriving. An unbuildable link is omitted, named in \`partialFailures\`.`,params:{collectionId:{type:"string",description:"The collectionId returned by classify_documents."},documentTypes:{type:"array",items:{type:"string",enum:[...tU],valueAliases:rU},description:"Optional: only extract these document types (default: every uploadable file in the collection)."},bankAccountId:{type:"string",description:"Bank account resourceId for bank-statement imports, required if the collection contains bank statements."},internalNotes:{type:"string",description:"Internal notes on every draft (max 3000 chars), e.g. the collectionId."}},required:["collectionId"],group:"magic",readOnly:!1,searchHint:"extract create drafts from a classified document collection invoices bills credit notes",maxResultSizeChars:2e4,backgroundJob:eDr,execute:async(e,t)=>{let{documentTypes:r,unresolved:n}=jlt(t);if(n.length>0)return{error:`Unrecognized documentTypes: ${n.join(", ")}.`,hint:`Use one or more of: ${tU.join(", ")}. Omit documentTypes entirely to extract everything in the collection.`};let i=e.client.scopeKey,o=t.collectionId,s=hAe(o,i);if(!s)throw new Error(`Collection "${o}" not found or expired; re-run classify_documents.`);let a=t.bankAccountId,c=await Iat({plan:s,client:e.client,bankAccountId:a,documentTypes:r,internalNotes:t.internalNotes});c.failed===0&&yat(o,i);let u=[...new Set(c.files.filter(p=>p.status==="uploaded").map(p=>p.type))],d=[],f=[];if(u.length>0){let{dashboardUrl:p}=$D(e.platform??"jaz");for(let h of u)try{let m=sOe[h];if(!m){f.push(`link for ${h} unavailable: no destination mapped`);continue}let A=m.key===null?void 0:qD(m.key,void 0,{dashboardUrl:p,orgResourceId:e.org?.resourceId}).url;d.push({type:h,label:m.label,...A?{url:A}:{},...m.next?{next:m.next}:{},uploaded:c.files.filter(g=>g.type===h&&g.status==="uploaded").length,failed:c.files.filter(g=>g.type===h&&g.status==="failed").length,...h==="BANK_STATEMENT"&&a?{bankAccountId:a}:{}})}catch(m){f.push(`link for ${h} unavailable: ${RE(m)}`)}}return{...f.length>0?{partialFailures:f}:{},...d.length>0?{whereToSee:d}:{},...c}}},{name:"get_attachments",description:`Get attachments for a record (${tge}).`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"}},required:["transactionType","transactionId"],group:"attachments",readOnly:!0,searchHint:"list attachments files on a transaction",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>gi(e.client,t.transactionType,t.transactionId)},{name:"add_attachment",description:`Add an attachment to a record (${tge}). Provide EXACTLY ONE source: sourceUrl (downloaded here, uploaded as bytes), attachmentId (links existing), or a file attached to the call. Two is refused.`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"},attachmentId:{type:"string",description:"Attachment ID to link (alternative to sourceUrl). Only: invoices, bills, journals, scheduled_journals, customer-credit-notes, supplier-credit-notes."},sourceUrl:{type:"string",description:"Source file URL, downloaded and uploaded as multipart file"},attachmentType:{type:"string",enum:["INTERNAL","EXTERNAL"],description:"Only: invoices, customer-credit-notes, sale-quotes, sale-orders, purchase-requests, purchase-orders."}},required:["transactionType","transactionId"],group:"attachments",readOnly:!1,fetchesCallerUrl:!0,acceptsHostFile:!0,searchHint:"upload attach file to a transaction",execute:async(e,t)=>{let r=SE({attachmentId:t.attachmentId,sourceUrl:t.sourceUrl});if(r.length+(e.file_blob?1:0)!==1){let s=t.transactionType;return iA(["attachmentId","sourceUrl"],{provided:r,hostFileAttached:!!e.file_blob,hostFileAvailable:ih(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!XB.includes(s),fetchedBy:"agent"})}let n=t.transactionType;if(t.attachmentId&&XB.includes(n))return{error:`link-by-id (attachmentId) is not supported on ${n}.`,status:422,hint:`${n} accept file uploads only; pass sourceUrl instead of attachmentId.`,repair:{tool:"add_attachment",arguments:{transactionType:n,transactionId:t.transactionId},reason:"This record takes a file or a sourceUrl, not a link-by-id; re-send with one of those."}};let i,o;if(t.sourceUrl){let s=await df(t.sourceUrl),a=await wc(s,{timeoutMs:GI,maxBytes:wM});if(!a.ok)throw new Error(`Failed to download ${t.sourceUrl}: ${a.status}`);let c=await a.arrayBuffer(),u=a.headers.get("content-type")??"application/octet-stream";i=new Blob([c],{type:u}),o=th(t.sourceUrl,"attachment")}else!t.attachmentId&&e.file_blob&&(i=e.file_blob.data,o=e.file_blob.fileName);return XV(e.client,{businessTransactionType:t.transactionType,businessTransactionResourceId:t.transactionId,file:i,fileName:o,attachmentId:t.attachmentId,attachmentType:t.attachmentType})}},{name:"delete_attachment",description:`Delete an attachment from a record (${tge}).`,params:{transactionType:rge,transactionId:{type:"string",description:"Record resourceId"},attachmentResourceId:{type:"string",description:"Attachment resourceId (from get_attachments response)"}},required:["transactionType","transactionId","attachmentResourceId"],group:"attachments",readOnly:!1,searchHint:"delete remove attachment file from transaction",isDestructive:!0,execute:async(e,t)=>{let r=t.transactionId,n=t.attachmentResourceId;Xi(r,"transactionId","Nothing was deleted. Source the transaction resourceId from a search_* result."),Xi(n,"attachmentResourceId","Nothing was deleted. Source the attachment resourceId from get_attachments.");let i=await ZV(e.client,t.transactionType,r,n);return Ult(i,"deleted","attachmentResourceId",n)}},{name:"read_spreadsheet_rows",description:"Parse rows from a CSV/Excel URL. Returns rows as JSON objects keyed by header (max 500/call, paginatable via offset/limit). Excel response includes availableSheets[]; re-call with sheetIndex if the first sheet is Instructions. Use BEFORE bulk_upsert_* when the user attaches a tabular file.",params:{sourceUrl:{type:"string",description:"URL of the CSV or Excel attachment."},offset:{type:"number",description:"0-based row offset. Default 0."},limit:{type:"number",description:"Rows to return (1-500). Default 200."},kind:{type:"string",description:"csv | excel. Auto-detected from URL/Content-Type if omitted.",enum:["csv","excel"]},sheetIndex:{type:"number",description:"Excel only: 0-based sheet index. Default 0. Response lists availableSheets[]."}},required:["sourceUrl"],group:"attachments",readOnly:!0,fetchesCallerUrl:!0,searchHint:"read parse csv excel xlsx file content rows columns from attachment url for bulk import upload spreadsheet",isConcurrencySafe:!0,maxResultSizeChars:6e4,execute:async(e,t)=>dst({sourceUrl:t.sourceUrl,offset:t.offset,limit:t.limit,kind:t.kind,sheetIndex:t.sheetIndex})},{name:"list_comment_threads",description:"List the comment threads on a bill, invoice, supplier credit note, customer credit note or bank record. A record has at most one open thread. Each thread returns its newest commentLimit comments, oldest first: 5 by default, 0 for counts only. commentsTruncated says when older ones exist; read them with list_comments. Times (createdAt, updatedAt, resolvedAt) are epoch milliseconds in UTC. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,bankAccountResourceId:Sv,limit:{type:"number",description:"Threads per page, 1 to 50. Default 20."},offset:fge,commentLimit:{type:"number",description:"Newest comments returned per thread, 0 to 50. Default 5; 0 returns counts only. Older ones: list_comments."}},required:["entityType","entityId"],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"comment threads discussion on a bill invoice credit note bank record, open or resolved, who said what, replies, mentions",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>{let r=mA(t);return tat(e.client,r.entityType,r.entityId,{bankAccountResourceId:r.bankAccountResourceId,limit:r.limit,offset:r.offset,commentLimit:r.commentLimit})}},{name:"list_comments",description:"Read the comments of one thread on a record, newest first, a page at a time. Use it for comments older than the ones list_comment_threads returned. Times (createdAt, updatedAt) are epoch milliseconds in UTC. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,bankAccountResourceId:Sv,limit:{type:"number",description:"Comments per page, 1 to 50. Default 20."},offset:fge},required:["entityType","entityId","threadId"],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"read older comments of one thread newest first, page through a long comment thread on a bill invoice credit note bank record",isConcurrencySafe:!0,execute:async(e,t)=>{let r=mA(t);return rat(e.client,r.entityType,r.entityId,r.threadId,{bankAccountResourceId:r.bankAccountResourceId,limit:r.limit,offset:r.offset})}},{name:"add_comment",description:"Post a comment on a bill, invoice, supplier credit note, customer credit note or bank record. The caller is the author, and the text is published under the caller's name as their own words to teammates: write it as the caller would, in the first person, never naming the caller or calling them the user, and never mentioning Clio or its permissions, rules or confirmations. Anything to ask the caller goes in the reply to the caller, not in a comment. A record has one open thread: without threadId the comment joins it or starts one, and a resolved thread accepts none. To mention someone, write <@userResourceId> in content where the name belongs, with the userResourceId from search_org_users (not the org-user record id); the saved text fills in the name. Only members whose own status is ACTIVE can be mentioned (the row's top-level status from search_org_users, not user.status; an invited member who has not joined is PENDING and cannot), at most 20: any other id refuses the whole comment. A plain @Name is just text and notifies no one. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,content:{type:"string",description:"Comment text, 1 to 4000 characters. Mentions are <@userResourceId> markup."},threadId:{type:"string",description:"Open thread to reply in. Omit it to join the open thread of the record, or start one."},bankAccountResourceId:Sv},required:["entityType","entityId","content"],group:"collaboration",readOnly:!1,searchHint:"add post write comment reply start thread mention a teammate on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return nat(e.client,r.entityType,r.entityId,{content:r.content,threadId:r.threadId},{bankAccountResourceId:r.bankAccountResourceId})}},{name:"update_comment",description:"Edit a comment the caller wrote, replacing its whole text, which stays the caller's own words to teammates: first person, never naming the caller or calling them the user, never mentioning Clio or its permissions, rules or confirmations. Anything to ask the caller goes in the reply to the caller, not in a comment. Only the author can, and only while its thread is open: a resolved thread refuses changes. Mentions work as in add_comment: write <@userResourceId> to add one, and keep the <Name@userResourceId> markup from content (text shows only @Name) for each mention to keep; leaving it out removes the mention. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,commentId:Blt,content:{type:"string",description:"New comment text, 1 to 4000 characters."},bankAccountResourceId:Sv},required:["entityType","entityId","threadId","commentId","content"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"edit change fix my own comment text on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return iat(e.client,r.entityType,r.entityId,r.threadId,r.commentId,{content:r.content},{bankAccountResourceId:r.bankAccountResourceId})}},{name:"delete_comment",description:"Delete a comment the caller wrote. Only the author can, and only while its thread is open: a resolved thread refuses changes. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,commentId:Blt,bankAccountResourceId:Sv},required:["entityType","entityId","threadId","commentId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"delete remove my own comment from a thread on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return oat(e.client,r.entityType,r.entityId,r.threadId,r.commentId,{bankAccountResourceId:r.bankAccountResourceId})}},{name:"mark_thread_resolved",description:"Resolve a comment thread on a record. A resolved thread accepts no new comments: the next comment without threadId starts a new thread. Bank records need bankAccountResourceId.",params:{entityType:wv,entityId:vv,threadId:e3,bankAccountResourceId:Sv},required:["entityType","entityId","threadId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"resolve close thread mark discussion done on a bill invoice credit note bank record",execute:async(e,t)=>{let r=mA(t);return sat(e.client,r.entityType,r.entityId,r.threadId,{bankAccountResourceId:r.bankAccountResourceId})}},{name:"list_notifications",description:"Notifications addressed to the caller: comments and mentions on records, newest first, unread by default. The Jaz API reads the newest 500 items of the last 365 days; truncated says when older ones exist. Each item names its record and threadId. Times (createdAt, readAt) are epoch milliseconds in UTC.",params:{status:{type:"string",enum:["unread","all"],description:"unread (default) or all."},limit:{type:"number",description:"Notifications per page, 1 to 50. Default 20."},offset:fge},required:[],group:"collaboration",readOnly:!0,noCache:!0,searchHint:"notifications unread mentions comments on my records inbox what did I miss, newest first",isConcurrencySafe:!0,execute:async(e,t)=>{let r=mA(t);return aat(e.client,{status:r.status,limit:r.limit,offset:r.offset})}},{name:"mark_notification_read",description:"Mark one notification read, or unread with read set to false.",params:{notificationId:{type:"string",description:"Notification id from list_notifications."},read:{type:"boolean",description:"true marks it read (default), false marks it unread."}},required:["notificationId"],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"mark one notification read or unread, dismiss a mention or comment notification",execute:async(e,t)=>{let r=mA(t);return cat(e.client,r.notificationId,r.read!==!1)}},{name:"mark_all_notifications_read",description:"Mark every unread notification of the caller read. Returns marked and more: when more is true, call again.",params:{},required:[],group:"collaboration",readOnly:!1,isDestructive:!0,searchHint:"mark all notifications read, clear the inbox, dismiss every unread mention and comment",execute:async e=>lat(e.client)},{name:"validate_invoice_draft",description:"Check if an invoice draft is ready to finalize. Returns missing fields, structured validation report, and ready status. Use before finalize_invoice to prevent errors.",params:{resourceId:{type:"string",description:"Invoice resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate invoice draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=await go(e.client,r),i=await gi(e.client,"invoices",r);return ts(n.data,rl,i.data.length)}},{name:"validate_bill_draft",description:"Check if a bill draft is ready to finalize. Returns missing fields, structured validation report, and ready status. Use before finalize_bill to prevent errors.",params:{resourceId:{type:"string",description:"Bill resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate bill draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=await fo(e.client,r),i=await gi(e.client,"bills",r);return ts(n.data,xa,i.data.length)}},{name:"validate_journal_draft",description:"Check if a journal draft is ready to finalize. Returns missing fields (accounts, amounts, date), structured validation, and ready status.",params:{resourceId:{type:"string",description:"Journal resourceId"}},required:["resourceId"],group:"drafts",readOnly:!0,searchHint:"validate journal draft readiness for posting",isConcurrencySafe:!0,execute:async(e,t)=>{let r=await vs(e.client,t.resourceId);return ts(r.data,ou,0,"journalEntries")}},{name:"validate_credit_note_draft",description:"Check if a credit note draft (customer or supplier) is ready to finalize. Returns missing fields, structured validation, and ready status.",params:{resourceId:{type:"string",description:"Credit note resourceId"},type:{type:"string",enum:["customer","supplier"],description:'Credit note type: "customer" or "supplier"'}},required:["resourceId","type"],group:"drafts",readOnly:!0,searchHint:"validate credit note draft readiness for finalization",isConcurrencySafe:!0,execute:async(e,t)=>{let r=t.resourceId,n=t.type,i=n==="customer"?await Ws(e.client,r):await Ks(e.client,r),o=n==="customer"?"customer-credit-notes":"supplier-credit-notes",s=await gi(e.client,o,r);return ts(i.data,_o,s.data.length)}},br("list_bank_rules","List bank reconciliation rules (action shortcuts). Shows rule name, action type, and target bank account.","bank_rules",(e,t,r)=>u8(e,{limit:r,offset:t}),"list automatic bank reconciliation rules"),ri("get_bank_rule","Get full bank rule details including configuration (allocation percentages, accounts, tax settings).","bank_rules",(e,t)=>nO(e,t),"get bank rule details conditions actions"),Nt({name:"search_bank_rules",description:"Search bank rules.",group:"bank_rules",fields:fx,defaults:px,fetcher:d8,searchHint:"find bank rules auto-reconciliation matching criteria by name"}),{name:"create_bank_rule",description:`Bank reconciliation rule: auto-matches bank records. Use directly on request; don't just list existing.
772
772
 
773
773
  Required: name, appliesToReconciliationAccount (bank account UUID, no "ResourceId" suffix), configuration.
774
774
 
@@ -802,7 +802,7 @@ accountResourceId + taxProfileResourceId apply to ALL line items (immutable). in
802
802
 
803
803
  Dynamic strings (reference/lineItem name/notes): ${fO}, relative to transaction date.`,params:{interval:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Billing interval, sent as `repeat`. QUARTERLY is rejected with 422."},startDate:{type:"string",description:"Start date (YYYY-MM-DD)"},endDate:{type:"string",description:"End date (YYYY-MM-DD, optional for ongoing)"},contactResourceId:{type:"string",description:"Customer contact resourceId"},reference:{type:"string",description:"Invoice reference (REQUIRED). Supports dynamic strings: {{Month}}, {{Year}}, etc."},valueDate:{type:"string",description:"Invoice date (YYYY-MM-DD)"},dueDate:{type:"string",description:"Due date (YYYY-MM-DD)"},accountResourceId:{type:"string",description:"Revenue account resourceId (applied to ALL line items; must be same)"},taxProfileResourceId:{type:"string",description:"Tax profile resourceId (applied to ALL line items; must be same)"},lineItems:{type:"array",items:{type:"object",properties:{name:{type:"string"},unitPrice:{type:"number"},quantity:{type:"number"}},required:["name","unitPrice","quantity"]},description:"Line items (name, unitPrice, quantity only; account/tax set at top level)"},proratedConfig:{type:"object",description:"Optional prorated-period customization. All fields optional.",properties:{proratedStartDate:{type:"string",description:"Prorated window start (YYYY-MM-DD). Defaults to subscription startDate."},proratedAdjustmentLineText:{type:"string",description:'Adjustment line label on the prorated invoice (default "Prorated adjustment").'},itemResourceId:{type:"string",description:"Non-inventory item resourceId (UUIDv4) for the prorated adjustment line. Defaults to the subscription's first line item."},includeNextPeriod:{type:"boolean",description:"If true: bundle the next full period at 2x quantity AND advance nextScheduleDate by one extra interval. Response carries bundledPeriodEndDate + bundledAmount."}}}},required:["interval","startDate","contactResourceId","lineItems","accountResourceId","valueDate","dueDate","reference"],group:"subscriptions",readOnly:!1,searchHint:"create new recurring subscription billing schedule with proration",execute:async(e,t)=>{let{interval:r,startDate:n,endDate:i,contactResourceId:o,reference:s,valueDate:a,dueDate:c,accountResourceId:u,taxProfileResourceId:d,lineItems:f,proratedConfig:p}=t,h=f.map(A=>({...A,accountResourceId:u,...d?{taxProfileResourceId:d}:{}})),m={repeat:r,startDate:n,status:"ACTIVE",proratedConfig:{proratedAdjustmentLineText:"Prorated adjustment",...p??{}},invoice:{contactResourceId:o,reference:s||Lo("SUB"),valueDate:a,dueDate:c,lineItems:h,saveAsDraft:!1}};return i&&(m.endDate=i),W8(e.client,m)}},{name:"update_subscription",description:"Update a subscription (interval, end date, status, template, proratedConfig). `data` is required on every update, even end-date-only: create shape (reference, valueDate, dueDate, contactResourceId, lineItems with accountResourceId), not get_subscription's `data`. Omitted status is kept. Line accounts and tax profiles are immutable: cancel and recreate.",params:{resourceId:{type:"string",description:"Subscription id"},interval:{type:"string",enum:["ONE_TIME","DAILY","WEEKLY","MONTHLY","YEARLY"],description:"Sent as `repeat`"},endDate:{type:"string",description:"New end date (YYYY-MM-DD)"},status:{type:"string",enum:["ACTIVE","INACTIVE"],description:"INACTIVE pauses"},proratedConfig:{type:"object",description:"Prorated-period settings, all optional",properties:{proratedStartDate:{type:"string",description:"YYYY-MM-DD"},proratedAdjustmentLineText:{type:"string"},itemResourceId:{type:"string",description:"UUIDv4"},includeNextPeriod:{type:"boolean"}}},data:{type:"object",description:"Transaction template (replaces the stored one)"}},required:["resourceId","data"],group:"subscriptions",readOnly:!1,isDestructive:!0,searchHint:"update subscription schedule amount proration",execute:async(e,t)=>{let{resourceId:r,...n}=t;return K8(e.client,r,n)}},Ur("delete_subscription","Delete a subscription. Removes the recurring schedule.","subscriptions",(e,t)=>X8(e,t),"permanently delete a subscription schedule"),{name:"cancel_subscription",description:"Cancel an active subscription. Prorates remaining period and stops future billing. Safe to call; subscriptions can be reactivated after cancellation. Always use this tool when the user asks to cancel a subscription. Must cancel before delete.",params:{resourceId:{type:"string",description:"Subscription resourceId"},cancelDateType:{type:"string",enum:["END_OF_CURRENT_PERIOD","END_OF_LAST_PERIOD","CUSTOM_DATE"],description:"When to end (default: END_OF_CURRENT_PERIOD)"},endDate:{type:"string",description:"Custom cancel date YYYY-MM-DD (only with CUSTOM_DATE)"},proratedAdjustmentLineText:{type:"string",description:'Label for proration line item (default: "Prorated adjustment")'}},required:["resourceId"],group:"subscriptions",readOnly:!1,searchHint:"cancel stop a recurring subscription",isDestructive:!0,execute:async(e,t)=>Z8(e.client,t.resourceId,{cancelDateType:t.cancelDateType,endDate:t.endDate,proratedAdjustmentLineText:t.proratedAdjustmentLineText})},Nt({name:"search_scheduled_transactions",description:"Search scheduled transactions (subscriptions / recurring invoices / journals / cash entries).",group:"subscriptions",fields:CT,defaults:_T,fetcher:eW,searchHint:"find scheduled recurring transactions subscriptions schedulers by type status interval contact"}),{name:"generate_vat_ledger",description:"Generate VAT/GST ledger report showing all tax transactions for the period.",params:{startDate:{type:"string",description:"Start date (YYYY-MM-DD)"},endDate:{type:"string",description:"End date (YYYY-MM-DD)"}},required:["startDate","endDate"],group:"financial_reports",readOnly:!0,searchHint:"generate VAT GST tax ledger report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Sq(e.client,{startDate:t.startDate,endDate:t.endDate})},{name:"generate_equity_movement",description:"Generate equity movement report (statement of changes in equity).",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},currencyCode:{type:"string",description:'Currency code (e.g., "SGD")'},compareWith:{type:"string",description:"Comparison period unit; compareCount sets how many",enum:["PREVIOUS_MONTHS","PREVIOUS_DAYS","PREVIOUS_QUARTERS","PREVIOUS_YEARS"]},compareCount:{type:"number",description:"Number of comparison periods"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"financial_reports",readOnly:!0,searchHint:"generate equity movement statement report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Dq(e.client,t)},{name:"generate_bank_balance_summary",description:"Generate bank balance summary report: snapshot of all bank account balances at a point in time.",params:{primarySnapshotDate:{type:"string",description:"Snapshot date (YYYY-MM-DD)"},currencyCode:{type:"string",description:'Currency code (e.g., "SGD")'}},required:["primarySnapshotDate"],group:"operational_reports",readOnly:!0,searchHint:"generate bank account balance summary report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Rq(e.client,{primarySnapshotDate:t.primarySnapshotDate,currencyCode:t.currencyCode})},{name:"generate_bank_reconciliation_summary",description:"Generate bank reconciliation summary for a specific bank account. Essential for month-end close; call this for each in-scope bank account for the current entity and reporting period. Use for bank recon status, unreconciled items count, or reconciliation summaries.",params:{bankAccountResourceId:{type:"string",description:"Bank account resourceId"},primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},currencyCode:{type:"string",description:"Currency code"},tags:{type:"array",items:{type:"string"},description:"Filter by tags"}},required:["bankAccountResourceId","primarySnapshotStartDate","primarySnapshotEndDate"],group:"operational_reports",readOnly:!0,searchHint:"generate bank reconciliation summary report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Tq(e.client,t)},{name:"generate_bank_reconciliation_details",description:"Generate detailed bank reconciliation report showing matched/unmatched items.",params:{bankAccountResourceId:{type:"string",description:"Bank account resourceId"},primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},filter:{type:"object",description:"Report filter. valueDate is required.",properties:{valueDate:{type:"object",description:"Report window.",properties:{range:{type:"array",items:{type:"string"},description:"Inclusive [from, to], YYYY-MM-DD. The only accepted operator."}},required:["range"]},reconciliationStatus:{type:"string",description:"Reconciliation status (no published enum)."}},required:["valueDate"]},currencyCode:{type:"string",description:"Currency code"}},required:["bankAccountResourceId","primarySnapshotStartDate","primarySnapshotEndDate","filter"],group:"operational_reports",readOnly:!0,searchHint:"generate bank reconciliation detailed report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>xq(e.client,t)},{name:"generate_fixed_assets_summary",description:"Generate fixed assets summary report grouped by account, type, category, or status.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},groupBy:{type:"string",enum:["ACCOUNT","TYPE","CATEGORY","STATUS"],description:"Grouping dimension"},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate","groupBy"],group:"register_reports",readOnly:!0,searchHint:"generate fixed asset summary depreciation report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>kq(e.client,t)},{name:"generate_fixed_assets_reconciliation_summary",description:"Generate fixed assets reconciliation summary: reconciles asset register with general ledger.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate fixed asset reconciliation report",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Nq(e.client,t)},{name:"generate_deferrals_summary",description:"Generate the deferrals roll-forward for a period: deferral amount, opening remaining, amortized in period, closing remaining. Sections never mix categories (prepaid vs deferred revenue).",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},groupBy:{type:"string",enum:["CATEGORY","TYPE","ACCOUNT","STATUS"],description:"Default CATEGORY"},filter:dSr,currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate deferrals summary prepaid roll-forward amortized in period",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Bq(e.client,t)},{name:"generate_deferrals_reconciliation_summary",description:"Generate the deferrals reconciliation: does the deferral register agree with the general ledger, per deferral account and per category. A difference usually means a line on the account not yet deferred.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},accountResourceIds:{type:"array",items:{type:"string"},description:"Deferral account ids from search_deferral_accounts (max 500). Omit for all."},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate deferrals reconciliation prepaid register agree general ledger",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Oq(e.client,t)},{name:"generate_leases_summary",description:"Generate the lease register (the IFRS 16 lease note) for a period: opening liability, additions, interest, payments, terminations, closing, current and non-current, right-of-use asset, grouped by type, status or account. The maturity analysis is a sheet of the download_export leases-register file.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},groupBy:{type:"string",enum:["TYPE","STATUS","ACCOUNT"],description:"Grouping dimension (default TYPE)"},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate lease register IFRS 16 note lease liability roll-forward",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>i$e(e.client,t)},{name:"generate_leases_reconciliation_summary",description:"Reconcile the lease register to the general ledger per lease account, counting scheduled rent as debits to the current lease liability. A liability difference almost always means a rent bill coded elsewhere, posted in another month, or not booked.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},accountResourceIds:{type:"array",items:{type:"string"},description:"Lease account resourceIds (max 500). Default: all lease accounts."},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate lease register vs general ledger reconciliation rent coding",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>o$e(e.client,t)},vO("generate_loans_summary","loans-summary","Borrowings note: per loan opening balance, drawdowns, repayments, interest, closing balance, current and non-current portion and accrued interest, grouped by type, status, account or lender. Positions are the register's; movements read the ledger, so an unrecorded repayment shows here.","generate loans summary borrowings note by lender type"),vO("generate_loans_roll_forward","loans-roll-forward","Loan roll-forward over a period: opening + drawdowns + repayments + interest + fees + non-cash = closing, tying to the balance sheet. Drawdowns and repayments are the user's own postings, so a missing repayment shows as a gap.","generate loans roll forward movement borrowings"),vO("generate_loans_related_party","loans-related-party","Related-party loan balances by contact: loans of type DIRECTOR, SHAREHOLDER, RELATED_PARTY and INTERCOMPANY, for the audit.","generate related party director shareholder loans balances audit"),vO("generate_loans_interest","loans-interest","Interest cost per loan for the period: interest, interest added to principal, interest to an asset, fees amortized and total finance cost.","generate loan interest cost finance cost per loan"),vO("generate_loans_maturity_analysis","loans-maturity-analysis","Liquidity note as at the end date: per term loan the undiscounted installments still due within one year, one to two, two to five and over five years, plus future interest and principal outstanding. On-demand balances fall within one year.","generate loan maturity analysis liquidity undiscounted installments buckets"),{name:"generate_loans_reconciliation_summary",description:"Loan register vs general ledger per account, in two groups: loan liability accounts and unamortized transaction cost accounts. The register side includes what the user is expected to post, so a non-zero difference means a missed, late, partial or mis-coded installment: name the account and amount and check that month. Debit minus credit, so liabilities read negative.",params:{primarySnapshotStartDate:{type:"string",description:"Period start date (YYYY-MM-DD)"},primarySnapshotEndDate:{type:"string",description:"Period end date (YYYY-MM-DD)"},accountResourceIds:{type:"array",items:{type:"string"},description:"Loan account resourceIds (max 500); omit for all"},currencyCode:{type:"string",description:"Currency code"}},required:["primarySnapshotStartDate","primarySnapshotEndDate"],group:"register_reports",readOnly:!0,searchHint:"generate loan reconciliation register vs ledger month end difference",isConcurrencySafe:!0,maxResultSizeChars:1e5,execute:async(e,t)=>Bx(e.client,"loans-recon-summary",t)},J4("generate_aged_receivables_summary","receivables","summary"),J4("generate_aged_payables_summary","payables","summary"),{name:"get_ledger_highlights",description:"Get ledger highlights, summary metadata about the org general ledger: transaction counts by type, date range, active accounts, active currencies, and cross-currency detection. No parameters needed.",params:{},required:[],group:"operational_reports",readOnly:!0,searchHint:"get ledger highlights key metrics for period",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async e=>Qq(e.client)},br("list_contact_groups","List contact groups with their associated contacts. Used to segment customers/suppliers.","contact_groups",(e,t,r)=>rW(e,{limit:r,offset:t}),"list contact groups customer supplier categories"),ri("get_contact_group","Get contact group details including all associated contacts.","contact_groups",(e,t)=>nW(e,t),"get contact group details members"),Nt({name:"search_contact_groups",description:"Search contact groups.",group:"contact_groups",fields:cx,defaults:lx,fetcher:iW,searchHint:"find contact groups segments categories by name"}),{name:"create_contact_group",description:'Create a new contact group for segmenting contacts (e.g., "VIP Customers", "Government", "Overdue > 90 Days").',params:{name:{type:"string",description:"Group name"},contactResourceIds:{type:"array",items:{type:"string"},description:"Contact IDs to add to the group"}},required:["name"],group:"contact_groups",readOnly:!1,searchHint:"create new contact group category",execute:async(e,t)=>oW(e.client,{name:t.name,contactResourceIds:t.contactResourceIds})},{name:"update_contact_group",description:"Update a contact group name or members. Membership replaces the existing set.",params:{resourceId:{type:"string",description:"Contact group resourceId"},name:{type:"string",description:"New group name"},contactResourceIds:{type:"array",items:{type:"string"},description:"Contact IDs to set as group members, max 50 (replaces existing). Sent as associatedContactResourceIds."}},required:["resourceId"],group:"contact_groups",readOnly:!1,isDestructive:!0,searchHint:"update contact group name details",execute:async(e,t)=>sW(e.client,t.resourceId,{name:t.name,contactResourceIds:t.contactResourceIds})},Ur("delete_contact_group","Delete a contact group. Does not delete the contacts themselves.","contact_groups",(e,t)=>aW(e,t),"permanently delete a contact group"),br("list_custom_fields","List custom fields defined for the organization. Custom fields add extra data to invoices, bills, credit notes, and payments.","custom_fields",(e,t,r)=>pW(e,{limit:r,offset:t}),"list custom fields metadata on transactions"),{name:"get_custom_field",description:"Get a custom field by resourceId. Returns full definition including appliesTo flags and list options.",params:{resourceId:{type:"string",description:"Custom field resourceId"}},required:["resourceId"],group:"custom_fields",readOnly:!0,searchHint:"get custom field definition details",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>sO(e.client,t.resourceId)},Nt({name:"search_custom_fields",description:"Search custom fields.",group:"custom_fields",fields:sx,defaults:ax,fetcher:hW,searchHint:"find custom fields user-defined attributes by name data type"}),{name:"create_custom_field",description:`Create a new custom field. Custom fields appear on transactions (invoices, bills, credit notes, payments).
804
804
  - appliesTo controls which transaction types show this field. Omit it and it shows on none.
805
- - printOnDocuments controls whether the field appears on PDFs.`,params:{name:{type:"string",description:'Field name (e.g., "PO Number", "Cost Center")'},description:{type:"string",description:"Field description"},printOnDocuments:{type:"boolean",description:"Show on PDF documents (default false)"},appliesTo:{type:"object",description:"Which transaction types: { invoices: true, bills: true, customerCredits: true, supplierCredits: true, payments: true }"},format:Zct},required:["name"],group:"custom_fields",readOnly:!1,searchHint:"create new custom field for transactions",execute:async(e,t)=>mW(e.client,{...t,printOnDocuments:t.printOnDocuments??!1})},{name:"update_custom_field",description:"Update a custom field definition. Omitted fields keep their current values.",params:{resourceId:{type:"string",description:"Custom field resourceId"},name:{type:"string",description:"New field name"},description:{type:"string",description:"New description"},printOnDocuments:{type:"boolean",description:"Show on PDF documents"},appliesTo:{type:"object",description:"Which transaction types: { invoices, bills, customerCredits, supplierCredits, payments }"},format:Zct},required:["resourceId"],group:"custom_fields",readOnly:!1,isDestructive:!0,searchHint:"update custom field name type settings",execute:async(e,t)=>{let{resourceId:r,...n}=t;return AW(e.client,r,n)}},Ur("delete_custom_field","Delete a custom field. Removes it from all future transactions.","custom_fields",(e,t)=>gW(e,t),"permanently delete a custom field definition"),br("list_withholding_codes","List withholding codes (BIR ATCs, PH): code, rate, type, description. A row feeds a bill or supplier credit note line's withholdingTax (EWT) and, by its resourceId, a Withholding Tax Certificate (BIR Form 2307, CWT) allocation. limit max 100.","tax_profiles",(e,t,r,n,i)=>eM(e,{offset:t,limit:r},i),"withholding codes WHT ATC EWT CWT expanded creditable withholding tax BIR 2307",{filters:{countryCode:{type:"string",description:"e.g. PH"},code:{type:"string",description:'Contains match; codes have a space ("WC 158"; "WC158" matches nothing)'},type:{type:"string",enum:["corp","ind","final","wvat"]}}}),Nt({name:"search_tax_profiles",description:"Search tax profiles. Use appliesToSale / appliesToPurchase filters to scope by transaction type.",group:"tax_profiles",fields:rx,defaults:nx,fetcher:jI,searchHint:"find tax profiles GST VAT WHT by name tax type code applicability sale purchase"}),Nt({name:"search_filing_submissions",description:"Search tax return filings (PH BIR 2550Q, SG GST F5): period, due date, tax due, status.",group:"tax_profiles",fields:DT,defaults:RT,fetcher:i8,searchHint:"BIR GST filings"}),ri("get_tax_profile","Get full tax profile details including tax rate, type code, and status.","tax_profiles",(e,t)=>oD(e,t),"get tax profile details rate code"),{name:"update_tax_profile",description:"Update an existing tax profile. Omitted fields keep their current values; status is not updatable.",params:{resourceId:{type:"string",description:"Tax profile resourceId"},name:sge,description:{type:"string"},vatValue:{type:"number",description:"Tax rate % (0-100)"},taxType:{type:"string",description:"Tax type code (list_tax_types)"}},required:["resourceId"],group:"tax_profiles",readOnly:!1,isDestructive:!0,searchHint:"update tax profile name rate details",execute:async(e,t)=>ZP(e.client,t.resourceId,{name:t.name,description:t.description,vatValue:t.vatValue,taxType:t.taxType})},{name:"create_claim_type",description:"Create a claim type (expense category for employee claims). Dedups by name. expenseAccountResourceId is server-required.",params:{name:{type:"string",description:"Claim type name (unique per org)"},expenseAccountResourceId:{type:"string",description:'Expense CoA resourceId, REQUIRED server-side (search_accounts; accountType is a display label e.g. "Operating Expense")'},taxProfileResourceId:{type:"string",description:"Default tax profile resourceId"},classifierConfig:{type:"string",description:"Magic OCR classifier defaults (JSON string)"}},required:["name"],group:"claim_types",readOnly:!1,searchHint:"create claim type expense category",execute:async(e,t)=>{let r=t.name,n=await UM(e.client,r);return n?{_guard:"duplicate_skipped",message:`Claim type "${r}" already exists.`,existing:n}:aM(e.client,{name:r,expenseAccountResourceId:t.expenseAccountResourceId,taxProfileResourceId:t.taxProfileResourceId,classifierConfig:t.classifierConfig})}},{name:"update_claim_type",description:"Update a claim type. Omitted fields unchanged; clearFields NULLs optional fields.",params:{resourceId:{type:"string",description:"Claim type resourceId"},name:{type:"string",description:"New name"},expenseAccountResourceId:{type:"string",description:"Default expense CoA resourceId"},taxProfileResourceId:{type:"string",description:"Default tax profile resourceId"},classifierConfig:{type:"string",description:"Classifier defaults (JSON string)"},clearFields:{type:"array",items:{type:"string",enum:[...cD]},description:"Optional fields to NULL (clear)"}},required:["resourceId"],group:"claim_types",readOnly:!1,isDestructive:!0,searchHint:"update claim type",execute:async(e,t)=>cM(e.client,t.resourceId,{name:t.name,expenseAccountResourceId:t.expenseAccountResourceId,taxProfileResourceId:t.taxProfileResourceId,classifierConfig:t.classifierConfig,...bg(t.clearFields,cD)})},Nt({name:"search_claim_types",description:"Search claim types.",group:"claim_types",fields:qT,defaults:jT,fetcher:HI,searchHint:"find claim types by name default expense account tax profile"}),br("list_claim_types","List claim types (alphabetical).","claim_types",(e,t,r)=>oM(e,{offset:t,limit:r}),"list claim types"),ri("get_claim_type","Get a claim type incl. nested expense account + tax profile.","claim_types",(e,t)=>sM(e,t),"get claim type details"),Ur("delete_claim_type","Soft-delete a claim type (name becomes reusable).","claim_types",(e,t)=>lM(e,t),"delete claim type"),{name:"create_claim_profile",description:"Create a claim profile (per-employee policy bundle: approver, limits, visible types, balance account). Dedups by name. taxMode EXCLUSIVE is rejected.",params:{name:{type:"string",description:"Profile name (unique per org)"},approverUserResourceId:{type:"string",description:"Default approver user resourceId"},visibleClaimTypeIds:{type:"array",items:{type:"string"},description:"Allowed claim type IDs"},visibleTaxProfileIds:{type:"array",items:{type:"string"},description:"Allowed tax profile IDs"},visibleClassifierIds:{type:"array",items:{type:"string"},description:"Allowed classifier IDs"},visibleVendorResourceIds:{type:"array",items:{type:"string"},description:"Allowed vendor contact IDs (free-text vendors always allowed)"},allowedCurrencies:{type:"array",items:{type:"string"},description:"Allowed ISO currency codes (null = no restriction)"},minClaimAmount:{type:"number",description:"Min claim total (<= max)"},maxClaimAmount:{type:"number",description:"Max claim total"},maxPerPeriodAmount:{type:"number",description:"Per-period spend cap (requires perPeriod)"},perPeriod:{type:"string",enum:[...lD],description:"Per-period window"},employeeBalanceAccountResourceId:{type:"string",description:"Per-employee liability (CURRENT_LIABILITY) CoA resourceId; required for reimbursement conversion"},taxMode:{type:"string",enum:[..._Z],description:"Tax policy (NO_TAX or INCLUSIVE)"}},required:["name"],group:"claim_profiles",readOnly:!1,searchHint:"create claim profile policy approver limits",execute:async(e,t)=>{let r=t.name,n=await $M(e.client,r);return n?{_guard:"duplicate_skipped",message:`Claim profile "${r}" already exists.`,existing:n}:pM(e.client,{name:r,approverUserResourceId:t.approverUserResourceId,visibleClaimTypeIds:t.visibleClaimTypeIds,visibleTaxProfileIds:t.visibleTaxProfileIds,visibleClassifierIds:t.visibleClassifierIds,visibleVendorResourceIds:t.visibleVendorResourceIds,allowedCurrencies:t.allowedCurrencies,minClaimAmount:t.minClaimAmount,maxClaimAmount:t.maxClaimAmount,maxPerPeriodAmount:t.maxPerPeriodAmount,perPeriod:t.perPeriod,employeeBalanceAccountResourceId:t.employeeBalanceAccountResourceId,taxMode:t.taxMode})}},{name:"update_claim_profile",description:"Update a claim profile. Omitted fields unchanged; clearFields NULLs optional fields. Balance account cannot change while an employee has a non-zero balance.",params:{resourceId:{type:"string",description:"Claim profile resourceId"},name:{type:"string",description:"New name"},approverUserResourceId:{type:"string",description:"Default approver user resourceId"},visibleClaimTypeIds:{type:"array",items:{type:"string"},description:"Allowed claim type IDs (replaces)"},visibleTaxProfileIds:{type:"array",items:{type:"string"},description:"Allowed tax profile IDs (replaces)"},visibleClassifierIds:{type:"array",items:{type:"string"},description:"Allowed classifier IDs (replaces)"},visibleVendorResourceIds:{type:"array",items:{type:"string"},description:"Allowed vendor contact IDs (replaces)"},allowedCurrencies:{type:"array",items:{type:"string"},description:"Allowed ISO currency codes (replaces)"},minClaimAmount:{type:"number",description:"Min claim total"},maxClaimAmount:{type:"number",description:"Max claim total"},maxPerPeriodAmount:{type:"number",description:"Per-period spend cap"},perPeriod:{type:"string",enum:[...lD],description:"Per-period window"},employeeBalanceAccountResourceId:{type:"string",description:"Employee balance CoA resourceId"},taxMode:{type:"string",enum:[..._Z],description:"Tax policy (NO_TAX or INCLUSIVE)"},clearFields:{type:"array",items:{type:"string",enum:[...uD]},description:"Optional fields to NULL (clear)"}},required:["resourceId"],group:"claim_profiles",readOnly:!1,isDestructive:!0,searchHint:"update claim profile policy limits",execute:async(e,t)=>hM(e.client,t.resourceId,{name:t.name,approverUserResourceId:t.approverUserResourceId,visibleClaimTypeIds:t.visibleClaimTypeIds,visibleTaxProfileIds:t.visibleTaxProfileIds,visibleClassifierIds:t.visibleClassifierIds,visibleVendorResourceIds:t.visibleVendorResourceIds,allowedCurrencies:t.allowedCurrencies,minClaimAmount:t.minClaimAmount,maxClaimAmount:t.maxClaimAmount,maxPerPeriodAmount:t.maxPerPeriodAmount,perPeriod:t.perPeriod,employeeBalanceAccountResourceId:t.employeeBalanceAccountResourceId,taxMode:t.taxMode,...bg(t.clearFields,uD)})},Nt({name:"search_claim_profiles",description:"Search claim profiles.",group:"claim_profiles",fields:YT,defaults:HT,fetcher:zI,searchHint:"find claim profiles by name approver default limits balance account"}),br("list_claim_profiles","List claim profiles (alphabetical).","claim_profiles",(e,t,r)=>dM(e,{offset:t,limit:r}),"list claim profiles"),ri("get_claim_profile","Get a claim profile incl. nested balance account.","claim_profiles",(e,t)=>fM(e,t),"get claim profile details"),Ur("delete_claim_profile","Soft-delete a claim profile.","claim_profiles",(e,t)=>mM(e,t),"delete claim profile"),{name:"create_posting_rule",description:"Create a posting rule (how approved claims group into journals at conversion). outerAxis + innerAxis + lineDescriptionTemplate required. Dedups by name.",params:{name:{type:"string",description:"Rule name (unique per org)"},outerAxis:{type:"string",enum:[...fD],description:"Outer grouping axis"},innerAxis:{type:"string",enum:[...pD],description:"Inner line-aggregation axis"},lineDescriptionTemplate:{type:"string",description:'Handlebars line template, e.g. "{employeeName} - {claimType}"'},journalReferenceTemplate:{type:"string",description:"Optional Handlebars journal-header reference template"},defaultBankAccountResourceId:{type:"string",description:"Default reimbursement bank (Cash/Bank) account resourceId"},defaultIncludeReimbursementPayout:{type:"boolean",description:"Create reimbursement DCE by default"},isDefault:{type:"boolean",description:"Make org default rule"}},required:["name","outerAxis","innerAxis","lineDescriptionTemplate"],group:"posting_rules",readOnly:!1,searchHint:"create posting rule claim conversion grouping",execute:async(e,t)=>{let r=t.name,n=await qM(e.client,r);return n?{_guard:"duplicate_skipped",message:`Posting rule "${r}" already exists.`,existing:n}:yM(e.client,{name:r,outerAxis:t.outerAxis,innerAxis:t.innerAxis,lineDescriptionTemplate:t.lineDescriptionTemplate,journalReferenceTemplate:t.journalReferenceTemplate,defaultBankAccountResourceId:t.defaultBankAccountResourceId,defaultIncludeReimbursementPayout:t.defaultIncludeReimbursementPayout,isDefault:t.isDefault})}},{name:"update_posting_rule",description:"Update a posting rule. Omitted fields unchanged.",params:{resourceId:{type:"string",description:"Posting rule resourceId"},name:{type:"string",description:"New name"},outerAxis:{type:"string",enum:[...fD],description:"Outer grouping axis"},innerAxis:{type:"string",enum:[...pD],description:"Inner line-aggregation axis"},lineDescriptionTemplate:{type:"string",description:"Handlebars line template"},journalReferenceTemplate:{type:"string",description:"Journal-header reference template"},defaultBankAccountResourceId:{type:"string",description:"Default reimbursement bank account resourceId"},defaultIncludeReimbursementPayout:{type:"boolean",description:"Create reimbursement DCE by default"},isDefault:{type:"boolean",description:"Make org default rule"}},required:["resourceId"],group:"posting_rules",readOnly:!1,isDestructive:!0,searchHint:"update posting rule",execute:async(e,t)=>EM(e.client,t.resourceId,{name:t.name,outerAxis:t.outerAxis,innerAxis:t.innerAxis,lineDescriptionTemplate:t.lineDescriptionTemplate,journalReferenceTemplate:t.journalReferenceTemplate,defaultBankAccountResourceId:t.defaultBankAccountResourceId,defaultIncludeReimbursementPayout:t.defaultIncludeReimbursementPayout,isDefault:t.isDefault})},Nt({name:"search_posting_rules",description:"Search posting rules.",group:"posting_rules",fields:zT,defaults:JT,fetcher:JI,searchHint:"find posting rules by name axis default bank reimbursement"}),br("list_posting_rules","List posting rules (alphabetical).","posting_rules",(e,t,r)=>AM(e,{offset:t,limit:r}),"list posting rules"),ri("get_posting_rule","Get a posting rule.","posting_rules",(e,t)=>gM(e,t),"get posting rule details"),Ur("delete_posting_rule","Delete a posting rule. The org default cannot be deleted while default (set another default first).","posting_rules",(e,t)=>bM(e,t),"delete posting rule"),Nt({name:"search_claims",description:'Search/list employee-expense claims. Status: DRAFT|SUBMITTED|APPROVED|CONVERTED|REJECTED|CANCELLED (CONVERTED = "Processed"). Claims are born via create_claim, attachment, or conversion (no bare list; use search).',group:"claims",fields:PT,defaults:MT,fetcher:r2,searchHint:"find employee expense claims by status employee contact reference date amount"}),ri("get_claim","Get a claim incl. line items, employee, amounts, status.","claims",(e,t)=>LT(e,t),"get claim details line items"),{name:"create_claim",description:"Create an employee-expense claim directly (bare create, no attachment). Vendor is EITHER contactResourceId OR vendorName, never both. saveAsDraft defaults to true (lands DRAFT with relaxed line validation); set false to validate + submit in one call (lands SUBMITTED). reference is REQUIRED when submitting (saveAsDraft=false): omitting it returns 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT; a DRAFT saves without one.",params:{valueDate:{type:"string",description:"Business-transaction date (YYYY-MM-DD)"},currencyCode:{type:"string",description:"Claim currency (ISO 4217)"},saveAsDraft:{type:"boolean",description:"true (default) creates DRAFT; false validates + submits"},employeeResourceId:{type:"string",description:"Employee resourceId the claim is filed for"},contactResourceId:{type:"string",description:"Vendor contact resourceId (mutually exclusive with vendorName)"},vendorName:{type:"string",description:"Free-text vendor name (mutually exclusive with contactResourceId)"},reference:{type:"string",description:"User reference"},autoReference:uu,currencySymbol:{type:"string",description:"Currency symbol override"},taxInclusion:{type:"boolean",description:"Line amounts are tax-inclusive"},tags:{type:"array",items:{type:"string"},description:"Header-level tags"},internalNotes:{type:"string",description:"Internal notes (max 1000)"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId (defaults to org default)"},approverUserResourceId:{type:"string",description:"Approver user resourceId"},customFields:Tn,claimItems:llt},required:["valueDate","currencyCode"],group:"claims",readOnly:!1,searchHint:"create new employee expense claim draft vendor employee line items submit",execute:async(e,t)=>n2(e.client,{valueDate:t.valueDate,currencyCode:t.currencyCode,saveAsDraft:t.saveAsDraft,employeeResourceId:t.employeeResourceId,contactResourceId:t.contactResourceId,vendorName:t.vendorName,reference:await bU(e.client,"CLAIM",t.reference,t.autoReference),currencySymbol:t.currencySymbol,taxInclusion:t.taxInclusion,tags:t.tags,internalNotes:t.internalNotes,claimProfileResourceId:t.claimProfileResourceId,approverUserResourceId:t.approverUserResourceId,customFields:t.customFields,claimItems:t.claimItems})},{name:"update_claim",description:"Update a DRAFT claim (partial: omitted fields unchanged). claimItems non-empty REPLACES all lines, [] clears. Set saveAsDraft=false to validate + submit in one call: reference is REQUIRED at submit (else 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT); a DRAFT save needs none. Only DRAFT claims are editable.",params:{resourceId:{type:"string",description:"Claim resourceId"},saveAsDraft:{type:"boolean",description:"true (default) keeps editing; false validates + submits"},employeeResourceId:{type:"string",description:"Employee resourceId"},contactResourceId:{type:"string",description:"Vendor contact resourceId (mutually exclusive with vendorName)"},vendorName:{type:"string",description:"Free-text vendor name (mutually exclusive with contactResourceId)"},valueDate:{type:"string",description:"Business-transaction date (YYYY-MM-DD)"},reference:{type:"string",description:"User reference"},currencyCode:{type:"string",description:"Claim currency (ISO 4217)"},taxInclusion:{type:"boolean",description:"Line amounts are tax-inclusive"},tags:jo,internalNotes:{type:"string",description:"Internal notes (max 1000)"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId"},approverUserResourceId:{type:"string",description:"Approver user resourceId"},customFields:Tn,claimItems:llt},required:["resourceId"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"edit draft claim line items employee reference submit",execute:async(e,t)=>{let r=t.resourceId,n=Ui(t.tags),i=n&&await Yo("claim",r,()=>LT(e.client,r));return i2(e.client,r,{saveAsDraft:t.saveAsDraft,employeeResourceId:t.employeeResourceId,contactResourceId:t.contactResourceId,vendorName:t.vendorName,valueDate:t.valueDate,reference:t.reference,currencyCode:t.currencyCode,taxInclusion:t.taxInclusion,tags:n&&Ki(i?.tags,n),internalNotes:t.internalNotes,claimProfileResourceId:t.claimProfileResourceId,approverUserResourceId:t.approverUserResourceId,customFields:t.customFields,claimItems:t.claimItems})}},Ur("delete_claim","Delete a claim. Only DRAFT / REJECTED / CANCELLED claims are deletable (else 422).","claims",(e,t)=>o2(e,t),"delete remove claim record"),{name:"delete_claim_attachment",description:"Remove one attachment (receipt) from a claim. Returns the updated claim.",params:{resourceId:{type:"string",description:"Claim resourceId"},attachmentResourceId:{type:"string",description:"Attachment resourceId"}},required:["resourceId","attachmentResourceId"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"remove delete claim attachment receipt",execute:async(e,t)=>s2(e.client,t.resourceId,t.attachmentResourceId)},lge("submit_claim","Submit a DRAFT claim for approval (DRAFT \u2192 SUBMITTED). Server enforces the transition. The claim must carry a reference; a referenceless DRAFT returns 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT (set it via update_claim first).","claims",(e,t)=>a2(e,t),{destructive:!0,searchHint:"submit draft claim for approval"}),lge("approve_claim","Approve a SUBMITTED claim (SUBMITTED \u2192 APPROVED). Approved claims become convertible to journals.","claims",(e,t)=>c2(e,t),{destructive:!0,searchHint:"approve submitted claim"}),{name:"reject_claim",description:"Reject a SUBMITTED/APPROVED claim with a reason (\u2192 REJECTED).",params:{resourceId:{type:"string",description:"Claim resourceId"},rejectionReason:{type:"string",description:"Rejection reason (1-1000 chars)"}},required:["resourceId","rejectionReason"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"reject claim with reason",execute:async(e,t)=>l2(e.client,t.resourceId,t.rejectionReason)},{name:"cancel_claim",description:"Cancel a DRAFT/SUBMITTED claim with a reason (\u2192 CANCELLED).",params:{resourceId:{type:"string",description:"Claim resourceId"},cancellationReason:{type:"string",description:"Cancellation reason (1-1000 chars)"}},required:["resourceId","cancellationReason"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"cancel claim with reason",execute:async(e,t)=>u2(e.client,t.resourceId,t.cancellationReason)},lge("unpost_claim","Unpost a CONVERTED claim: voids its journal, back to APPROVED. Re-unpost: 200 no-op. Aggregated claims unpost together. Ignores payouts (employee balance can go negative).","claims",(e,t)=>d2(e,t),{destructive:!0,searchHint:"unpost reverse converted claim conversion"}),{name:"bulk_submit_claims",description:`Bulk-submit DRAFT claims (ASYNC). Returns the final job if it finished, else a job handle {jobId,...} to poll with search_background_jobs by jobId for per-item results. ${rs} Max 500 ids. Each claim must have a reference; referenceless claims fail per-item with CLAIM_REFERENCE_REQUIRED_AT_SUBMIT (check the job result).`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk submit many claims async job",backgroundJob:Mn("Submit","claim","claims","resourceIds"),execute:async(e,t)=>f2(e.client,t.resourceIds)},{name:"bulk_approve_claims",description:`Bulk-approve SUBMITTED claims (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk approve many claims async job",backgroundJob:Mn("Approve","claim","claims","resourceIds"),execute:async(e,t)=>p2(e.client,t.resourceIds)},{name:"bulk_reject_claims",description:`Bulk-reject claims with one shared reason (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O,rejectionReason:{type:"string",description:"Reason applied to the whole batch (1-1000 chars)"}},required:["resourceIds","rejectionReason"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk reject many claims async job reason",backgroundJob:Mn("Reject","claim","claims","resourceIds"),execute:async(e,t)=>m2(e.client,t.resourceIds,t.rejectionReason)},{name:"bulk_cancel_claims",description:`Bulk-cancel claims with one shared reason (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O,cancellationReason:{type:"string",description:"Reason applied to the whole batch (1-1000 chars)"}},required:["resourceIds","cancellationReason"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk cancel many claims async job reason",backgroundJob:Mn("Cancel","claim","claims","resourceIds"),execute:async(e,t)=>A2(e.client,t.resourceIds,t.cancellationReason)},{name:"bulk_delete_claims",description:`Bulk-delete claims (ASYNC; only DRAFT/REJECTED/CANCELLED are deletable). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk delete many claims async job",backgroundJob:Mn("Delete","claim","claims","resourceIds"),execute:async(e,t)=>h2(e.client,t.resourceIds)},{name:"get_claim_tracking_tags",description:"List the tracking-tag values available across claims (picker; returns a bare array).",params:{},required:[],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"list claim tracking tags picker",execute:async e=>g2(e.client)},{name:"get_claim_custom_field_values",description:"List the custom-field values available across claims (picker; returns a bare array).",params:{},required:[],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"list claim custom field values picker",execute:async e=>y2(e.client)},{name:"preview_claims_conversion",description:"Preview the journals an APPROVED claim batch would produce at conversion, no write. Returns expenseSubTotal, previewJournals, and reimbursement DCE counts; non-APPROVED claims come back under erroredClaims (check it is empty before converting). Needs a default posting rule or an explicit postingRuleResourceId.",params:{claimResourceIds:{type:"array",items:{type:"string"},description:"APPROVED claim resourceIds (1-500)"},postingRuleResourceId:{type:"string",description:"Posting rule resourceId (null \u2192 org default rule)"},payoutFlow:{type:"string",enum:[...eO],description:"POST (journals only) or POST_AND_RECORD (+ books-only reimbursement DCE)"},includeReimbursementPayout:{type:"boolean",description:"Include per-employee reimbursement DCE lines"},bankAccountResourceId:{type:"string",description:"Reimbursement bank account for preview validation"}},required:["claimResourceIds"],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview claim conversion journals before posting",execute:async(e,t)=>e8(e.client,{claimResourceIds:t.claimResourceIds,postingRuleResourceId:t.postingRuleResourceId,payoutFlow:t.payoutFlow,includeReimbursementPayout:t.includeReimbursementPayout,bankAccountResourceId:t.bankAccountResourceId})},{name:"convert_claims_to_journal",description:"Convert an APPROVED claim batch into journals (atomic write). valueDate (YYYY-MM-DD) required. Preview first and confirm erroredClaims is empty. idempotencyKey is auto-generated for safe retries (pass your own to dedup across calls). includeReimbursementPayout adds a books-only reimbursement DCE; real-money disburse is intentionally not exposed.",params:{claimResourceIds:{type:"array",items:{type:"string"},description:"APPROVED claim resourceIds (1-500)"},valueDate:{type:"string",description:"Journal value date (YYYY-MM-DD)"},postingRuleResourceId:{type:"string",description:"Posting rule resourceId (null \u2192 org default rule)"},includeReimbursementPayout:{type:"boolean",description:"Create books-only reimbursement DCEs"},bankAccountResourceIdOverride:{type:"string",description:"Override the rule default reimbursement bank account"},contactResourceId:{type:"string",description:"Clearing contact for the reimbursement DCE cash-out"},idempotencyKey:{type:"string",description:"Optional retry-dedup token (must not start with CONV: / CONV-); auto-generated if omitted"}},required:["claimResourceIds","valueDate"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"convert post approved claims to journal entries",execute:async(e,t)=>t8(e.client,{claimResourceIds:t.claimResourceIds,valueDate:t.valueDate,postingRuleResourceId:t.postingRuleResourceId,includeReimbursementPayout:t.includeReimbursementPayout,bankAccountResourceIdOverride:t.bankAccountResourceIdOverride,contactResourceId:t.contactResourceId,idempotencyKey:t.idempotencyKey||tSr()})},{name:"record_employee_payout",description:"Record a books-only employee payout (reimbursement or advance): a DCE, no real-money transfer. amount, paymentAccountResourceId and valueDate are required; reference auto-generated if omitted.",params:{employeeResourceId:{type:"string",description:"Employee resourceId"},amount:{type:"number",description:"Payout amount (> 0)"},paymentAccountResourceId:{type:"string",description:"Bank/cash account the DCE credits"},valueDate:{type:"string",description:"Value date (YYYY-MM-DD)"},payoutFor:{type:"string",enum:[...dat],description:"Classification (null \u2192 ADVANCE)"},currencyCode:{type:"string",description:"Settle currency (ISO 4217; omit \u2192 payment account currency)"},reference:{type:"string",description:"Payout reference (auto-generated if omitted)"},description:{type:"string",description:"Line description on the DCE"},internalNotes:{type:"string",description:"Internal notes"}},required:["employeeResourceId","amount","paymentAccountResourceId","valueDate"],group:"claim_processing",readOnly:!1,searchHint:"record employee reimbursement advance payout books-only DCE",execute:async(e,t)=>r8(e.client,{employeeResourceId:t.employeeResourceId,amount:t.amount,paymentAccountResourceId:t.paymentAccountResourceId,valueDate:t.valueDate,payoutFor:t.payoutFor,currencyCode:t.currencyCode,reference:t.reference||Lo("EP"),description:t.description,internalNotes:t.internalNotes})},Nt({name:"search_employee_payouts",description:"Search recorded employee payouts (reimbursements + advances).",group:"claim_processing",fields:UT,defaults:$T,fetcher:n8,searchHint:"find employee payouts reimbursements advances by employee reference status type"}),{name:"add_employee",description:"Create an employee (expense-claim member). claimProfileResourceId is REQUIRED (carries the employee balance account; the org default is NOT auto-applied). userResourceId is optional: omit for an offline employee with no login. Dedups by email.",params:{name:{type:"string",description:"Employee display name"},userResourceId:{type:"string",description:"Login user's resourceId to link: the userResourceId field from search_org_users, NOT the org-user record id (else EMPLOYEE_USER_NOT_FOUND). Optional"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId, REQUIRED (carries the employee balance account; org default NOT auto-applied \u2192 EMPLOYEE_CLAIM_PROFILE_REQUIRED). search_claim_profiles"},email:{type:"string",description:"Work email (per-org unique)"},phone:{type:"string",description:"Phone (per-org unique)"},managerEmployeeResourceId:{type:"string",description:"Manager employee resourceId"},active:{type:"boolean",description:"Active flag (default true)"},employmentType:{type:"string",enum:[...Ig],description:"Employment classification"}},required:["name","claimProfileResourceId"],group:"employees",readOnly:!1,searchHint:"create add employee claim member bind user",execute:async(e,t)=>{let r=t.email;if(r){let n=await jM(e.client,r);if(n)return{_guard:"duplicate_skipped",message:`Employee with email "${r}" already exists.`,existing:n}}return DM(e.client,{name:t.name,userResourceId:t.userResourceId,claimProfileResourceId:t.claimProfileResourceId,email:r,phone:t.phone,managerEmployeeResourceId:t.managerEmployeeResourceId,active:t.active,employmentType:t.employmentType})}},{name:"update_employee",description:"Update an employee (partial; omitted or null = no change). Clear only via clearFields (userResourceId = unlink). To ARCHIVE, set active=false (reversible, prefer over delete_employee).",params:{resourceId:{type:"string",description:"Employee resourceId"},name:{type:"string",description:"New name"},email:{type:"string",description:"Work email"},phone:{type:"string",description:"Phone"},managerEmployeeResourceId:{type:"string",description:"Manager employee resourceId"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId"},active:{type:"boolean",description:"Active flag, set false to archive"},employmentType:{type:"string",enum:[...Ig],description:"Employment classification"},userResourceId:{type:"string",description:"Login user to link/relink (search_org_users userResourceId)"},clearFields:{type:"array",items:{type:"string",enum:[...TZ]},description:"Fields to clear"}},required:["resourceId"],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"update edit archive employee active claim profile",execute:async(e,t)=>RM(e.client,t.resourceId,{name:t.name,email:t.email,phone:t.phone,managerEmployeeResourceId:t.managerEmployeeResourceId,claimProfileResourceId:t.claimProfileResourceId,active:t.active,employmentType:t.employmentType,userResourceId:t.userResourceId,clearFields:t.clearFields})},Nt({name:"search_employees",description:"Search employees by name, email, phone, manager, claim profile, active, currency.",group:"employees",fields:GT,defaults:VT,fetcher:VI,searchHint:"find employees claim members by name email manager profile active"}),Nt({name:"search_employee_balances",description:"Search the employee-balance directory (per-currency reimbursement balances owed).",group:"employees",fields:WT,defaults:KT,fetcher:vM,searchHint:"employee reimbursement balances owed by currency employment type"}),ri("get_employee","Get an employee incl. claim profile + user binding.","employees",(e,t)=>SM(e,t),"get employee details binding balance"),Ur("delete_employee","Delete an employee (server validates they are settled). Prefer update_employee active=false to archive reversibly.","employees",(e,t)=>TM(e,t),"delete remove employee"),{name:"bind_employee_user",description:"Bind a login user to an OFFLINE employee (no user bound yet, e.g. imported without a binding email). Refused once bound: relink or unlink via update_employee.",params:{resourceId:{type:"string",description:"Employee resourceId"},userResourceId:{type:"string",description:"Login user's resourceId: the userResourceId FIELD from search_org_users, NOT the org-user record id (else EMPLOYEE_USER_NOT_FOUND)"}},required:["resourceId","userResourceId"],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"bind link login user to employee",execute:async(e,t)=>xM(e.client,t.resourceId,t.userResourceId)},{name:"preprocess_employees_file",description:"Preprocess an uploaded employee import sheet (CSV/XLSX); returns a parsed row preview to review before import_employees. Provide the sheet fileUrl.",params:{fileUrl:{type:"string",description:"URL of the uploaded employee sheet"},fileName:{type:"string",description:"Display file name"},fileType:{type:"string",enum:["CSV","EML","HEIC","JPEG","JPG","PDF","PNG","TEXT","XLS","XLSX"],description:"File type (use CSV / XLS / XLSX for employee sheets)"}},required:["fileUrl"],group:"employees",readOnly:!0,isConcurrencySafe:!0,searchHint:"preprocess preview employee import sheet csv xlsx",execute:async(e,t)=>kM(e.client,{fileUrl:t.fileUrl,fileName:t.fileName,fileType:t.fileType})},{name:"import_employees",description:`Bulk create/update/delete employees (max 100 rows per array). Rows validate synchronously (422 row errors), then an async job queues: the result is the final job if it finished, else poll search_background_jobs by jobId. ${rs} Create rows need name + claimProfileResourceId (userResourceId optional).`,params:{create:{type:"array",description:"Create rows",items:{type:"object",properties:{name:{type:"string"},email:{type:"string"},userResourceId:{type:"string"},claimProfileResourceId:{type:"string"},employmentType:{type:"string",enum:[...Ig]},managerEmployeeResourceId:{type:"string"},active:{type:"boolean"}},required:["name"]}},update:{type:"array",description:"Update rows",items:{type:"object",properties:{employeeResourceId:{type:"string"},name:{type:"string"},email:{type:"string"},employmentType:{type:"string",enum:[...Ig]},active:{type:"boolean"}},required:["employeeResourceId"]}},delete:{type:"array",description:"Delete rows",items:{type:"object",properties:{employeeResourceId:{type:"string"}},required:["employeeResourceId"]}}},required:[],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"bulk import employees create update delete sheet async",backgroundJob:Mn("Import","employee change","employee changes","create","update","delete"),execute:async(e,t)=>NM(e.client,{create:t.create,update:t.update,delete:t.delete})},br("list_inventory_items","List inventory-tracked items with stock details, COGS accounts, and purchase/sale accounts.","inventory",(e,t,r)=>cW(e,{limit:r,offset:t}),"list inventory items stock levels quantities"),{name:"get_inventory_balance",description:"Get current inventory balance for a specific item: quantity on hand, average cost, base unit.",params:{itemResourceId:{type:"string",description:"Item resourceId"}},required:["itemResourceId"],group:"inventory",readOnly:!0,searchHint:"get inventory balance stock level for item",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>uW(e.client,t.itemResourceId)},{name:"list_inventory_balances",description:"List stock on hand, average cost and value per inventory item. One item: get_inventory_balance.",params:{status:{type:"string",enum:[...dW],description:"Default ALL"},...FO},required:[],group:"inventory",readOnly:!0,searchHint:"stock on hand all items",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>{let{limit:r,offset:n}=QO(t),i=t.status??"ALL";return ch((o,s)=>fW(e.client,i,{limit:s,offset:o}),r,n,100)}},{name:"create_inventory_item",description:"Create a new inventory-tracked item. Requires itemCode, name, unit, costingMethod (FIXED or WAC) and three account links. Use --input for full JSON body.",params:{itemCode:{type:"string",description:"Unique item code (SKU)"},name:{type:"string",description:"Item name"},unit:{type:"string",description:'Unit of measure, e.g. "pcs"'},costingMethod:{type:"string",enum:["FIXED","WAC"],description:"Costing method: FIXED or WAC"},cogsResourceId:{type:"string",description:"COGS account resourceId (Direct Costs type)"},purchaseAccountResourceId:{type:"string",description:"Purchase account resourceId (Inventory type)"},saleAccountResourceId:{type:"string",description:"Sale account resourceId"},blockInsufficientDeductions:{type:"boolean",description:"Block transactions when insufficient stock (default: false)"}},required:["itemCode","name","unit","costingMethod","cogsResourceId","purchaseAccountResourceId","saleAccountResourceId"],group:"inventory",readOnly:!1,searchHint:"create new inventory tracked stock item",execute:async(e,t)=>lW(e.client,{itemCode:t.itemCode,name:t.name,unit:t.unit,costingMethod:t.costingMethod,cogsResourceId:t.cogsResourceId,purchaseAccountResourceId:t.purchaseAccountResourceId,saleAccountResourceId:t.saleAccountResourceId,appliesToSale:!0,appliesToPurchase:!0,blockInsufficientDeductions:t.blockInsufficientDeductions??!1})},Ur("delete_contact","Delete a contact. Cannot delete contacts with existing transactions.","contacts",(e,t)=>vP(e,t),"permanently delete a customer supplier contact"),Ur("delete_account","Delete a chart of accounts entry. Cannot delete accounts with existing transactions.","accounts",(e,t)=>HP(e,t),"permanently delete a chart of accounts entry"),ri("get_cash_transfer","Fetch a cash transfer by cashflow-transaction resourceId (search_cashflow_transactions) or the parentEntityResourceId create returns.","cash_transfers",(e,t)=>iV(e,t),"get cash transfer details between accounts"),TO("download_credit_note_pdf","customer credit note","customer_credit_notes",(e,t)=>cj(e,t)),{name:"get_transaction_summary",description:`Get a complete summary of any transaction: fetches the transaction, its attachments, and payment history in one call.
805
+ - printOnDocuments controls whether the field appears on PDFs.`,params:{name:{type:"string",description:'Field name (e.g., "PO Number", "Cost Center")'},description:{type:"string",description:"Field description"},printOnDocuments:{type:"boolean",description:"Show on PDF documents (default false)"},appliesTo:{type:"object",description:"Which transaction types: { invoices: true, bills: true, customerCredits: true, supplierCredits: true, payments: true }"},format:Zct},required:["name"],group:"custom_fields",readOnly:!1,searchHint:"create new custom field for transactions",execute:async(e,t)=>mW(e.client,{...t,printOnDocuments:t.printOnDocuments??!1})},{name:"update_custom_field",description:"Update a custom field definition. Omitted fields keep their current values.",params:{resourceId:{type:"string",description:"Custom field resourceId"},name:{type:"string",description:"New field name"},description:{type:"string",description:"New description"},printOnDocuments:{type:"boolean",description:"Show on PDF documents"},appliesTo:{type:"object",description:"Which transaction types: { invoices, bills, customerCredits, supplierCredits, payments }"},format:Zct},required:["resourceId"],group:"custom_fields",readOnly:!1,isDestructive:!0,searchHint:"update custom field name type settings",execute:async(e,t)=>{let{resourceId:r,...n}=t;return AW(e.client,r,n)}},Ur("delete_custom_field","Delete a custom field. Removes it from all future transactions.","custom_fields",(e,t)=>gW(e,t),"permanently delete a custom field definition"),br("list_withholding_codes","List withholding codes (BIR ATCs, PH): code, rate, type, description. A row feeds a bill or supplier credit note line's withholdingTax (EWT) and, by its resourceId, a Withholding Tax Certificate (BIR Form 2307, CWT) allocation. limit max 100.","tax_profiles",(e,t,r,n,i)=>eM(e,{offset:t,limit:r},i),"withholding codes WHT ATC EWT CWT expanded creditable withholding tax BIR 2307",{filters:{countryCode:{type:"string",description:"e.g. PH"},code:{type:"string",description:'Contains match; codes have a space ("WC 158"; "WC158" matches nothing)'},type:{type:"string",enum:["corp","ind","final","wvat"]}}}),Nt({name:"search_tax_profiles",description:"Search tax profiles. Use appliesToSale / appliesToPurchase filters to scope by transaction type.",group:"tax_profiles",fields:rx,defaults:nx,fetcher:jI,searchHint:"find tax profiles GST VAT WHT by name tax type code applicability sale purchase"}),Nt({name:"search_filing_submissions",description:"Search tax return filings (PH BIR 2550Q, SG GST F5): period, due date, tax due, status.",group:"tax_profiles",fields:DT,defaults:RT,fetcher:i8,searchHint:"BIR GST filings"}),ri("get_tax_profile","Get full tax profile details including tax rate, type code, and status.","tax_profiles",(e,t)=>oD(e,t),"get tax profile details rate code"),{name:"update_tax_profile",description:"Update an existing tax profile. Omitted fields keep their current values; status is not updatable.",params:{resourceId:{type:"string",description:"Tax profile resourceId"},name:sge,description:{type:"string"},vatValue:{type:"number",description:"Tax rate % (0-100)"},taxType:{type:"string",description:"Tax type code (list_tax_types)"}},required:["resourceId"],group:"tax_profiles",readOnly:!1,isDestructive:!0,searchHint:"update tax profile name rate details",execute:async(e,t)=>ZP(e.client,t.resourceId,{name:t.name,description:t.description,vatValue:t.vatValue,taxType:t.taxType})},{name:"create_claim_type",description:"Create a claim type (expense category for employee claims). Dedups by name. expenseAccountResourceId is server-required.",params:{name:{type:"string",description:"Claim type name (unique per org)"},expenseAccountResourceId:{type:"string",description:'Expense CoA resourceId, REQUIRED server-side (search_accounts; accountType is a display label e.g. "Operating Expense")'},taxProfileResourceId:{type:"string",description:"Default tax profile resourceId"},classifierConfig:{type:"string",description:"Magic OCR classifier defaults (JSON string)"}},required:["name"],group:"claim_types",readOnly:!1,searchHint:"create claim type expense category",execute:async(e,t)=>{let r=t.name,n=await UM(e.client,r);return n?{_guard:"duplicate_skipped",message:`Claim type "${r}" already exists.`,existing:n}:aM(e.client,{name:r,expenseAccountResourceId:t.expenseAccountResourceId,taxProfileResourceId:t.taxProfileResourceId,classifierConfig:t.classifierConfig})}},{name:"update_claim_type",description:"Update a claim type. Omitted fields unchanged; clearFields NULLs optional fields.",params:{resourceId:{type:"string",description:"Claim type resourceId"},name:{type:"string",description:"New name"},expenseAccountResourceId:{type:"string",description:"Default expense CoA resourceId"},taxProfileResourceId:{type:"string",description:"Default tax profile resourceId"},classifierConfig:{type:"string",description:"Classifier defaults (JSON string)"},clearFields:{type:"array",items:{type:"string",enum:[...cD]},description:"Optional fields to NULL (clear)"}},required:["resourceId"],group:"claim_types",readOnly:!1,isDestructive:!0,searchHint:"update claim type",execute:async(e,t)=>cM(e.client,t.resourceId,{name:t.name,expenseAccountResourceId:t.expenseAccountResourceId,taxProfileResourceId:t.taxProfileResourceId,classifierConfig:t.classifierConfig,...bg(t.clearFields,cD)})},Nt({name:"search_claim_types",description:"Search claim types.",group:"claim_types",fields:qT,defaults:jT,fetcher:HI,searchHint:"find claim types by name default expense account tax profile"}),br("list_claim_types","List claim types (alphabetical).","claim_types",(e,t,r)=>oM(e,{offset:t,limit:r}),"list claim types"),ri("get_claim_type","Get a claim type incl. nested expense account + tax profile.","claim_types",(e,t)=>sM(e,t),"get claim type details"),Ur("delete_claim_type","Soft-delete a claim type (name becomes reusable).","claim_types",(e,t)=>lM(e,t),"delete claim type"),{name:"create_claim_profile",description:"Create a claim profile (per-employee policy bundle: approver, limits, visible types, balance account). Dedups by name. taxMode EXCLUSIVE is rejected.",params:{name:{type:"string",description:"Profile name (unique per org)"},approverUserResourceId:{type:"string",description:"Default approver user resourceId"},visibleClaimTypeIds:{type:"array",items:{type:"string"},description:"Allowed claim type IDs"},visibleTaxProfileIds:{type:"array",items:{type:"string"},description:"Allowed tax profile IDs"},visibleClassifierIds:{type:"array",items:{type:"string"},description:"Allowed classifier IDs"},visibleVendorResourceIds:{type:"array",items:{type:"string"},description:"Allowed vendor contact IDs (free-text vendors always allowed)"},allowedCurrencies:{type:"array",items:{type:"string"},description:"Allowed ISO currency codes (null = no restriction)"},minClaimAmount:{type:"number",description:"Min claim total (<= max)"},maxClaimAmount:{type:"number",description:"Max claim total"},maxPerPeriodAmount:{type:"number",description:"Per-period spend cap (requires perPeriod)"},perPeriod:{type:"string",enum:[...lD],description:"Per-period window"},employeeBalanceAccountResourceId:{type:"string",description:"Per-employee liability (CURRENT_LIABILITY) CoA resourceId; required for reimbursement conversion"},taxMode:{type:"string",enum:[..._Z],description:"Tax policy (NO_TAX or INCLUSIVE)"}},required:["name"],group:"claim_profiles",readOnly:!1,searchHint:"create claim profile policy approver limits",execute:async(e,t)=>{let r=t.name,n=await $M(e.client,r);return n?{_guard:"duplicate_skipped",message:`Claim profile "${r}" already exists.`,existing:n}:pM(e.client,{name:r,approverUserResourceId:t.approverUserResourceId,visibleClaimTypeIds:t.visibleClaimTypeIds,visibleTaxProfileIds:t.visibleTaxProfileIds,visibleClassifierIds:t.visibleClassifierIds,visibleVendorResourceIds:t.visibleVendorResourceIds,allowedCurrencies:t.allowedCurrencies,minClaimAmount:t.minClaimAmount,maxClaimAmount:t.maxClaimAmount,maxPerPeriodAmount:t.maxPerPeriodAmount,perPeriod:t.perPeriod,employeeBalanceAccountResourceId:t.employeeBalanceAccountResourceId,taxMode:t.taxMode})}},{name:"update_claim_profile",description:"Update a claim profile. Omitted fields unchanged; clearFields NULLs optional fields. Balance account cannot change while an employee has a non-zero balance.",params:{resourceId:{type:"string",description:"Claim profile resourceId"},name:{type:"string",description:"New name"},approverUserResourceId:{type:"string",description:"Default approver user resourceId"},visibleClaimTypeIds:{type:"array",items:{type:"string"},description:"Allowed claim type IDs (replaces)"},visibleTaxProfileIds:{type:"array",items:{type:"string"},description:"Allowed tax profile IDs (replaces)"},visibleClassifierIds:{type:"array",items:{type:"string"},description:"Allowed classifier IDs (replaces)"},visibleVendorResourceIds:{type:"array",items:{type:"string"},description:"Allowed vendor contact IDs (replaces)"},allowedCurrencies:{type:"array",items:{type:"string"},description:"Allowed ISO currency codes (replaces)"},minClaimAmount:{type:"number",description:"Min claim total"},maxClaimAmount:{type:"number",description:"Max claim total"},maxPerPeriodAmount:{type:"number",description:"Per-period spend cap"},perPeriod:{type:"string",enum:[...lD],description:"Per-period window"},employeeBalanceAccountResourceId:{type:"string",description:"Employee balance CoA resourceId"},taxMode:{type:"string",enum:[..._Z],description:"Tax policy (NO_TAX or INCLUSIVE)"},clearFields:{type:"array",items:{type:"string",enum:[...uD]},description:"Optional fields to NULL (clear)"}},required:["resourceId"],group:"claim_profiles",readOnly:!1,isDestructive:!0,searchHint:"update claim profile policy limits",execute:async(e,t)=>hM(e.client,t.resourceId,{name:t.name,approverUserResourceId:t.approverUserResourceId,visibleClaimTypeIds:t.visibleClaimTypeIds,visibleTaxProfileIds:t.visibleTaxProfileIds,visibleClassifierIds:t.visibleClassifierIds,visibleVendorResourceIds:t.visibleVendorResourceIds,allowedCurrencies:t.allowedCurrencies,minClaimAmount:t.minClaimAmount,maxClaimAmount:t.maxClaimAmount,maxPerPeriodAmount:t.maxPerPeriodAmount,perPeriod:t.perPeriod,employeeBalanceAccountResourceId:t.employeeBalanceAccountResourceId,taxMode:t.taxMode,...bg(t.clearFields,uD)})},Nt({name:"search_claim_profiles",description:"Search claim profiles.",group:"claim_profiles",fields:YT,defaults:HT,fetcher:zI,searchHint:"find claim profiles by name approver default limits balance account"}),br("list_claim_profiles","List claim profiles (alphabetical).","claim_profiles",(e,t,r)=>dM(e,{offset:t,limit:r}),"list claim profiles"),ri("get_claim_profile","Get a claim profile incl. nested balance account.","claim_profiles",(e,t)=>fM(e,t),"get claim profile details"),Ur("delete_claim_profile","Soft-delete a claim profile.","claim_profiles",(e,t)=>mM(e,t),"delete claim profile"),{name:"create_posting_rule",description:"Create a posting rule (how approved claims group into journals at conversion). outerAxis + innerAxis + lineDescriptionTemplate required. Dedups by name.",params:{name:{type:"string",description:"Rule name (unique per org)"},outerAxis:{type:"string",enum:[...fD],description:"Outer grouping axis"},innerAxis:{type:"string",enum:[...pD],description:"Inner line-aggregation axis"},lineDescriptionTemplate:{type:"string",description:'Handlebars line template, e.g. "{employeeName} - {claimType}"'},journalReferenceTemplate:{type:"string",description:"Optional Handlebars journal-header reference template"},defaultBankAccountResourceId:{type:"string",description:"Default reimbursement bank (Cash/Bank) account resourceId"},defaultIncludeReimbursementPayout:{type:"boolean",description:"Create reimbursement DCE by default"},isDefault:{type:"boolean",description:"Make org default rule"}},required:["name","outerAxis","innerAxis","lineDescriptionTemplate"],group:"posting_rules",readOnly:!1,searchHint:"create posting rule claim conversion grouping",execute:async(e,t)=>{let r=t.name,n=await qM(e.client,r);return n?{_guard:"duplicate_skipped",message:`Posting rule "${r}" already exists.`,existing:n}:yM(e.client,{name:r,outerAxis:t.outerAxis,innerAxis:t.innerAxis,lineDescriptionTemplate:t.lineDescriptionTemplate,journalReferenceTemplate:t.journalReferenceTemplate,defaultBankAccountResourceId:t.defaultBankAccountResourceId,defaultIncludeReimbursementPayout:t.defaultIncludeReimbursementPayout,isDefault:t.isDefault})}},{name:"update_posting_rule",description:"Update a posting rule. Omitted fields unchanged.",params:{resourceId:{type:"string",description:"Posting rule resourceId"},name:{type:"string",description:"New name"},outerAxis:{type:"string",enum:[...fD],description:"Outer grouping axis"},innerAxis:{type:"string",enum:[...pD],description:"Inner line-aggregation axis"},lineDescriptionTemplate:{type:"string",description:"Handlebars line template"},journalReferenceTemplate:{type:"string",description:"Journal-header reference template"},defaultBankAccountResourceId:{type:"string",description:"Default reimbursement bank account resourceId"},defaultIncludeReimbursementPayout:{type:"boolean",description:"Create reimbursement DCE by default"},isDefault:{type:"boolean",description:"Make org default rule"}},required:["resourceId"],group:"posting_rules",readOnly:!1,isDestructive:!0,searchHint:"update posting rule",execute:async(e,t)=>EM(e.client,t.resourceId,{name:t.name,outerAxis:t.outerAxis,innerAxis:t.innerAxis,lineDescriptionTemplate:t.lineDescriptionTemplate,journalReferenceTemplate:t.journalReferenceTemplate,defaultBankAccountResourceId:t.defaultBankAccountResourceId,defaultIncludeReimbursementPayout:t.defaultIncludeReimbursementPayout,isDefault:t.isDefault})},Nt({name:"search_posting_rules",description:"Search posting rules.",group:"posting_rules",fields:zT,defaults:JT,fetcher:JI,searchHint:"find posting rules by name axis default bank reimbursement"}),br("list_posting_rules","List posting rules (alphabetical).","posting_rules",(e,t,r)=>AM(e,{offset:t,limit:r}),"list posting rules"),ri("get_posting_rule","Get a posting rule.","posting_rules",(e,t)=>gM(e,t),"get posting rule details"),Ur("delete_posting_rule","Delete a posting rule. The org default cannot be deleted while default (set another default first).","posting_rules",(e,t)=>bM(e,t),"delete posting rule"),Nt({name:"search_claims",description:'Search/list employee-expense claims. Status: DRAFT|SUBMITTED|APPROVED|CONVERTED|REJECTED|CANCELLED (CONVERTED = "Processed"). Claims are born via create_claim, attachment, or conversion (no bare list; use search).',group:"claims",fields:PT,defaults:MT,fetcher:r2,searchHint:"find employee expense claims by status employee contact reference date amount"}),ri("get_claim","Get a claim incl. line items, employee, amounts, status.","claims",(e,t)=>LT(e,t),"get claim details line items"),{name:"create_claim",description:"Create an employee-expense claim directly (bare create, no attachment). Vendor is EITHER contactResourceId OR vendorName, never both. saveAsDraft defaults to true (lands DRAFT with relaxed line validation); set false to validate + submit in one call (lands SUBMITTED). reference is REQUIRED when submitting (saveAsDraft=false): omitting it returns 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT; a DRAFT saves without one.",params:{valueDate:{type:"string",description:"Business-transaction date (YYYY-MM-DD)"},currencyCode:{type:"string",description:"Claim currency (ISO 4217)"},saveAsDraft:{type:"boolean",description:"true (default) creates DRAFT; false validates + submits"},employeeResourceId:{type:"string",description:"Employee resourceId the claim is filed for"},contactResourceId:{type:"string",description:"Vendor contact resourceId (mutually exclusive with vendorName)"},vendorName:{type:"string",description:"Free-text vendor name (mutually exclusive with contactResourceId)"},reference:{type:"string",description:"User reference"},autoReference:uu,currencySymbol:{type:"string",description:"Currency symbol override"},taxInclusion:{type:"boolean",description:"Line amounts are tax-inclusive"},tags:{type:"array",items:{type:"string"},description:"Header-level tags"},internalNotes:{type:"string",description:"Internal notes (max 1000)"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId (defaults to org default)"},approverUserResourceId:{type:"string",description:"Approver user resourceId"},customFields:Tn,claimItems:llt},required:["valueDate","currencyCode"],group:"claims",readOnly:!1,searchHint:"create new employee expense claim draft vendor employee line items submit",execute:async(e,t)=>n2(e.client,{valueDate:t.valueDate,currencyCode:t.currencyCode,saveAsDraft:t.saveAsDraft,employeeResourceId:t.employeeResourceId,contactResourceId:t.contactResourceId,vendorName:t.vendorName,reference:await bU(e.client,"CLAIM",t.reference,t.autoReference),currencySymbol:t.currencySymbol,taxInclusion:t.taxInclusion,tags:t.tags,internalNotes:t.internalNotes,claimProfileResourceId:t.claimProfileResourceId,approverUserResourceId:t.approverUserResourceId,customFields:t.customFields,claimItems:t.claimItems})},{name:"update_claim",description:"Update a DRAFT claim (partial: omitted fields unchanged). claimItems non-empty REPLACES all lines, [] clears. Set saveAsDraft=false to validate + submit in one call: reference is REQUIRED at submit (else 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT); a DRAFT save needs none. Only DRAFT claims are editable.",params:{resourceId:{type:"string",description:"Claim resourceId"},saveAsDraft:{type:"boolean",description:"true (default) keeps editing; false validates + submits"},employeeResourceId:{type:"string",description:"Employee resourceId"},contactResourceId:{type:"string",description:"Vendor contact resourceId (mutually exclusive with vendorName)"},vendorName:{type:"string",description:"Free-text vendor name (mutually exclusive with contactResourceId)"},valueDate:{type:"string",description:"Business-transaction date (YYYY-MM-DD)"},reference:{type:"string",description:"User reference"},currencyCode:{type:"string",description:"Claim currency (ISO 4217)"},taxInclusion:{type:"boolean",description:"Line amounts are tax-inclusive"},tags:jo,internalNotes:{type:"string",description:"Internal notes (max 1000)"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId"},approverUserResourceId:{type:"string",description:"Approver user resourceId"},customFields:Tn,claimItems:llt},required:["resourceId"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"edit draft claim line items employee reference submit",execute:async(e,t)=>{let r=t.resourceId,n=Ui(t.tags),i=n&&await Yo("claim",r,()=>LT(e.client,r));return i2(e.client,r,{saveAsDraft:t.saveAsDraft,employeeResourceId:t.employeeResourceId,contactResourceId:t.contactResourceId,vendorName:t.vendorName,valueDate:t.valueDate,reference:t.reference,currencyCode:t.currencyCode,taxInclusion:t.taxInclusion,tags:n&&Ki(i?.tags,n),internalNotes:t.internalNotes,claimProfileResourceId:t.claimProfileResourceId,approverUserResourceId:t.approverUserResourceId,customFields:t.customFields,claimItems:t.claimItems})}},Ur("delete_claim","Delete a claim. Only DRAFT / REJECTED / CANCELLED claims are deletable (else 422).","claims",(e,t)=>o2(e,t),"delete remove claim record"),{name:"delete_claim_attachment",description:"Remove one attachment (receipt) from a claim. Returns the updated claim.",params:{resourceId:{type:"string",description:"Claim resourceId"},attachmentResourceId:{type:"string",description:"Attachment resourceId"}},required:["resourceId","attachmentResourceId"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"remove delete claim attachment receipt",execute:async(e,t)=>s2(e.client,t.resourceId,t.attachmentResourceId)},lge("submit_claim","Submit a DRAFT claim for approval (DRAFT \u2192 SUBMITTED). Server enforces the transition. The claim must carry a reference; a referenceless DRAFT returns 422 CLAIM_REFERENCE_REQUIRED_AT_SUBMIT (set it via update_claim first).","claims",(e,t)=>a2(e,t),{destructive:!0,searchHint:"submit draft claim for approval"}),lge("approve_claim","Approve a SUBMITTED claim (SUBMITTED \u2192 APPROVED). Approved claims become convertible to journals.","claims",(e,t)=>c2(e,t),{destructive:!0,searchHint:"approve submitted claim"}),{name:"reject_claim",description:"Reject a SUBMITTED/APPROVED claim with a reason (\u2192 REJECTED).",params:{resourceId:{type:"string",description:"Claim resourceId"},rejectionReason:{type:"string",description:"Rejection reason (1-1000 chars)"}},required:["resourceId","rejectionReason"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"reject claim with reason",execute:async(e,t)=>l2(e.client,t.resourceId,t.rejectionReason)},{name:"cancel_claim",description:"Cancel a DRAFT/SUBMITTED claim with a reason (\u2192 CANCELLED).",params:{resourceId:{type:"string",description:"Claim resourceId"},cancellationReason:{type:"string",description:"Cancellation reason (1-1000 chars)"}},required:["resourceId","cancellationReason"],group:"claims",readOnly:!1,isDestructive:!0,searchHint:"cancel claim with reason",execute:async(e,t)=>u2(e.client,t.resourceId,t.cancellationReason)},lge("unpost_claim","Unpost a CONVERTED claim: voids its journal, back to APPROVED. Re-unpost: 200 no-op. Aggregated claims unpost together. Ignores payouts (employee balance can go negative).","claims",(e,t)=>d2(e,t),{destructive:!0,searchHint:"unpost reverse converted claim conversion"}),{name:"bulk_submit_claims",description:`Bulk-submit DRAFT claims (ASYNC). Returns the final job if it finished, else a job handle {jobId,...} to poll with search_background_jobs by jobId for per-item results. ${rs} Max 500 ids. Each claim must have a reference; referenceless claims fail per-item with CLAIM_REFERENCE_REQUIRED_AT_SUBMIT (check the job result).`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk submit many claims async job",backgroundJob:Mn("Submit","claim","claims","resourceIds"),execute:async(e,t)=>f2(e.client,t.resourceIds)},{name:"bulk_approve_claims",description:`Bulk-approve SUBMITTED claims (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk approve many claims async job",backgroundJob:Mn("Approve","claim","claims","resourceIds"),execute:async(e,t)=>p2(e.client,t.resourceIds)},{name:"bulk_reject_claims",description:`Bulk-reject claims with one shared reason (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O,rejectionReason:{type:"string",description:"Reason applied to the whole batch (1-1000 chars)"}},required:["resourceIds","rejectionReason"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk reject many claims async job reason",backgroundJob:Mn("Reject","claim","claims","resourceIds"),execute:async(e,t)=>m2(e.client,t.resourceIds,t.rejectionReason)},{name:"bulk_cancel_claims",description:`Bulk-cancel claims with one shared reason (ASYNC). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O,cancellationReason:{type:"string",description:"Reason applied to the whole batch (1-1000 chars)"}},required:["resourceIds","cancellationReason"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk cancel many claims async job reason",backgroundJob:Mn("Cancel","claim","claims","resourceIds"),execute:async(e,t)=>A2(e.client,t.resourceIds,t.cancellationReason)},{name:"bulk_delete_claims",description:`Bulk-delete claims (ASYNC; only DRAFT/REJECTED/CANCELLED are deletable). Returns the final job if it finished, else a job handle to poll with search_background_jobs by jobId. ${rs} Max 500 ids.`,params:{resourceIds:_O},required:["resourceIds"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"bulk delete many claims async job",backgroundJob:Mn("Delete","claim","claims","resourceIds"),execute:async(e,t)=>h2(e.client,t.resourceIds)},{name:"get_claim_tracking_tags",description:"List the tracking-tag values available across claims (picker; returns a bare array).",params:{},required:[],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"list claim tracking tags picker",execute:async e=>g2(e.client)},{name:"get_claim_custom_field_values",description:"List the custom-field values available across claims (picker; returns a bare array).",params:{},required:[],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"list claim custom field values picker",execute:async e=>y2(e.client)},{name:"preview_claims_conversion",description:"Preview the journals an APPROVED claim batch would produce at conversion, no write. Returns expenseSubTotal, previewJournals, and reimbursement DCE counts; non-APPROVED claims come back under erroredClaims (check it is empty before converting). Needs a default posting rule or an explicit postingRuleResourceId.",params:{claimResourceIds:{type:"array",items:{type:"string"},description:"APPROVED claim resourceIds (1-500)"},postingRuleResourceId:{type:"string",description:"Posting rule resourceId (null \u2192 org default rule)"},payoutFlow:{type:"string",enum:[...eO],description:"POST (journals only) or POST_AND_RECORD (+ books-only reimbursement DCE)"},includeReimbursementPayout:{type:"boolean",description:"Include per-employee reimbursement DCE lines"},bankAccountResourceId:{type:"string",description:"Reimbursement bank account for preview validation"}},required:["claimResourceIds"],group:"claim_processing",readOnly:!0,isConcurrencySafe:!0,searchHint:"preview claim conversion journals before posting",execute:async(e,t)=>e8(e.client,{claimResourceIds:t.claimResourceIds,postingRuleResourceId:t.postingRuleResourceId,payoutFlow:t.payoutFlow,includeReimbursementPayout:t.includeReimbursementPayout,bankAccountResourceId:t.bankAccountResourceId})},{name:"convert_claims_to_journal",description:"Convert an APPROVED claim batch into journals (atomic write). valueDate (YYYY-MM-DD) required. Preview first and confirm erroredClaims is empty. idempotencyKey is auto-generated for safe retries (pass your own to dedup across calls). includeReimbursementPayout adds a books-only reimbursement DCE; real-money disburse is intentionally not exposed.",params:{claimResourceIds:{type:"array",items:{type:"string"},description:"APPROVED claim resourceIds (1-500)"},valueDate:{type:"string",description:"Journal value date (YYYY-MM-DD)"},postingRuleResourceId:{type:"string",description:"Posting rule resourceId (null \u2192 org default rule)"},includeReimbursementPayout:{type:"boolean",description:"Create books-only reimbursement DCEs"},bankAccountResourceIdOverride:{type:"string",description:"Override the rule default reimbursement bank account"},contactResourceId:{type:"string",description:"Clearing contact for the reimbursement DCE cash-out"},idempotencyKey:{type:"string",description:"Optional retry-dedup token (must not start with CONV: / CONV-); auto-generated if omitted"}},required:["claimResourceIds","valueDate"],group:"claim_processing",readOnly:!1,isDestructive:!0,searchHint:"convert post approved claims to journal entries",execute:async(e,t)=>t8(e.client,{claimResourceIds:t.claimResourceIds,valueDate:t.valueDate,postingRuleResourceId:t.postingRuleResourceId,includeReimbursementPayout:t.includeReimbursementPayout,bankAccountResourceIdOverride:t.bankAccountResourceIdOverride,contactResourceId:t.contactResourceId,idempotencyKey:t.idempotencyKey||tSr()})},{name:"record_employee_payout",description:"Record a books-only employee payout (reimbursement or advance): a DCE, no real-money transfer. amount, paymentAccountResourceId and valueDate are required; reference auto-generated if omitted.",params:{employeeResourceId:{type:"string",description:"Employee resourceId"},amount:{type:"number",description:"Payout amount (> 0)"},paymentAccountResourceId:{type:"string",description:"Bank/cash account the DCE credits"},valueDate:{type:"string",description:"Value date (YYYY-MM-DD)"},payoutFor:{type:"string",enum:[...dat],description:"Classification (null \u2192 ADVANCE)"},currencyCode:{type:"string",description:"Settle currency (ISO 4217; omit \u2192 payment account currency)"},reference:{type:"string",description:"Payout reference (auto-generated if omitted)"},description:{type:"string",description:"Line description on the DCE"},internalNotes:{type:"string",description:"Internal notes"}},required:["employeeResourceId","amount","paymentAccountResourceId","valueDate"],group:"claim_processing",readOnly:!1,searchHint:"record employee reimbursement advance payout books-only DCE",execute:async(e,t)=>r8(e.client,{employeeResourceId:t.employeeResourceId,amount:t.amount,paymentAccountResourceId:t.paymentAccountResourceId,valueDate:t.valueDate,payoutFor:t.payoutFor,currencyCode:t.currencyCode,reference:t.reference||Lo("EP"),description:t.description,internalNotes:t.internalNotes})},Nt({name:"search_employee_payouts",description:"Search recorded employee payouts (reimbursements + advances).",group:"claim_processing",fields:UT,defaults:$T,fetcher:n8,searchHint:"find employee payouts reimbursements advances by employee reference status type"}),{name:"add_employee",description:"Create an employee (expense-claim member). claimProfileResourceId is REQUIRED (carries the employee balance account; the org default is NOT auto-applied). userResourceId is optional: omit for an offline employee with no login. Dedups by email.",params:{name:{type:"string",description:"Employee display name"},userResourceId:{type:"string",description:"Login user's resourceId to link: the userResourceId field from search_org_users, NOT the org-user record id (else EMPLOYEE_USER_NOT_FOUND). Optional"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId, REQUIRED (carries the employee balance account; org default NOT auto-applied \u2192 EMPLOYEE_CLAIM_PROFILE_REQUIRED). search_claim_profiles"},email:{type:"string",description:"Work email (per-org unique)"},phone:{type:"string",description:"Phone (per-org unique)"},managerEmployeeResourceId:{type:"string",description:"Manager employee resourceId"},active:{type:"boolean",description:"Active flag (default true)"},employmentType:{type:"string",enum:[...Ig],description:"Employment classification"}},required:["name","claimProfileResourceId"],group:"employees",readOnly:!1,searchHint:"create add employee claim member bind user",execute:async(e,t)=>{let r=t.email;if(r){let n=await jM(e.client,r);if(n)return{_guard:"duplicate_skipped",message:`Employee with email "${r}" already exists.`,existing:n}}return DM(e.client,{name:t.name,userResourceId:t.userResourceId,claimProfileResourceId:t.claimProfileResourceId,email:r,phone:t.phone,managerEmployeeResourceId:t.managerEmployeeResourceId,active:t.active,employmentType:t.employmentType})}},{name:"update_employee",description:"Update an employee (partial; omitted or null = no change). Clear only via clearFields (userResourceId = unlink). To ARCHIVE, set active=false (reversible, prefer over delete_employee).",params:{resourceId:{type:"string",description:"Employee resourceId"},name:{type:"string",description:"New name"},email:{type:"string",description:"Work email"},phone:{type:"string",description:"Phone"},managerEmployeeResourceId:{type:"string",description:"Manager employee resourceId"},claimProfileResourceId:{type:"string",description:"Claim profile resourceId"},active:{type:"boolean",description:"Active flag, set false to archive"},employmentType:{type:"string",enum:[...Ig],description:"Employment classification"},userResourceId:{type:"string",description:"Login user to link/relink (search_org_users userResourceId)"},clearFields:{type:"array",items:{type:"string",enum:[...TZ]},description:"Fields to clear"}},required:["resourceId"],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"update edit archive employee active claim profile",execute:async(e,t)=>RM(e.client,t.resourceId,{name:t.name,email:t.email,phone:t.phone,managerEmployeeResourceId:t.managerEmployeeResourceId,claimProfileResourceId:t.claimProfileResourceId,active:t.active,employmentType:t.employmentType,userResourceId:t.userResourceId,clearFields:t.clearFields})},Nt({name:"search_employees",description:"Search employees by name, email, phone, manager, claim profile, active, currency.",group:"employees",fields:GT,defaults:VT,fetcher:VI,searchHint:"find employees claim members by name email manager profile active"}),Nt({name:"search_employee_balances",description:"Search the employee-balance directory (per-currency reimbursement balances owed).",group:"employees",fields:WT,defaults:KT,fetcher:vM,searchHint:"employee reimbursement balances owed by currency employment type"}),ri("get_employee","Get an employee incl. claim profile + user binding.","employees",(e,t)=>SM(e,t),"get employee details binding balance"),Ur("delete_employee","Delete an employee (server validates they are settled). Prefer update_employee active=false to archive reversibly.","employees",(e,t)=>TM(e,t),"delete remove employee"),{name:"bind_employee_user",description:"Bind a login user to an OFFLINE employee (no user bound yet, e.g. imported without a binding email). Refused once bound: relink or unlink via update_employee.",params:{resourceId:{type:"string",description:"Employee resourceId"},userResourceId:{type:"string",description:"Login user's resourceId: the userResourceId FIELD from search_org_users, NOT the org-user record id (else EMPLOYEE_USER_NOT_FOUND)"}},required:["resourceId","userResourceId"],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"bind link login user to employee",execute:async(e,t)=>xM(e.client,t.resourceId,t.userResourceId)},{name:"preprocess_employees_file",description:"Preprocess an uploaded employee import sheet (CSV/XLSX); returns a parsed row preview to review before import_employees. Provide the sheet fileUrl.",params:{fileUrl:{type:"string",description:"URL of the uploaded employee sheet"},fileName:{type:"string",description:"Display file name"},fileType:{type:"string",enum:["CSV","EML","HEIC","JPEG","JPG","PDF","PNG","TEXT","XLS","XLSX"],description:"File type (use CSV / XLS / XLSX for employee sheets)"}},required:["fileUrl"],group:"employees",readOnly:!0,fetchesCallerUrl:!0,isConcurrencySafe:!0,searchHint:"preprocess preview employee import sheet csv xlsx",execute:async(e,t)=>kM(e.client,{fileUrl:t.fileUrl,fileName:t.fileName,fileType:t.fileType})},{name:"import_employees",description:`Bulk create/update/delete employees (max 100 rows per array). Rows validate synchronously (422 row errors), then an async job queues: the result is the final job if it finished, else poll search_background_jobs by jobId. ${rs} Create rows need name + claimProfileResourceId (userResourceId optional).`,params:{create:{type:"array",description:"Create rows",items:{type:"object",properties:{name:{type:"string"},email:{type:"string"},userResourceId:{type:"string"},claimProfileResourceId:{type:"string"},employmentType:{type:"string",enum:[...Ig]},managerEmployeeResourceId:{type:"string"},active:{type:"boolean"}},required:["name"]}},update:{type:"array",description:"Update rows",items:{type:"object",properties:{employeeResourceId:{type:"string"},name:{type:"string"},email:{type:"string"},employmentType:{type:"string",enum:[...Ig]},active:{type:"boolean"}},required:["employeeResourceId"]}},delete:{type:"array",description:"Delete rows",items:{type:"object",properties:{employeeResourceId:{type:"string"}},required:["employeeResourceId"]}}},required:[],group:"employees",readOnly:!1,isDestructive:!0,searchHint:"bulk import employees create update delete sheet async",backgroundJob:Mn("Import","employee change","employee changes","create","update","delete"),execute:async(e,t)=>NM(e.client,{create:t.create,update:t.update,delete:t.delete})},br("list_inventory_items","List inventory-tracked items with stock details, COGS accounts, and purchase/sale accounts.","inventory",(e,t,r)=>cW(e,{limit:r,offset:t}),"list inventory items stock levels quantities"),{name:"get_inventory_balance",description:"Get current inventory balance for a specific item: quantity on hand, average cost, base unit.",params:{itemResourceId:{type:"string",description:"Item resourceId"}},required:["itemResourceId"],group:"inventory",readOnly:!0,searchHint:"get inventory balance stock level for item",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>uW(e.client,t.itemResourceId)},{name:"list_inventory_balances",description:"List stock on hand, average cost and value per inventory item. One item: get_inventory_balance.",params:{status:{type:"string",enum:[...dW],description:"Default ALL"},...FO},required:[],group:"inventory",readOnly:!0,searchHint:"stock on hand all items",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>{let{limit:r,offset:n}=QO(t),i=t.status??"ALL";return ch((o,s)=>fW(e.client,i,{limit:s,offset:o}),r,n,100)}},{name:"create_inventory_item",description:"Create a new inventory-tracked item. Requires itemCode, name, unit, costingMethod (FIXED or WAC) and three account links. Use --input for full JSON body.",params:{itemCode:{type:"string",description:"Unique item code (SKU)"},name:{type:"string",description:"Item name"},unit:{type:"string",description:'Unit of measure, e.g. "pcs"'},costingMethod:{type:"string",enum:["FIXED","WAC"],description:"Costing method: FIXED or WAC"},cogsResourceId:{type:"string",description:"COGS account resourceId (Direct Costs type)"},purchaseAccountResourceId:{type:"string",description:"Purchase account resourceId (Inventory type)"},saleAccountResourceId:{type:"string",description:"Sale account resourceId"},blockInsufficientDeductions:{type:"boolean",description:"Block transactions when insufficient stock (default: false)"}},required:["itemCode","name","unit","costingMethod","cogsResourceId","purchaseAccountResourceId","saleAccountResourceId"],group:"inventory",readOnly:!1,searchHint:"create new inventory tracked stock item",execute:async(e,t)=>lW(e.client,{itemCode:t.itemCode,name:t.name,unit:t.unit,costingMethod:t.costingMethod,cogsResourceId:t.cogsResourceId,purchaseAccountResourceId:t.purchaseAccountResourceId,saleAccountResourceId:t.saleAccountResourceId,appliesToSale:!0,appliesToPurchase:!0,blockInsufficientDeductions:t.blockInsufficientDeductions??!1})},Ur("delete_contact","Delete a contact. Cannot delete contacts with existing transactions.","contacts",(e,t)=>vP(e,t),"permanently delete a customer supplier contact"),Ur("delete_account","Delete a chart of accounts entry. Cannot delete accounts with existing transactions.","accounts",(e,t)=>HP(e,t),"permanently delete a chart of accounts entry"),ri("get_cash_transfer","Fetch a cash transfer by cashflow-transaction resourceId (search_cashflow_transactions) or the parentEntityResourceId create returns.","cash_transfers",(e,t)=>iV(e,t),"get cash transfer details between accounts"),TO("download_credit_note_pdf","customer credit note","customer_credit_notes",(e,t)=>cj(e,t)),{name:"get_transaction_summary",description:`Get a complete summary of any transaction: fetches the transaction, its attachments, and payment history in one call.
806
806
  Works for invoices, bills, customer credit notes, supplier credit notes, and journals. Invoices and bills carry payments, credit notes refunds, journals neither. A failed leg omits its keys and is named in 'partialFailures'.`,params:{transactionType:{type:"string",enum:["invoice","bill","customer_credit_note","supplier_credit_note","journal"],description:"Transaction type"},resourceId:{type:"string",description:"Transaction resourceId"}},required:["transactionType","resourceId"],group:"search",readOnly:!0,searchHint:"transaction summary attachments payments refunds",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>{let r=t.resourceId,n=n3[t.transactionType]??n3.journal,[i,o,s]=await Promise.allSettled([n.get(e.client,r),gi(e.client,n.attachType,r),n.settlements?n.settlements(e.client,r):Promise.resolve(void 0)]);if(i.status==="rejected")throw i.reason;let a=p=>{let h=p.reason instanceof Error?p.reason.message:typeof p.reason=="string"?p.reason:(()=>{try{return JSON.stringify(p.reason)??"unknown error"}catch{return"unknown error"}})();return h.length>300?`${h.slice(0,297)}...`:h},c=[];o.status==="rejected"&&c.push(`attachments: ${a(o)}`),s.status==="rejected"&&c.push(`${n.settlementKey}: ${a(s)}`);let u=p=>Array.isArray(p)?p:Array.isArray(p?.data)?p.data:void 0,d=o.status==="fulfilled"?u(o.value):void 0,f=s.status==="fulfilled"?u(s.value):void 0;return{...c.length?{partialFailures:c}:{},transaction:i.value.data,...d?{attachments:d,attachmentCount:d.length}:{},...f?{[n.settlementKey]:f,[n.settlementCountKey]:f.length}:{}}}},{name:"bulk_finalize_drafts",description:"Finalize multiple draft transactions in one call. Attempts finalization for each item and returns per-item pass/fail results. Supports invoices, bills, and credit notes.",params:{items:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["invoice","bill","customer_credit_note","supplier_credit_note"],description:"Transaction type"},resourceId:{type:"string",description:"Transaction resourceId"}},required:["type","resourceId"]},description:"Array of {type, resourceId} to finalize"}},required:["items"],group:"drafts",readOnly:!1,searchHint:"bulk finalize approve multiple draft transactions",isDestructive:!0,execute:async(e,t)=>{let r=t.items,n=[];for(let i of r){let o=mge.includes(i.type)?typeof i.resourceId!="string"||i.resourceId.trim()===""?"resourceId is required":void 0:`type must be one of ${mge.join(", ")}`;if(o){let s="btResourceId"in i||"btType"in i?" A validate_drafts result names them btType and btResourceId: map btType SALE to invoice, PURCHASE to bill, SALE_CREDIT_NOTE to customer_credit_note, PURCHASE_CREDIT_NOTE to supplier_credit_note, and btResourceId to resourceId.":"";n.push({...i,success:!1,error:`${o}.${s}`});continue}try{let s=await xO(e.client,i.type,i.resourceId,{});i.type==="invoice"?await Ex(e.client,i.resourceId,s):i.type==="bill"?await GS(e.client,i.resourceId,s):i.type==="customer_credit_note"?await jx(e.client,i.resourceId,s):i.type==="supplier_credit_note"&&await Vx(e.client,i.resourceId,s),n.push({...i,success:!0})}catch(s){n.push({...i,success:!1,error:s instanceof Error?s.message:String(s)})}}return{total:r.length,succeeded:n.filter(i=>i.success).length,failed:n.filter(i=>!i.success).length,results:n}}},{name:"bulk_invite_org_users",description:"Invite multiple users to the organization in one call. Accepts an array of user objects. Each user follows the same contract as invite_org_user. Returns per-user pass/fail results.",params:{users:{type:"array",items:{type:"object",properties:{email:{type:"string",description:"User email"},firstName:{type:"string",description:"First name"},lastName:{type:"string",description:"Last name"},userType:{type:"string",enum:[...Bg],description:"ADMIN = full access (moduleRoles ignored). CUSTOM_USER = per-module access via moduleRoles."},moduleRoles:{type:"array",items:{type:"object",properties:{moduleName:{type:"string",enum:[...uC]},roleCode:{type:"string",enum:[...Ng]}},required:["moduleName","roleCode"]},description:"Use when userType is CUSTOM_USER; ignored for ADMIN."}},required:["email","firstName","lastName","userType"]},description:"Array of users to invite"}},required:["users"],group:"org_users",readOnly:!1,openWorld:!0,searchHint:"bulk invite multiple users to organization",execute:async(e,t)=>{let r=t.users,n=[];for(let i of r)try{ff({userType:i.userType,moduleRoles:i.moduleRoles});let o=await ev(e.client,i);n.push({email:i.email,success:!0,resourceId:o.data?.resourceId})}catch(o){n.push({email:i.email,success:!1,error:o instanceof Error?o.message:String(o)})}return{total:r.length,succeeded:n.filter(i=>i.success).length,failed:n.filter(i=>!i.success).length,results:n}}},{name:"bulk_create_contacts",description:`Create multiple contacts in one call. Deduplicates against existing contacts (exact name match).
807
807
  Returns per-contact result: created, skipped (duplicate), or failed.`,params:{contacts:{type:"array",items:{type:"object",properties:{billingName:{type:"string",description:"Official billing name"},name:{type:"string",description:"Display name"},email:{type:"string",description:"Primary email"},customer:{type:"boolean",description:"Is a customer"},supplier:{type:"boolean",description:"Is a supplier"}},required:["billingName"]},description:"Array of contacts to create"},skipDuplicates:{type:"boolean",description:"Skip contacts that match existing names (default true)"}},required:["contacts"],group:"contacts",readOnly:!1,searchHint:"bulk create multiple customer supplier contacts",execute:async(e,t)=>{let r=t.contacts,n=t.skipDuplicates??!0,i=[];for(let o of r)try{if(n){let a=await bD(e.client,o.name??o.billingName);if(a){i.push({billingName:o.billingName,status:"skipped",resourceId:a.resourceId});continue}}let s=await NI(e.client,{billingName:o.billingName,name:o.name??o.billingName,emails:o.email?[o.email]:void 0,customer:o.customer??!0,supplier:o.supplier??!1});i.push({billingName:o.billingName,status:"created",resourceId:s.data.resourceId})}catch(s){i.push({billingName:o.billingName,status:"failed",error:s instanceof Error?s.message:String(s)})}return{total:r.length,created:i.filter(o=>o.status==="created").length,skipped:i.filter(o=>o.status==="skipped").length,failed:i.filter(o=>o.status==="failed").length,results:i}}},...$Sr,{name:"quick_fix_transactions",description:`One record, or other fields on many records of one type. Contact/date/capsule/tags on several: preview_ledger_find_fix.
808
808
 
@@ -130,29 +130,22 @@
130
130
  "label": "Beneficiaries"
131
131
  },
132
132
  {
133
- "key": "deferrals.completed.all",
134
- "path": "/deferrals/completed/all",
133
+ "key": "deferrals.eligible.all",
134
+ "path": "/deferrals/eligible/all",
135
135
  "label": "All"
136
136
  },
137
137
  {
138
- "key": "deferrals.completed.closed-out",
139
- "path": "/deferrals/completed/closed-out",
140
- "label": "Closed Out"
141
- },
142
- {
143
- "key": "deferrals.completed.fully-amortized",
144
- "path": "/deferrals/completed/fully-amortized",
145
- "label": "Fully Amortized"
146
- },
147
- {
148
- "key": "deferrals.eligible.all",
149
- "path": "/deferrals/eligible/all",
138
+ "key": "deferrals.inactive.all",
139
+ "path": "/deferrals/inactive/all",
150
140
  "label": "All"
151
141
  },
152
142
  {
153
143
  "key": "deferrals.register.active",
154
144
  "path": "/deferrals/register/active",
155
- "label": "Active"
145
+ "label": "Active",
146
+ "aliases": [
147
+ "deferrals"
148
+ ]
156
149
  },
157
150
  {
158
151
  "key": "deferrals.register.draft",
@@ -253,38 +246,39 @@
253
246
  "label": "In Progress"
254
247
  },
255
248
  {
256
- "key": "fixed-assets.disposals.all",
257
- "path": "/fixed-assets/disposals/all",
249
+ "key": "fixed-assets.eligible.all",
250
+ "path": "/fixed-assets/eligible/all",
251
+ "label": "All"
252
+ },
253
+ {
254
+ "key": "fixed-assets.inactive.all",
255
+ "path": "/fixed-assets/inactive/all",
258
256
  "label": "All",
259
257
  "aliases": [
260
- "disposals"
258
+ "disposals",
259
+ "inactive"
261
260
  ]
262
261
  },
263
262
  {
264
- "key": "fixed-assets.disposals.discarded",
265
- "path": "/fixed-assets/disposals/discarded",
266
- "label": "Discarded"
263
+ "key": "fixed-assets.inactive.closed-out",
264
+ "path": "/fixed-assets/inactive/closed-out",
265
+ "label": "Closed Out"
267
266
  },
268
267
  {
269
- "key": "fixed-assets.disposals.sold",
270
- "path": "/fixed-assets/disposals/sold",
271
- "label": "Sold"
268
+ "key": "fixed-assets.inactive.discarded",
269
+ "path": "/fixed-assets/inactive/discarded",
270
+ "label": "Discarded"
272
271
  },
273
272
  {
274
- "key": "fixed-assets.eligible.all",
275
- "path": "/fixed-assets/eligible/all",
276
- "label": "All"
273
+ "key": "fixed-assets.inactive.sold",
274
+ "path": "/fixed-assets/inactive/sold",
275
+ "label": "Sold"
277
276
  },
278
277
  {
279
278
  "key": "fixed-assets.register.active",
280
279
  "path": "/fixed-assets/register/active",
281
280
  "label": "Active"
282
281
  },
283
- {
284
- "key": "fixed-assets.register.close-out",
285
- "path": "/fixed-assets/register/close-out",
286
- "label": "Close Out"
287
- },
288
282
  {
289
283
  "key": "fixed-assets.register.draft",
290
284
  "path": "/fixed-assets/register/draft",
@@ -426,6 +420,67 @@
426
420
  "path": "/journal-entries/manual-journals/voided",
427
421
  "label": "Voided"
428
422
  },
423
+ {
424
+ "key": "leases.inactive.all",
425
+ "path": "/leases/inactive/all",
426
+ "label": "All"
427
+ },
428
+ {
429
+ "key": "leases.inactive.closed-out",
430
+ "path": "/leases/inactive/closed-out",
431
+ "label": "Closed Out"
432
+ },
433
+ {
434
+ "key": "leases.inactive.terminated",
435
+ "path": "/leases/inactive/terminated",
436
+ "label": "Terminated"
437
+ },
438
+ {
439
+ "key": "leases.register.active",
440
+ "path": "/leases/register/active",
441
+ "label": "Active",
442
+ "aliases": [
443
+ "leases"
444
+ ]
445
+ },
446
+ {
447
+ "key": "leases.register.draft",
448
+ "path": "/leases/register/draft",
449
+ "label": "Draft"
450
+ },
451
+ {
452
+ "key": "loans.inactive.all",
453
+ "path": "/loans/inactive/all",
454
+ "label": "All"
455
+ },
456
+ {
457
+ "key": "loans.inactive.closed-out",
458
+ "path": "/loans/inactive/closed-out",
459
+ "label": "Closed Out"
460
+ },
461
+ {
462
+ "key": "loans.inactive.fully-repaid",
463
+ "path": "/loans/inactive/fully-repaid",
464
+ "label": "Fully Repaid"
465
+ },
466
+ {
467
+ "key": "loans.inactive.settled",
468
+ "path": "/loans/inactive/settled",
469
+ "label": "Settled"
470
+ },
471
+ {
472
+ "key": "loans.register.active",
473
+ "path": "/loans/register/active",
474
+ "label": "Active",
475
+ "aliases": [
476
+ "loans"
477
+ ]
478
+ },
479
+ {
480
+ "key": "loans.register.draft",
481
+ "path": "/loans/register/draft",
482
+ "label": "Draft"
483
+ },
429
484
  {
430
485
  "key": "mailbox.annual.action-needed",
431
486
  "path": "/mailbox/annual/action-needed",
@@ -1245,6 +1300,26 @@
1245
1300
  "path": "/reports/journals/transactions-summary",
1246
1301
  "label": "Transactions Summary"
1247
1302
  },
1303
+ {
1304
+ "key": "reports.leases.reconciliation-summary",
1305
+ "path": "/reports/leases/reconciliation-summary",
1306
+ "label": "Reconciliation Summary"
1307
+ },
1308
+ {
1309
+ "key": "reports.leases.register",
1310
+ "path": "/reports/leases/register",
1311
+ "label": "Register"
1312
+ },
1313
+ {
1314
+ "key": "reports.loans.reconciliation-summary",
1315
+ "path": "/reports/loans/reconciliation-summary",
1316
+ "label": "Reconciliation Summary"
1317
+ },
1318
+ {
1319
+ "key": "reports.loans.register",
1320
+ "path": "/reports/loans/register",
1321
+ "label": "Register"
1322
+ },
1248
1323
  {
1249
1324
  "key": "reports.profit-and-loss",
1250
1325
  "path": "/reports/profit-and-loss",
@@ -1692,6 +1767,21 @@
1692
1767
  "key": "scheduled.subscriptions.transactions.set-to-cancel",
1693
1768
  "path": "/scheduled/subscriptions/transactions/set-to-cancel",
1694
1769
  "label": "Set To Cancel"
1770
+ },
1771
+ {
1772
+ "key": "validate",
1773
+ "path": "/validate",
1774
+ "label": "Validate"
1775
+ },
1776
+ {
1777
+ "key": "validate.dashboard",
1778
+ "path": "/validate/dashboard",
1779
+ "label": "Dashboard"
1780
+ },
1781
+ {
1782
+ "key": "validate.reports",
1783
+ "path": "/validate/reports",
1784
+ "label": "Reports"
1695
1785
  }
1696
1786
  ],
1697
1787
  "modals": [
@@ -2043,6 +2133,15 @@
2043
2133
  "label": "Manage Bank Rules",
2044
2134
  "requiresId": false
2045
2135
  },
2136
+ {
2137
+ "key": "bank-reconciliation.modal.match-to-transaction",
2138
+ "resource": "bank-reconciliation",
2139
+ "modalType": "match-to-transaction",
2140
+ "urlTemplate": "?modal=match-to-transaction",
2141
+ "mountPath": "/bank-reconciliation/bank-accounts",
2142
+ "label": "Match To Transaction",
2143
+ "requiresId": false
2144
+ },
2046
2145
  {
2047
2146
  "key": "bank-reconciliation.modal.new-bank-account",
2048
2147
  "resource": "bank-reconciliation",
@@ -2322,6 +2421,15 @@
2322
2421
  "label": "Cashflow Import Direct Cash Journal",
2323
2422
  "requiresId": false
2324
2423
  },
2424
+ {
2425
+ "key": "cashflow.modal.cashflow-import-direct-cash-journal-any-csv",
2426
+ "resource": "cashflow",
2427
+ "modalType": "cashflow-import-direct-cash-journal-any-csv",
2428
+ "urlTemplate": "?modal=cashflow-import-direct-cash-journal-any-csv",
2429
+ "mountPath": "/cashflow/all-cashflow/all",
2430
+ "label": "Cashflow Import Direct Cash Journal Any Csv",
2431
+ "requiresId": false
2432
+ },
2325
2433
  {
2326
2434
  "key": "cashflow.modal.cashflow-new-cash-in",
2327
2435
  "resource": "cashflow",
@@ -3152,7 +3260,11 @@
3152
3260
  "urlTemplate": "?modal=new-deferral",
3153
3261
  "mountPath": "/deferrals/register/active",
3154
3262
  "label": "New Deferral",
3155
- "requiresId": false
3263
+ "requiresId": false,
3264
+ "aliases": [
3265
+ "new deferral",
3266
+ "prepayment"
3267
+ ]
3156
3268
  },
3157
3269
  {
3158
3270
  "key": "deferrals.modal.view-deferral",
@@ -3777,6 +3889,96 @@
3777
3889
  "label": "View Schedule Journal",
3778
3890
  "requiresId": true
3779
3891
  },
3892
+ {
3893
+ "key": "leases.modal.duplicate-lease",
3894
+ "resource": "leases",
3895
+ "modalType": "duplicate-lease",
3896
+ "urlTemplate": "?modal=duplicate-lease&id={id}",
3897
+ "mountPath": "/leases/register/active",
3898
+ "label": "Duplicate Lease",
3899
+ "requiresId": true
3900
+ },
3901
+ {
3902
+ "key": "leases.modal.edit-lease",
3903
+ "resource": "leases",
3904
+ "modalType": "edit-lease",
3905
+ "urlTemplate": "?modal=edit-lease&id={id}",
3906
+ "mountPath": "/leases/register/active",
3907
+ "label": "Edit Lease",
3908
+ "requiresId": true,
3909
+ "draftEditable": true
3910
+ },
3911
+ {
3912
+ "key": "leases.modal.new-lease",
3913
+ "resource": "leases",
3914
+ "modalType": "new-lease",
3915
+ "urlTemplate": "?modal=new-lease",
3916
+ "mountPath": "/leases/register/active",
3917
+ "label": "New Lease",
3918
+ "requiresId": false,
3919
+ "aliases": [
3920
+ "new lease"
3921
+ ]
3922
+ },
3923
+ {
3924
+ "key": "leases.modal.view-lease",
3925
+ "resource": "leases",
3926
+ "modalType": "view-lease",
3927
+ "urlTemplate": "?modal=view-lease&id={id}",
3928
+ "mountPath": "/leases/register/active",
3929
+ "label": "View Lease",
3930
+ "requiresId": true
3931
+ },
3932
+ {
3933
+ "key": "loans.modal.duplicate-loan",
3934
+ "resource": "loans",
3935
+ "modalType": "duplicate-loan",
3936
+ "urlTemplate": "?modal=duplicate-loan&id={id}",
3937
+ "mountPath": "/loans/register/active",
3938
+ "label": "Duplicate Loan",
3939
+ "requiresId": true
3940
+ },
3941
+ {
3942
+ "key": "loans.modal.edit-loan",
3943
+ "resource": "loans",
3944
+ "modalType": "edit-loan",
3945
+ "urlTemplate": "?modal=edit-loan&id={id}",
3946
+ "mountPath": "/loans/register/active",
3947
+ "label": "Edit Loan",
3948
+ "requiresId": true,
3949
+ "draftEditable": true
3950
+ },
3951
+ {
3952
+ "key": "loans.modal.import-loans",
3953
+ "resource": "loans",
3954
+ "modalType": "import-loans",
3955
+ "urlTemplate": "?modal=import-loans",
3956
+ "mountPath": "/loans/register/active",
3957
+ "label": "Import Loans",
3958
+ "requiresId": false
3959
+ },
3960
+ {
3961
+ "key": "loans.modal.new-loan",
3962
+ "resource": "loans",
3963
+ "modalType": "new-loan",
3964
+ "urlTemplate": "?modal=new-loan",
3965
+ "mountPath": "/loans/register/active",
3966
+ "label": "New Loan",
3967
+ "requiresId": false,
3968
+ "aliases": [
3969
+ "new loan",
3970
+ "borrowing"
3971
+ ]
3972
+ },
3973
+ {
3974
+ "key": "loans.modal.view-loan",
3975
+ "resource": "loans",
3976
+ "modalType": "view-loan",
3977
+ "urlTemplate": "?modal=view-loan&id={id}",
3978
+ "mountPath": "/loans/register/active",
3979
+ "label": "View Loan",
3980
+ "requiresId": true
3981
+ },
3780
3982
  {
3781
3983
  "key": "purchase-credits.modal.duplicate-purchase-credit",
3782
3984
  "resource": "purchase-credits",
@@ -5348,6 +5550,51 @@
5348
5550
  "tax",
5349
5551
  "tax profile"
5350
5552
  ]
5553
+ },
5554
+ {
5555
+ "key": "validate.modal.download-vouching-certificate-report",
5556
+ "resource": "validate",
5557
+ "modalType": "download-vouching-certificate-report",
5558
+ "urlTemplate": "?modal=download-vouching-certificate-report",
5559
+ "mountPath": "/home",
5560
+ "label": "Download Vouching Certificate Report",
5561
+ "requiresId": false
5562
+ },
5563
+ {
5564
+ "key": "validate.modal.edit-2307-document",
5565
+ "resource": "validate",
5566
+ "modalType": "edit-2307-document",
5567
+ "urlTemplate": "?modal=edit-2307-document&id={id}",
5568
+ "mountPath": "/home",
5569
+ "label": "Edit 2307 Document",
5570
+ "requiresId": true
5571
+ },
5572
+ {
5573
+ "key": "validate.modal.edit-invoice-document",
5574
+ "resource": "validate",
5575
+ "modalType": "edit-invoice-document",
5576
+ "urlTemplate": "?modal=edit-invoice-document&id={id}",
5577
+ "mountPath": "/home",
5578
+ "label": "Edit Invoice Document",
5579
+ "requiresId": true
5580
+ },
5581
+ {
5582
+ "key": "validate.modal.view-2307-document",
5583
+ "resource": "validate",
5584
+ "modalType": "view-2307-document",
5585
+ "urlTemplate": "?modal=view-2307-document&id={id}",
5586
+ "mountPath": "/home",
5587
+ "label": "View 2307 Document",
5588
+ "requiresId": true
5589
+ },
5590
+ {
5591
+ "key": "validate.modal.view-invoice-document",
5592
+ "resource": "validate",
5593
+ "modalType": "view-invoice-document",
5594
+ "urlTemplate": "?modal=view-invoice-document&id={id}",
5595
+ "mountPath": "/home",
5596
+ "label": "View Invoice Document",
5597
+ "requiresId": true
5351
5598
  }
5352
5599
  ],
5353
5600
  "resources": [
@@ -5692,10 +5939,17 @@
5692
5939
  "tax-settings",
5693
5940
  "void-journal-entry",
5694
5941
  "delete-journal-entry",
5942
+ "edit-reversal",
5943
+ "remove-reversal",
5695
5944
  "delete-schedule-journal-entry",
5696
5945
  "confirm-edit",
5697
5946
  "tracking-tags",
5698
5947
  "new-tracking-tags",
5948
+ "classifiers-journal-level",
5949
+ "apply-tags",
5950
+ "field-defaults",
5951
+ "add-new-currency",
5952
+ "apply-tax-profile",
5699
5953
  "inventory-item",
5700
5954
  "manage-tags",
5701
5955
  "activity-log",
@@ -5703,6 +5957,7 @@
5703
5957
  "import-accounts",
5704
5958
  "convert-amount",
5705
5959
  "select-journal-currency",
5960
+ "edit-reverse-description",
5706
5961
  "update-exchange-rate",
5707
5962
  "journal-reference",
5708
5963
  "inventory",
@@ -5720,6 +5975,52 @@
5720
5975
  ],
5721
5976
  "paramsAudited": true
5722
5977
  },
5978
+ {
5979
+ "resource": "leases",
5980
+ "params": [
5981
+ {
5982
+ "name": "action",
5983
+ "values": [
5984
+ "item-accounts",
5985
+ "delete-lease",
5986
+ "activity-log",
5987
+ "close-out-lease",
5988
+ "undo-close-out-lease",
5989
+ "terminate-lease",
5990
+ "undo-termination"
5991
+ ]
5992
+ }
5993
+ ],
5994
+ "paramsAudited": true
5995
+ },
5996
+ {
5997
+ "resource": "loans",
5998
+ "params": [
5999
+ {
6000
+ "name": "action",
6001
+ "values": [
6002
+ "item-accounts",
6003
+ "delete-loan",
6004
+ "activity-log",
6005
+ "close-out-loan",
6006
+ "undo-close-out-loan",
6007
+ "undo-loan-event",
6008
+ "record-drawdown",
6009
+ "prepay",
6010
+ "change-rate",
6011
+ "capitalize-interest",
6012
+ "payment-holiday",
6013
+ "restructure",
6014
+ "refinance",
6015
+ "settle-loan",
6016
+ "forgive",
6017
+ "convert-to-shares",
6018
+ "reclassify-current"
6019
+ ]
6020
+ }
6021
+ ],
6022
+ "paramsAudited": true
6023
+ },
5723
6024
  {
5724
6025
  "resource": "purchase-credits",
5725
6026
  "params": [
@@ -5804,6 +6105,7 @@
5804
6105
  "custom-field",
5805
6106
  "default-settings",
5806
6107
  "update-accounts",
6108
+ "replace-linked-items",
5807
6109
  "update-vats",
5808
6110
  "update-currency",
5809
6111
  "add-new-currency",
@@ -5832,7 +6134,9 @@
5832
6134
  "catalogs",
5833
6135
  "new-tracking-tags",
5834
6136
  "signature-activity",
5835
- "internal-signer"
6137
+ "internal-signer",
6138
+ "link-existing-request",
6139
+ "unlink-request"
5836
6140
  ]
5837
6141
  },
5838
6142
  {
@@ -5888,6 +6192,7 @@
5888
6192
  "confirm-edit-total",
5889
6193
  "default-settings",
5890
6194
  "update-accounts",
6195
+ "replace-linked-items",
5891
6196
  "remove-item-level-vats",
5892
6197
  "schedule-details",
5893
6198
  "update-currency",
@@ -5912,7 +6217,10 @@
5912
6217
  "purchase-add-to-batch-payment",
5913
6218
  "edit-contact",
5914
6219
  "edit-line-item",
5915
- "assign-expenses"
6220
+ "assign-expenses",
6221
+ "purchase-link-existing-order",
6222
+ "purchase-unlink-order",
6223
+ "purchase-unlink-request"
5916
6224
  ]
5917
6225
  },
5918
6226
  {
@@ -5980,7 +6288,8 @@
5980
6288
  "sale-credit-add-to-batch-payment",
5981
6289
  "edit-contact",
5982
6290
  "bulk-edit-line-items",
5983
- "edit-line-item"
6291
+ "edit-line-item",
6292
+ "edit-text-row"
5984
6293
  ]
5985
6294
  },
5986
6295
  {
@@ -6040,6 +6349,7 @@
6040
6349
  "confirm-remove-withholding",
6041
6350
  "default-settings",
6042
6351
  "update-accounts",
6352
+ "replace-linked-items",
6043
6353
  "update-vats",
6044
6354
  "schedule-details",
6045
6355
  "confirm-disable-email",
@@ -6073,7 +6383,11 @@
6073
6383
  "new-capsule",
6074
6384
  "sale-add-to-batch-payment",
6075
6385
  "edit-contact",
6076
- "edit-line-item"
6386
+ "edit-line-item",
6387
+ "edit-text-row",
6388
+ "sale-link-existing-order",
6389
+ "sale-unlink-order",
6390
+ "sale-unlink-quote"
6077
6391
  ]
6078
6392
  },
6079
6393
  {
@@ -6113,6 +6427,7 @@
6113
6427
  "custom-field",
6114
6428
  "default-settings",
6115
6429
  "update-accounts",
6430
+ "replace-linked-items",
6116
6431
  "update-vats",
6117
6432
  "update-currency",
6118
6433
  "add-new-currency",
@@ -6144,7 +6459,10 @@
6144
6459
  "new-capsule",
6145
6460
  "signature-activity",
6146
6461
  "internal-signer",
6147
- "edit-line-item"
6462
+ "edit-line-item",
6463
+ "edit-text-row",
6464
+ "link-existing-quote",
6465
+ "unlink-quote"
6148
6466
  ]
6149
6467
  },
6150
6468
  {
@@ -6259,6 +6577,18 @@
6259
6577
  }
6260
6578
  ],
6261
6579
  "paramsAudited": true
6580
+ },
6581
+ {
6582
+ "resource": "validate",
6583
+ "params": [
6584
+ {
6585
+ "name": "action",
6586
+ "values": [
6587
+ "match-invoices"
6588
+ ]
6589
+ }
6590
+ ],
6591
+ "paramsAudited": true
6262
6592
  }
6263
6593
  ],
6264
6594
  "reservedParams": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaz-clio",
3
- "version": "9.6.2",
3
+ "version": "9.6.3",
4
4
  "description": "Fastest ledger for agents. Jaz accounting CLI and MCP server: invoicing, bills, payments, quotes & orders, bank reconciliation, fixed assets, inventory, expense claims, tax, reports, and period close.",
5
5
  "type": "module",
6
6
  "bin": {