jaz-clio 5.2.5 → 5.2.6
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 +3 -1
- package/assets/skills/cli/SKILL.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/practice/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jaz-api
|
|
3
|
-
version: 5.2.
|
|
3
|
+
version: 5.2.6
|
|
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, 117 production gotchas, error
|
|
@@ -435,6 +435,8 @@ Bills, invoices, and credit notes share identical mandatory field specs. Adding
|
|
|
435
435
|
|
|
436
436
|
135. **Reconciliation `lineItems[]` use a DIFFERENT field naming convention** — for `reconcile_invoice_receipt.invoiceDetails.lineItems[]` and `reconcile_bill_receipt.billDetails.lineItems[]`, each line uses `name` (NOT `itemDescription`) for the description and `organizationAccountResourceId` (NOT `accountResourceId`) for the revenue/expense account. The bulk-upsert-line-items variants use `itemDescription` + `accountResourceId`. Memorize this: bulk = `itemDescription`+`accountResourceId`; recon-create = `name`+`organizationAccountResourceId`.
|
|
437
437
|
|
|
438
|
+
136. **Sync bulk-upsert response carries per-row failures** — `bulk_upsert_currency_rates` and `bulk_upsert_chart_of_accounts` return `{ resourceIds: string[], failedRows: ImportedRowError[], failedCount: number }` synchronously (no jobId polling needed). Each `failedRows` entry: `{ rowIndex, columnName, columnValue, errorCode, errorMessage }`. Empty `failedRows: []` + `failedCount: 0` on full success. For `bulk_upsert_currency_rates` specifically: omitting `rateApplicableTo` defaults it to `rateApplicableFrom - 0.999ms` (prevents temporal gaps in rate lookups). Contrast with async bulk-upserts (contacts, invoices, journals, etc.) which return `{ jobId }` and need `search_background_jobs` polling — there, per-row failures live in the job's `errorDetails` field instead.
|
|
439
|
+
|
|
438
440
|
## Supporting Files
|
|
439
441
|
|
|
440
442
|
For detailed reference, read these files in this skill directory:
|
package/cli.mjs
CHANGED
|
@@ -744,7 +744,7 @@ Steps: 1) search_customer_credit_notes with status UNAPPLIED for the same contac
|
|
|
744
744
|
- reference MUST be unique \u2014 generate one with a timestamp if user doesn't specify.`,params:{reference:{type:"string",description:"Credit note reference number"},valueDate:{type:"string",description:"Credit note date (YYYY-MM-DD)"},contactResourceId:{type:"string",description:"Customer contact resourceId"},lineItems:{type:"array",items:{type:"object",properties:{name:{type:"string",description:"Line item description"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:ac},required:["name","quantity","unitPrice"]},description:"Credit note line items"},currency:ic,saveAsDraft:{type:"boolean",description:"Save as draft (default true)"},notes:Dr,tag:hl,customFields:fn},required:["valueDate","contactResourceId","lineItems"],group:"customer_credit_notes",readOnly:!1,searchHint:"create new customer credit note draft",execute:async(e,t)=>{let{notes:r,tag:n,...o}=t,i={...o,...r!==void 0&&{invoiceNotes:r},...n!==void 0&&{tags:[n]}};return i.reference||(i.reference=`CCN-${Date.now()}`),Rf(e.client,i)}},{name:"delete_customer_credit_note",description:"Delete a draft customer credit note.",params:{resourceId:{type:"string",description:"Customer credit note resourceId"}},required:["resourceId"],group:"customer_credit_notes",readOnly:!1,searchHint:"permanently delete draft customer credit note",isDestructive:!0,execute:async(e,t)=>k0(e.client,t.resourceId)},{name:"update_customer_credit_note",description:'Update a draft customer credit note (change amount, line items, contact, date, notes). Use when the user says "update", "change", "fix", or "correct" a credit note.',params:{resourceId:{type:"string",description:"Customer credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr,tag:hl,customFields:fn},required:["resourceId"],group:"customer_credit_notes",readOnly:!1,searchHint:"update customer credit note lines reference",execute:async(e,t)=>{let{resourceId:r,notes:n,tag:o,...i}=t,s={...i,...n!==void 0&&{invoiceNotes:n},...o!==void 0&&{tags:[o]}};return R0(e.client,r,s)}},{name:"finalize_customer_credit_note",description:"Finalize a draft customer credit note (set saveAsDraft=false). Status becomes UNAPPLIED.",params:{resourceId:{type:"string",description:"Customer credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr},required:["resourceId"],group:"customer_credit_notes",readOnly:!1,searchHint:"approve finalize customer credit note",isDestructive:!0,execute:async(e,t)=>{let{resourceId:r,notes:n,...o}=t,i={...o,...n!==void 0&&{invoiceNotes:n}},s=await rh(e.client,"customer_credit_note",r,i);return kf(e.client,r,s)}},{name:"create_customer_credit_note_refund",description:"Record a refund payment against a customer credit note.",params:{creditNoteId:{type:"string",description:"Customer credit note resourceId"},paymentAmount:{type:"number",description:"Refund amount"},transactionAmount:{type:"number",description:"Amount in credit note currency (defaults to paymentAmount for same-currency)"},accountResourceId:{type:"string",description:"Bank/cash account resourceId"},valueDate:{type:"string",description:"Payment date (YYYY-MM-DD)"},reference:{type:"string",description:"Payment reference"},paymentMethod:th},required:["creditNoteId","paymentAmount","accountResourceId","valueDate"],group:"customer_credit_notes",readOnly:!1,searchHint:"refund customer credit note to bank account",isDestructive:!0,execute:async(e,t)=>{let r=Number(t.paymentAmount);if(!Number.isFinite(r)||r<=0)throw new Error("paymentAmount must be a positive number");let n=Number(t.transactionAmount??r);if(!Number.isFinite(n)||n<=0)throw new Error("transactionAmount must be a positive number");return Ff(e.client,t.creditNoteId,{paymentAmount:r,transactionAmount:n,accountResourceId:t.accountResourceId,valueDate:t.valueDate,dueDate:t.valueDate,reference:t.reference??"",paymentMethod:t.paymentMethod??"BANK_TRANSFER",saveAsDraft:!1})}},{name:"list_customer_credit_note_refunds",description:"List refund payments for a customer credit note.",params:{creditNoteId:{type:"string",description:"Customer credit note resourceId"}},required:["creditNoteId"],group:"customer_credit_notes",readOnly:!0,searchHint:"list refunds on a customer credit note",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>F0(e.client,t.creditNoteId)},yt("list_supplier_credit_notes","List supplier credit notes (AP adjustments/refunds). Paginated \u2014 response includes totalElements. Use limit/offset to page.","supplier_credit_notes",(e,t,r)=>j0(e,{limit:r,offset:t}),"list supplier credit notes with status pagination"),Nt({name:"search_supplier_credit_notes",description:"Search supplier credit notes by reference, status, contact, tag. Status: DRAFT, UNAPPLIED, PARTIALLY_APPLIED, APPLIED, VOID.",group:"supplier_credit_notes",fields:Is,defaults:qp,fetcher:Pf,searchHint:"find supplier credit notes by status contact reference"}),{name:"get_supplier_credit_note",description:"Get full supplier credit note details including line items.",params:{resourceId:{type:"string",description:"Supplier credit note resourceId"}},required:["resourceId"],group:"supplier_credit_notes",readOnly:!0,searchHint:"get supplier credit note details line items",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>Po(e.client,t.resourceId)},{name:"create_supplier_credit_note",description:`Create a supplier credit note. Saves as draft by default.
|
|
745
745
|
- Status when finalized is UNAPPLIED (not APPROVED).
|
|
746
746
|
- Line items use "name" for item description.
|
|
747
|
-
- contactResourceId required \u2014 search contacts first.`,params:{reference:{type:"string",description:"Credit note reference number"},valueDate:{type:"string",description:"Credit note date (YYYY-MM-DD)"},contactResourceId:{type:"string",description:"Supplier contact resourceId"},lineItems:{type:"array",items:{type:"object",properties:{name:{type:"string",description:"Line item description"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:ac},required:["name","quantity","unitPrice"]},description:"Credit note line items"},currency:ic,saveAsDraft:{type:"boolean",description:"Save as draft (default true)"},notes:Dr,tag:hl,customFields:fn},required:["valueDate","contactResourceId","lineItems"],group:"supplier_credit_notes",readOnly:!1,searchHint:"create new supplier credit note draft",execute:async(e,t)=>{let{notes:r,tag:n,...o}=t,i={...o,...r!==void 0&&{invoiceNotes:r},...n!==void 0&&{tags:[n]}};return i.reference||(i.reference=`SCN-${Date.now()}`),Lf(e.client,i)}},{name:"delete_supplier_credit_note",description:"Delete a draft supplier credit note.",params:{resourceId:{type:"string",description:"Supplier credit note resourceId"}},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"permanently delete draft supplier credit note",isDestructive:!0,execute:async(e,t)=>B0(e.client,t.resourceId)},{name:"update_supplier_credit_note",description:'Update a draft supplier credit note (change amount, line items, contact, date, notes). Use when the user says "update", "change", "fix", or "correct" a credit note.',params:{resourceId:{type:"string",description:"Supplier credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr,tag:hl,customFields:fn},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"update supplier credit note lines reference",execute:async(e,t)=>{let{resourceId:r,notes:n,tag:o,...i}=t,s={...i,...n!==void 0&&{invoiceNotes:n},...o!==void 0&&{tags:[o]}};return M0(e.client,r,s)}},{name:"finalize_supplier_credit_note",description:"Finalize a draft supplier credit note (set saveAsDraft=false). Status becomes UNAPPLIED.",params:{resourceId:{type:"string",description:"Supplier credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"approve finalize supplier credit note",isDestructive:!0,execute:async(e,t)=>{let{resourceId:r,notes:n,...o}=t,i={...o,...n!==void 0&&{invoiceNotes:n}},s=await rh(e.client,"supplier_credit_note",r,i);return jf(e.client,r,s)}},{name:"create_supplier_credit_note_refund",description:"Record a refund payment against a supplier credit note.",params:{creditNoteId:{type:"string",description:"Supplier credit note resourceId"},paymentAmount:{type:"number",description:"Refund amount"},transactionAmount:{type:"number",description:"Amount in credit note currency (defaults to paymentAmount for same-currency)"},accountResourceId:{type:"string",description:"Bank/cash account resourceId"},valueDate:{type:"string",description:"Payment date (YYYY-MM-DD)"},reference:{type:"string",description:"Payment reference"},paymentMethod:th},required:["creditNoteId","paymentAmount","accountResourceId","valueDate"],group:"supplier_credit_notes",readOnly:!1,searchHint:"refund supplier credit note from bank account",isDestructive:!0,execute:async(e,t)=>{let r=Number(t.paymentAmount);if(!Number.isFinite(r)||r<=0)throw new Error("paymentAmount must be a positive number");let n=Number(t.transactionAmount??r);if(!Number.isFinite(n)||n<=0)throw new Error("transactionAmount must be a positive number");return Mf(e.client,t.creditNoteId,{paymentAmount:r,transactionAmount:n,accountResourceId:t.accountResourceId,valueDate:t.valueDate,dueDate:t.valueDate,reference:t.reference??"",paymentMethod:t.paymentMethod??"BANK_TRANSFER",saveAsDraft:!1})}},{name:"list_supplier_credit_note_refunds",description:"List refund payments for a supplier credit note.",params:{creditNoteId:{type:"string",description:"Supplier credit note resourceId"}},required:["creditNoteId"],group:"supplier_credit_notes",readOnly:!0,searchHint:"list refunds on a supplier credit note",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>U0(e.client,t.creditNoteId)},{name:"list_currencies",description:"List currencies enabled for the organization. Returns currency code, name, symbol, and whether it is the base currency.",params:{},required:[],group:"currencies",readOnly:!0,searchHint:"list active currencies in organization",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async e=>Bf(e.client)},{name:"add_currency",description:"Enable one or more currencies for the organization.",params:{currencies:{type:"array",items:{type:"string"},description:'Currency codes to add (e.g., ["USD", "EUR"])'}},required:["currencies"],group:"currencies",readOnly:!1,searchHint:"add new currency to organization",execute:async(e,t)=>{let r=t.currencies,n=await Bf(e.client),o=new Set(n.data.map(c=>c.currencyCode.toUpperCase())),i=r.filter(c=>o.has(c.toUpperCase())),s=r.filter(c=>!o.has(c.toUpperCase()));if(s.length===0)return{_guard:"duplicate_skipped",message:`All currencies already enabled: ${r.join(", ")}.`,existing:i};let a=await z0(e.client,s);return i.length>0?{...a,_note:`Skipped already-enabled: ${i.join(", ")}`}:a}},{name:"list_currency_rates",description:"List exchange rates for a specific currency. IMPORTANT: You MUST call list_currencies first to discover which currencies the org has enabled \u2014 never guess or assume currency codes.",params:{currencyCode:{type:"string",description:'Currency code (e.g., "USD")'},...O$},required:["currencyCode"],group:"currencies",readOnly:!0,searchHint:"list exchange rates for a currency pair",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>{let{limit:r,offset:n}=fG(t),o=t.currencyCode;return Mp((i,s)=>Y0(e.client,o,{limit:s,offset:i}),r,n,100)}},{name:"add_currency_rate",description:'Add or set an exchange rate for a currency. ALWAYS use this tool even when the user says "update rate" \u2014 it handles both new and existing rates. Rate is relative to the base currency. Call list_currencies first to get valid currency codes.',params:{currencyCode:{type:"string",description:"Currency code"},rate:{type:"number",description:"Exchange rate (e.g., 1.35 for 1 USD = 1.35 SGD)"},rateApplicableFrom:{type:"string",description:"Start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"End date (YYYY-MM-DD, optional)"}},required:["currencyCode","rate","rateApplicableFrom"],group:"currencies",readOnly:!1,searchHint:"add new exchange rate for currency pair",execute:async(e,t)=>J0(e.client,t.currencyCode,{rate:t.rate,rateApplicableFrom:t.rateApplicableFrom,rateApplicableTo:t.rateApplicableTo})},{name:"update_currency_rate",description:'Update an EXISTING exchange rate record by its resourceId. Requires the rate resourceId from list_currency_rates. WARNING: If the user says "update the rate" or "set the rate", they almost always mean add_currency_rate (which creates/overwrites for a date). Only use this tool when explicitly modifying an existing rate record by ID.',params:{currencyCode:{type:"string",description:"Currency code"},resourceId:{type:"string",description:"Rate resourceId"},rate:{type:"number",description:"New exchange rate"},rateApplicableFrom:{type:"string",description:"Start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"End date (YYYY-MM-DD, optional)"}},required:["currencyCode","resourceId","rate","rateApplicableFrom"],group:"currencies",readOnly:!1,searchHint:"update existing exchange rate value",execute:async(e,t)=>G0(e.client,t.currencyCode,t.resourceId,{rate:t.rate,rateApplicableFrom:t.rateApplicableFrom,rateApplicableTo:t.rateApplicableTo})},{name:"start_currency_rates_import_job",description:"Start an async job to import currency rates from a CSV file URL.",params:{currencyCode:{type:"string",description:"Currency code"},csvUrl:{type:"string",description:"URL of the CSV file to import"}},required:["currencyCode","csvUrl"],group:"currencies",readOnly:!1,searchHint:"import exchange rates from external source",execute:async(e,t)=>V0(e.client,t.currencyCode,t.csvUrl)},{name:"get_currency_rates_import_job_status",description:"Check the status of a currency rates import job.",params:{jobId:{type:"string",description:"Job ID from start_currency_rates_import_job"}},required:["jobId"],group:"currencies",readOnly:!0,searchHint:"check status of currency rates import job",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>H0(e.client,t.jobId)},{name:"bulk_upsert_currency_rates",description:"Create exchange rates in bulk (max 500 per call). Auto-enables currencies not yet enabled in the org \u2014 no need to call add_currency first. Requires rateDirection per rate.",params:{rates:{type:"array",description:"Array of exchange rates to create",items:{type:"object",properties:{sourceCurrencyCode:{type:"string",description:"Source currency code (ISO 4217, e.g. USD, EUR)"},rate:{type:"number",description:"Exchange rate value (must be > 0)"},rateDirection:{type:"string",description:"Rate direction",enum:["FUNCTIONAL_TO_SOURCE","SOURCE_TO_FUNCTIONAL"]},rateApplicableFrom:{type:"string",description:"Rate start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"Rate end date (YYYY-MM-DD, optional)"}},required:["sourceCurrencyCode","rate","rateDirection","rateApplicableFrom"]}}},required:["rates"],group:"currencies",readOnly:!1,searchHint:"bulk create or update multiple currency rates",execute:async(e,t)=>(await W0(e.client,t.rates)).data},yt("list_tax_profiles","List tax profiles (GST, VAT, etc.). Returns name, rate, tax type.","tax_profiles",(e,t,r)=>gu(e,{limit:r,offset:t}),"list tax profiles GST VAT rates"),yt("list_tax_types","List available tax types. Use the tax type code when creating tax profiles.","tax_profiles",(e,t,r)=>WD(e,{limit:r,offset:t}),"list available tax types for profile creation"),{name:"create_tax_profile",description:"Create a new tax profile. List tax types first to get the taxTypeCode. Automatically checks for duplicates by name \u2014 returns existing profile if found.",params:{name:{type:"string",description:'Tax profile name (e.g., "GST 9%")'},taxRate:{type:"number",description:"Tax rate as percentage (e.g., 9 for 9%)"},taxTypeCode:{type:"string",description:"Tax type code (from list_tax_types)"}},required:["name","taxRate","taxTypeCode"],group:"tax_profiles",readOnly:!1,searchHint:"create new tax profile GST VAT rate",execute:async(e,t)=>{let r=t.name,n=await $b(e.client,r);return n?{_guard:"duplicate_skipped",message:`Tax profile "${r}" already exists.`,existing:n}:ZD(e.client,{name:r,taxRate:t.taxRate,taxTypeCode:t.taxTypeCode})}},yt("list_cash_in","List cash-in entries (direct cash receipts). Paginated.","cash_entries",(e,t,r)=>r0(e,{limit:r,offset:t}),"list cash in receipt entries with pagination"),{name:"create_cash_in",description:`Record money received INTO a bank account from an EXTERNAL source (customer payment, refund received, deposit from outside).
|
|
747
|
+
- contactResourceId required \u2014 search contacts first.`,params:{reference:{type:"string",description:"Credit note reference number"},valueDate:{type:"string",description:"Credit note date (YYYY-MM-DD)"},contactResourceId:{type:"string",description:"Supplier contact resourceId"},lineItems:{type:"array",items:{type:"object",properties:{name:{type:"string",description:"Line item description"},quantity:{type:"number"},unitPrice:{type:"number"},accountResourceId:ac},required:["name","quantity","unitPrice"]},description:"Credit note line items"},currency:ic,saveAsDraft:{type:"boolean",description:"Save as draft (default true)"},notes:Dr,tag:hl,customFields:fn},required:["valueDate","contactResourceId","lineItems"],group:"supplier_credit_notes",readOnly:!1,searchHint:"create new supplier credit note draft",execute:async(e,t)=>{let{notes:r,tag:n,...o}=t,i={...o,...r!==void 0&&{invoiceNotes:r},...n!==void 0&&{tags:[n]}};return i.reference||(i.reference=`SCN-${Date.now()}`),Lf(e.client,i)}},{name:"delete_supplier_credit_note",description:"Delete a draft supplier credit note.",params:{resourceId:{type:"string",description:"Supplier credit note resourceId"}},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"permanently delete draft supplier credit note",isDestructive:!0,execute:async(e,t)=>B0(e.client,t.resourceId)},{name:"update_supplier_credit_note",description:'Update a draft supplier credit note (change amount, line items, contact, date, notes). Use when the user says "update", "change", "fix", or "correct" a credit note.',params:{resourceId:{type:"string",description:"Supplier credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr,tag:hl,customFields:fn},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"update supplier credit note lines reference",execute:async(e,t)=>{let{resourceId:r,notes:n,tag:o,...i}=t,s={...i,...n!==void 0&&{invoiceNotes:n},...o!==void 0&&{tags:[o]}};return M0(e.client,r,s)}},{name:"finalize_supplier_credit_note",description:"Finalize a draft supplier credit note (set saveAsDraft=false). Status becomes UNAPPLIED.",params:{resourceId:{type:"string",description:"Supplier credit note resourceId"},reference:bo,valueDate:Do,lineItems:mi,notes:Dr},required:["resourceId"],group:"supplier_credit_notes",readOnly:!1,searchHint:"approve finalize supplier credit note",isDestructive:!0,execute:async(e,t)=>{let{resourceId:r,notes:n,...o}=t,i={...o,...n!==void 0&&{invoiceNotes:n}},s=await rh(e.client,"supplier_credit_note",r,i);return jf(e.client,r,s)}},{name:"create_supplier_credit_note_refund",description:"Record a refund payment against a supplier credit note.",params:{creditNoteId:{type:"string",description:"Supplier credit note resourceId"},paymentAmount:{type:"number",description:"Refund amount"},transactionAmount:{type:"number",description:"Amount in credit note currency (defaults to paymentAmount for same-currency)"},accountResourceId:{type:"string",description:"Bank/cash account resourceId"},valueDate:{type:"string",description:"Payment date (YYYY-MM-DD)"},reference:{type:"string",description:"Payment reference"},paymentMethod:th},required:["creditNoteId","paymentAmount","accountResourceId","valueDate"],group:"supplier_credit_notes",readOnly:!1,searchHint:"refund supplier credit note from bank account",isDestructive:!0,execute:async(e,t)=>{let r=Number(t.paymentAmount);if(!Number.isFinite(r)||r<=0)throw new Error("paymentAmount must be a positive number");let n=Number(t.transactionAmount??r);if(!Number.isFinite(n)||n<=0)throw new Error("transactionAmount must be a positive number");return Mf(e.client,t.creditNoteId,{paymentAmount:r,transactionAmount:n,accountResourceId:t.accountResourceId,valueDate:t.valueDate,dueDate:t.valueDate,reference:t.reference??"",paymentMethod:t.paymentMethod??"BANK_TRANSFER",saveAsDraft:!1})}},{name:"list_supplier_credit_note_refunds",description:"List refund payments for a supplier credit note.",params:{creditNoteId:{type:"string",description:"Supplier credit note resourceId"}},required:["creditNoteId"],group:"supplier_credit_notes",readOnly:!0,searchHint:"list refunds on a supplier credit note",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>U0(e.client,t.creditNoteId)},{name:"list_currencies",description:"List currencies enabled for the organization. Returns currency code, name, symbol, and whether it is the base currency.",params:{},required:[],group:"currencies",readOnly:!0,searchHint:"list active currencies in organization",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async e=>Bf(e.client)},{name:"add_currency",description:"Enable one or more currencies for the organization.",params:{currencies:{type:"array",items:{type:"string"},description:'Currency codes to add (e.g., ["USD", "EUR"])'}},required:["currencies"],group:"currencies",readOnly:!1,searchHint:"add new currency to organization",execute:async(e,t)=>{let r=t.currencies,n=await Bf(e.client),o=new Set(n.data.map(c=>c.currencyCode.toUpperCase())),i=r.filter(c=>o.has(c.toUpperCase())),s=r.filter(c=>!o.has(c.toUpperCase()));if(s.length===0)return{_guard:"duplicate_skipped",message:`All currencies already enabled: ${r.join(", ")}.`,existing:i};let a=await z0(e.client,s);return i.length>0?{...a,_note:`Skipped already-enabled: ${i.join(", ")}`}:a}},{name:"list_currency_rates",description:"List exchange rates for a specific currency. IMPORTANT: You MUST call list_currencies first to discover which currencies the org has enabled \u2014 never guess or assume currency codes.",params:{currencyCode:{type:"string",description:'Currency code (e.g., "USD")'},...O$},required:["currencyCode"],group:"currencies",readOnly:!0,searchHint:"list exchange rates for a currency pair",isConcurrencySafe:!0,maxResultSizeChars:5e4,execute:async(e,t)=>{let{limit:r,offset:n}=fG(t),o=t.currencyCode;return Mp((i,s)=>Y0(e.client,o,{limit:s,offset:i}),r,n,100)}},{name:"add_currency_rate",description:'Add or set an exchange rate for a currency. ALWAYS use this tool even when the user says "update rate" \u2014 it handles both new and existing rates. Rate is relative to the base currency. Call list_currencies first to get valid currency codes.',params:{currencyCode:{type:"string",description:"Currency code"},rate:{type:"number",description:"Exchange rate (e.g., 1.35 for 1 USD = 1.35 SGD)"},rateApplicableFrom:{type:"string",description:"Start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"End date (YYYY-MM-DD, optional)"}},required:["currencyCode","rate","rateApplicableFrom"],group:"currencies",readOnly:!1,searchHint:"add new exchange rate for currency pair",execute:async(e,t)=>J0(e.client,t.currencyCode,{rate:t.rate,rateApplicableFrom:t.rateApplicableFrom,rateApplicableTo:t.rateApplicableTo})},{name:"update_currency_rate",description:'Update an EXISTING exchange rate record by its resourceId. Requires the rate resourceId from list_currency_rates. WARNING: If the user says "update the rate" or "set the rate", they almost always mean add_currency_rate (which creates/overwrites for a date). Only use this tool when explicitly modifying an existing rate record by ID.',params:{currencyCode:{type:"string",description:"Currency code"},resourceId:{type:"string",description:"Rate resourceId"},rate:{type:"number",description:"New exchange rate"},rateApplicableFrom:{type:"string",description:"Start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"End date (YYYY-MM-DD, optional)"}},required:["currencyCode","resourceId","rate","rateApplicableFrom"],group:"currencies",readOnly:!1,searchHint:"update existing exchange rate value",execute:async(e,t)=>G0(e.client,t.currencyCode,t.resourceId,{rate:t.rate,rateApplicableFrom:t.rateApplicableFrom,rateApplicableTo:t.rateApplicableTo})},{name:"start_currency_rates_import_job",description:"Start an async job to import currency rates from a CSV file URL.",params:{currencyCode:{type:"string",description:"Currency code"},csvUrl:{type:"string",description:"URL of the CSV file to import"}},required:["currencyCode","csvUrl"],group:"currencies",readOnly:!1,searchHint:"import exchange rates from external source",execute:async(e,t)=>V0(e.client,t.currencyCode,t.csvUrl)},{name:"get_currency_rates_import_job_status",description:"Check the status of a currency rates import job.",params:{jobId:{type:"string",description:"Job ID from start_currency_rates_import_job"}},required:["jobId"],group:"currencies",readOnly:!0,searchHint:"check status of currency rates import job",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(e,t)=>H0(e.client,t.jobId)},{name:"bulk_upsert_currency_rates",description:"Create exchange rates in bulk (max 500 per call). Auto-enables currencies not yet enabled in the org \u2014 no need to call add_currency first. Requires rateDirection per rate. Response surfaces per-row failures: `failedRows[]` (each with rowIndex, columnName, columnValue, errorCode, errorMessage) + `failedCount` alongside `resourceIds[]` for successful inserts. Omitting `rateApplicableTo` defaults it to `rateApplicableFrom - 0.999ms` (no temporal gap).",params:{rates:{type:"array",description:"Array of exchange rates to create",items:{type:"object",properties:{sourceCurrencyCode:{type:"string",description:"Source currency code (ISO 4217, e.g. USD, EUR)"},rate:{type:"number",description:"Exchange rate value (must be > 0)"},rateDirection:{type:"string",description:"Rate direction",enum:["FUNCTIONAL_TO_SOURCE","SOURCE_TO_FUNCTIONAL"]},rateApplicableFrom:{type:"string",description:"Rate start date (YYYY-MM-DD)"},rateApplicableTo:{type:"string",description:"Rate end date (YYYY-MM-DD, optional)"}},required:["sourceCurrencyCode","rate","rateDirection","rateApplicableFrom"]}}},required:["rates"],group:"currencies",readOnly:!1,searchHint:"bulk create or update multiple currency rates",execute:async(e,t)=>(await W0(e.client,t.rates)).data},yt("list_tax_profiles","List tax profiles (GST, VAT, etc.). Returns name, rate, tax type.","tax_profiles",(e,t,r)=>gu(e,{limit:r,offset:t}),"list tax profiles GST VAT rates"),yt("list_tax_types","List available tax types. Use the tax type code when creating tax profiles.","tax_profiles",(e,t,r)=>WD(e,{limit:r,offset:t}),"list available tax types for profile creation"),{name:"create_tax_profile",description:"Create a new tax profile. List tax types first to get the taxTypeCode. Automatically checks for duplicates by name \u2014 returns existing profile if found.",params:{name:{type:"string",description:'Tax profile name (e.g., "GST 9%")'},taxRate:{type:"number",description:"Tax rate as percentage (e.g., 9 for 9%)"},taxTypeCode:{type:"string",description:"Tax type code (from list_tax_types)"}},required:["name","taxRate","taxTypeCode"],group:"tax_profiles",readOnly:!1,searchHint:"create new tax profile GST VAT rate",execute:async(e,t)=>{let r=t.name,n=await $b(e.client,r);return n?{_guard:"duplicate_skipped",message:`Tax profile "${r}" already exists.`,existing:n}:ZD(e.client,{name:r,taxRate:t.taxRate,taxTypeCode:t.taxTypeCode})}},yt("list_cash_in","List cash-in entries (direct cash receipts). Paginated.","cash_entries",(e,t,r)=>r0(e,{limit:r,offset:t}),"list cash in receipt entries with pagination"),{name:"create_cash_in",description:`Record money received INTO a bank account from an EXTERNAL source (customer payment, refund received, deposit from outside).
|
|
748
748
|
WHEN TO USE: customer payments received, refunds from suppliers, insurance payouts, external deposits.
|
|
749
749
|
WHEN NOT TO USE: moving money between your own bank/cash accounts \u2014 use create_cash_transfer instead.
|
|
750
750
|
- CRITICAL: accountResourceId MUST be a Bank/Cash account from list_bank_accounts output. Using expense, revenue, or liability accounts will fail. Always call list_bank_accounts first to find valid accounts.
|