jaz-clio 9.5.9 → 9.5.10
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.
- package/assets/skills/api/SKILL.md +1 -1
- package/assets/skills/cli/SKILL.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jaz-kit/SKILL.md +1 -1
- package/assets/skills/jaz-pseudo-sql/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +1 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -768,7 +768,7 @@ Fields per record:
|
|
|
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)=>hU(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:[...FZ],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:rge("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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let c=e.html_blob;return c?tge(r,await mf(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: ${eO({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 tge(r,await mf(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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:FSr[r]??"purchases.modal.import-bills"});let s=t.sourceUrl;return tge(r,await mf(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 Elt(e,r,n=>DD(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 Elt(e,r,async s=>{let a=await YZ(e.client,s,{timeout:i*1e3,interval:o*1e3});return{allTerminal:a.pending.length===0,pending:a.pending,timedOut:a.timedOut,workflows:a.workflows}})}},...wU,{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:rge("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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let s=e.html_blob;return s?WI(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: ${eO({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?WI(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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"employees.modal.import-claims"}):WI(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:[...XM],valueAliases:ZM,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(!(H0r(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=q0r(Bct(J0r(),"clio-hostfile-"));try{let u=Bct(c,"upload.zip");if(!Oct(u).startsWith(Oct(c)+z0r))throw new Error("refusing to write outside the temp directory");j0r(u,Buffer.from(await e.file_blob.data.arrayBuffer()));let d=await OD({source:c,type:t.type?th(t.type)??void 0:void 0});return{...rAe(d),collectionId:sAe(d,e.client.scopeKey),...tAe(d)}}finally{try{Y0r(c,{recursive:!0,force:!0})}catch{}}}let r=t.source;if(!r)return iA(["source"],{provided:[],hostFileAvailable:oh(e.mcpSurface),acceptsAttachmentId:!1});if(!/^https:\/\//i.test(r)&&!t8())return sat({acceptsAttachmentId:!1});let n=await OD({source:r,type:t.type?th(t.type)??void 0:void 0}),i=sAe(n,e.client.scopeKey);return{...rAe(n),collectionId:i,...tAe(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:[...XM],valueAliases:ZM},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:$Sr,execute:async(e,t)=>{let{documentTypes:r,unresolved:n}=Rlt(t);if(n.length>0)return{error:`Unrecognized documentTypes: ${n.join(", ")}.`,hint:`Use one or more of: ${XM.join(", ")}. Omit documentTypes entirely to extract everything in the collection.`};let i=e.client.scopeKey,o=t.collectionId,s=aAe(o,i);if(!s)throw new Error(`Collection "${o}" not found or expired; re-run classify_documents.`);let a=t.bankAccountId,c=await pat({plan:s,client:e.client,bankAccountId:a,documentTypes:r,internalNotes:t.internalNotes});c.failed===0&&uat(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}=UD(e.platform??"jaz");for(let h of u)try{let m=KBe[h];if(!m){f.push(`link for ${h} unavailable: no destination mapped`);continue}let A=m.key===null?void 0:$D(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 business transaction (invoice, bill, journal, credit note, or order document).",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction resourceId"}},required:["transactionType","transactionId"],group:"attachments",readOnly:!0,searchHint:"list attachments files on a transaction",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>Ei(e.client,t.transactionType,t.transactionId)},{name:"add_attachment",description:"Add an attachment to a business transaction. Provide EXACTLY ONE source: sourceUrl (downloaded here, uploaded as bytes), attachmentId (links existing), or a file attached to the call. Two is refused. Order documents (sale-quotes, sale-orders, purchase-requests, purchase-orders) support file/sourceUrl upload ONLY; attachmentId link-by-id is rejected for them.",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction resourceId"},attachmentId:{type:"string",description:"Attachment ID to link (alternative to sourceUrl)"},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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!KB.includes(s),fetchedBy:"agent"})}let n=t.transactionType;if(t.attachmentId&&KB.includes(n))return{error:`link-by-id (attachmentId) is not supported for order documents (${n}).`,status:422,hint:"Order documents accept file uploads only; pass sourceUrl instead of attachmentId.",repair:{tool:"add_attachment",arguments:{transactionType:n,transactionId:t.transactionId},reason:"Order documents take 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 lf(t.sourceUrl),a=await wc(s,{timeoutMs:JI,maxBytes:IM});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=rh(t.sourceUrl,"attachment")}else!t.attachmentId&&e.file_blob&&(i=e.file_blob.data,o=e.file_blob.fileName);return GV(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 business transaction (invoice, bill, journal, credit note, or order document).",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction 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 VV(e.client,t.transactionType,r,n);return vlt(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)=>nst({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:_v,entityId:wv,bankAccountResourceId:vv,limit:{type:"number",description:"Threads per page, 1 to 50. Default 20."},offset:nge,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 Jst(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:_v,entityId:wv,threadId:G4,bankAccountResourceId:vv,limit:{type:"number",description:"Comments per page, 1 to 50. Default 20."},offset:nge},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 Gst(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. 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:_v,entityId:wv,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:vv},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 Vst(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. 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:_v,entityId:wv,threadId:G4,commentId:blt,content:{type:"string",description:"New comment text, 1 to 4000 characters."},bankAccountResourceId:vv},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 Wst(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:_v,entityId:wv,threadId:G4,commentId:blt,bankAccountResourceId:vv},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 Kst(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:_v,entityId:wv,threadId:G4,bankAccountResourceId:vv},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 Xst(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:nge},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 Zst(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 eat(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=>tat(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 yo(e.client,r),i=await Ei(e.client,"invoices",r);return ts(n.data,tl,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 po(e.client,r),i=await Ei(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,nu,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 Vs(e.client,r):await Ws(e.client,r),o=n==="customer"?"customer-credit-notes":"supplier-credit-notes",s=await Ei(e.client,o,r);return ts(i.data,wo,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)=>s8(e,{limit:r,offset:t}),"list automatic bank reconciliation rules"),ni("get_bank_rule","Get full bank rule details including configuration (allocation percentages, accounts, tax settings).","bank_rules",(e,t)=>rO(e,t),"get bank rule details conditions actions"),Nt({name:"search_bank_rules",description:"Search bank rules.",group:"bank_rules",fields:dx,defaults:fx,fetcher:a8,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)=>hU(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:[...FZ],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:rge("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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let c=e.html_blob;return c?tge(r,await mf(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: ${eO({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 tge(r,await mf(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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:FSr[r]??"purchases.modal.import-bills"});let s=t.sourceUrl;return tge(r,await mf(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 Elt(e,r,n=>DD(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 Elt(e,r,async s=>{let a=await YZ(e.client,s,{timeout:i*1e3,interval:o*1e3});return{allTerminal:a.pending.length===0,pending:a.pending,timedOut:a.timedOut,workflows:a.workflows}})}},...wU,{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:rge("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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1});let s=e.html_blob;return s?WI(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: ${eO({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?WI(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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!1,importDestination:"employees.modal.import-claims"}):WI(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:[...XM],valueAliases:ZM,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(!(H0r(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=q0r(Bct(J0r(),"clio-hostfile-"));try{let u=Bct(c,"upload.zip");if(!Oct(u).startsWith(Oct(c)+z0r))throw new Error("refusing to write outside the temp directory");j0r(u,Buffer.from(await e.file_blob.data.arrayBuffer()));let d=await OD({source:c,type:t.type?th(t.type)??void 0:void 0});return{...rAe(d),collectionId:sAe(d,e.client.scopeKey),...tAe(d)}}finally{try{Y0r(c,{recursive:!0,force:!0})}catch{}}}let r=t.source;if(!r)return iA(["source"],{provided:[],hostFileAvailable:oh(e.mcpSurface),acceptsAttachmentId:!1});if(!/^https:\/\//i.test(r)&&!t8())return sat({acceptsAttachmentId:!1});let n=await OD({source:r,type:t.type?th(t.type)??void 0:void 0}),i=sAe(n,e.client.scopeKey);return{...rAe(n),collectionId:i,...tAe(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:[...XM],valueAliases:ZM},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:$Sr,execute:async(e,t)=>{let{documentTypes:r,unresolved:n}=Rlt(t);if(n.length>0)return{error:`Unrecognized documentTypes: ${n.join(", ")}.`,hint:`Use one or more of: ${XM.join(", ")}. Omit documentTypes entirely to extract everything in the collection.`};let i=e.client.scopeKey,o=t.collectionId,s=aAe(o,i);if(!s)throw new Error(`Collection "${o}" not found or expired; re-run classify_documents.`);let a=t.bankAccountId,c=await pat({plan:s,client:e.client,bankAccountId:a,documentTypes:r,internalNotes:t.internalNotes});c.failed===0&&uat(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}=UD(e.platform??"jaz");for(let h of u)try{let m=KBe[h];if(!m){f.push(`link for ${h} unavailable: no destination mapped`);continue}let A=m.key===null?void 0:$D(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 business transaction (invoice, bill, journal, credit note, or order document).",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction resourceId"}},required:["transactionType","transactionId"],group:"attachments",readOnly:!0,searchHint:"list attachments files on a transaction",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>Ei(e.client,t.transactionType,t.transactionId)},{name:"add_attachment",description:"Add an attachment to a business transaction. Provide EXACTLY ONE source: sourceUrl (downloaded here, uploaded as bytes), attachmentId (links existing), or a file attached to the call. Two is refused. Order documents (sale-quotes, sale-orders, purchase-requests, purchase-orders) support file/sourceUrl upload ONLY; attachmentId link-by-id is rejected for them.",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction resourceId"},attachmentId:{type:"string",description:"Attachment ID to link (alternative to sourceUrl)"},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:oh(e.mcpSurface),acceptsLocalPath:!1,acceptsAttachmentId:!KB.includes(s),fetchedBy:"agent"})}let n=t.transactionType;if(t.attachmentId&&KB.includes(n))return{error:`link-by-id (attachmentId) is not supported for order documents (${n}).`,status:422,hint:"Order documents accept file uploads only; pass sourceUrl instead of attachmentId.",repair:{tool:"add_attachment",arguments:{transactionType:n,transactionId:t.transactionId},reason:"Order documents take 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 lf(t.sourceUrl),a=await wc(s,{timeoutMs:JI,maxBytes:IM});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=rh(t.sourceUrl,"attachment")}else!t.attachmentId&&e.file_blob&&(i=e.file_blob.data,o=e.file_blob.fileName);return GV(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 business transaction (invoice, bill, journal, credit note, or order document).",params:{transactionType:{type:"string",enum:["invoices","bills","journals","scheduled_journals","customer-credit-notes","supplier-credit-notes","sale-quotes","sale-orders","purchase-requests","purchase-orders"],description:"Transaction type (incl. order documents: sale-quotes, sale-orders, purchase-requests, purchase-orders)"},transactionId:{type:"string",description:"Transaction 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 VV(e.client,t.transactionType,r,n);return vlt(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)=>nst({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:_v,entityId:wv,bankAccountResourceId:vv,limit:{type:"number",description:"Threads per page, 1 to 50. Default 20."},offset:nge,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 Jst(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:_v,entityId:wv,threadId:G4,bankAccountResourceId:vv,limit:{type:"number",description:"Comments per page, 1 to 50. Default 20."},offset:nge},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 Gst(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:_v,entityId:wv,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:vv},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 Vst(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:_v,entityId:wv,threadId:G4,commentId:blt,content:{type:"string",description:"New comment text, 1 to 4000 characters."},bankAccountResourceId:vv},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 Wst(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:_v,entityId:wv,threadId:G4,commentId:blt,bankAccountResourceId:vv},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 Kst(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:_v,entityId:wv,threadId:G4,bankAccountResourceId:vv},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 Xst(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:nge},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 Zst(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 eat(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=>tat(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 yo(e.client,r),i=await Ei(e.client,"invoices",r);return ts(n.data,tl,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 po(e.client,r),i=await Ei(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,nu,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 Vs(e.client,r):await Ws(e.client,r),o=n==="customer"?"customer-credit-notes":"supplier-credit-notes",s=await Ei(e.client,o,r);return ts(i.data,wo,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)=>s8(e,{limit:r,offset:t}),"list automatic bank reconciliation rules"),ni("get_bank_rule","Get full bank rule details including configuration (allocation percentages, accounts, tax settings).","bank_rules",(e,t)=>rO(e,t),"get bank rule details conditions actions"),Nt({name:"search_bank_rules",description:"Search bank rules.",group:"bank_rules",fields:dx,defaults:fx,fetcher:a8,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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jaz-clio",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.10",
|
|
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": {
|