Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: add recalculate unit cost button in item master
Brad Barbin516f628f7d09
diff --git a/apps/erp/app/components/Modals/Confirm/Confirm.tsx b/apps/erp/app/components/Modals/Confirm/Confirm.tsxindex 6656aa4b6b..d0b06b387a 100644--- a/apps/erp/app/components/Modals/Confirm/Confirm.tsx+++ b/apps/erp/app/components/Modals/Confirm/Confirm.tsx@@ -63,7 +63,9 @@ const Confirm = ({<ModalHeader><ModalTitle>{title}</ModalTitle></ModalHeader>- <ModalBody>{text}</ModalBody>+ <ModalBody>+ <p className="text-sm text-muted-foreground">{text}</p>+ </ModalBody><ModalFooter><Button variant="secondary" onClick={onCancel}>Canceldiff --git a/apps/erp/app/components/Modals/ConfirmDelete/ConfirmDelete.tsx b/apps/erp/app/components/Modals/ConfirmDelete/ConfirmDelete.tsxindex 3397583872..01d3ca4888 100644--- a/apps/erp/app/components/Modals/ConfirmDelete/ConfirmDelete.tsx+++ b/apps/erp/app/components/Modals/ConfirmDelete/ConfirmDelete.tsx@@ -51,7 +51,9 @@ const ConfirmDelete = ({<ModalTitle>Delete {name}</ModalTitle></ModalHeader>- <ModalBody>{text}</ModalBody>+ <ModalBody>+ <p className="text-sm text-muted-foreground">{text}</p>+ </ModalBody><ModalFooter><Button variant="secondary" onClick={onCancel}>diff --git a/apps/erp/app/modules/items/items.service.ts b/apps/erp/app/modules/items/items.service.tsindex cb40ff3e1e..47a86fdb0f 100644--- a/apps/erp/app/modules/items/items.service.ts+++ b/apps/erp/app/modules/items/items.service.ts@@ -1172,7 +1172,7 @@ export async function getMethodMaterialsByMakeMethod() {return client.from("methodMaterial")- .select("*, item(name, itemTrackingType)")+ .select("*, item(name, itemTrackingType, replenishmentSystem)").eq("makeMethodId", makeMethodId).order("order", { ascending: true });}diff --git a/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx b/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsxindex b7ef8b6b39..c1e7339231 100644--- a/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx+++ b/apps/erp/app/modules/items/ui/Item/BillOfMaterial.tsx@@ -108,6 +108,7 @@ type Material = z.infer<typeof methodMaterialValidator> & {item: {name: string;itemTrackingType: Database["public"]["Enums"]["itemTrackingType"];+ replenishmentSystem: string | null;};};@@ -655,6 +656,7 @@ function MaterialForm({quantity: number;kit: boolean;shelfIds: Record<string, string>;+ itemReplenishmentSystem: string;}>({itemId: item.data.itemId ?? "",methodType: item.data.methodType ?? "Pull from Inventory",@@ -664,7 +666,9 @@ function MaterialForm({methodOperationId: item.data.methodOperationId ?? undefined,quantity: item.data.quantity ?? 1,kit: item.data.kit ?? false,- shelfIds: item.data.shelfIds ?? {}+ shelfIds: item.data.shelfIds ?? {},+ itemReplenishmentSystem:+ item.data.item?.replenishmentSystem ?? replenishmentSystem ?? "Buy"});const onTypeChange = (value: MethodItemType | "Item") => {@@ -680,7 +684,8 @@ function MaterialForm({unitOfMeasureCode: "EA",kit: false,shelfIds: {},- methodOperationId: undefined+ methodOperationId: undefined,+ itemReplenishmentSystem: replenishmentSystem ?? "Buy"});};@@ -694,7 +699,7 @@ function MaterialForm({const item = await carbon.from("item").select(- "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType"+ "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, replenishmentSystem").eq("id", itemId).eq("companyId", company.id)@@ -711,7 +716,8 @@ function MaterialForm({description: item.data?.name ?? "",unitOfMeasureCode: item.data?.unitOfMeasureCode ?? "EA",methodType: item.data?.defaultMethodType ?? "Pull from Inventory",- kit: false+ kit: false,+ itemReplenishmentSystem: item.data?.replenishmentSystem ?? "Buy"}));if (item.data?.type) {setItemType(item.data.type as MethodItemType);@@ -981,7 +987,7 @@ function MaterialForm({}): undefined}- replenishmentSystem="Buy and Make"+ replenishmentSystem={itemData.itemReplenishmentSystem}/><Locationname="locationId"diff --git a/apps/erp/app/modules/items/ui/Item/BoMExplorer.tsx b/apps/erp/app/modules/items/ui/Item/BoMExplorer.tsxindex 42ed6f5528..ba4cb8701f 100644--- a/apps/erp/app/modules/items/ui/Item/BoMExplorer.tsx+++ b/apps/erp/app/modules/items/ui/Item/BoMExplorer.tsx@@ -292,13 +292,14 @@ const BoMExplorer = ({)}onClick={() => {selectNode(node.id, false);+const nodePath = node.data.isRoot? getRootLink(itemType, itemId, methodId): getMaterialLink(itemType,itemId,methodId,- node.data.methodType === "Make to Order"+ node.data.replenishmentSystem !== "Buy"? node.data.materialMakeMethodId: node.data.makeMethodId,nodediff --git a/apps/erp/app/modules/items/ui/Item/ItemCostingForm.tsx b/apps/erp/app/modules/items/ui/Item/ItemCostingForm.tsxindex c07584d3dc..fabf0677d3 100644--- a/apps/erp/app/modules/items/ui/Item/ItemCostingForm.tsx+++ b/apps/erp/app/modules/items/ui/Item/ItemCostingForm.tsx@@ -1,10 +1,12 @@import { ValidatedForm } from "@carbon/form";import {+ Button,Card,CardContent,CardFooter,CardHeader,- CardTitle+ CardTitle,+ useDisclosure} from "@carbon/react";import type { z } from "zod";import {@@ -14,7 +16,10 @@ import {Number,Submit} from "~/components/Form";+import { Confirm } from "~/components/Modals";import { usePermissions, useUser } from "~/hooks";+import { useItems } from "~/stores/items";+import { path } from "~/utils/path";import { itemCostValidator } from "../../items.models";type ItemCostingFormProps = {@@ -22,20 +27,15 @@ type ItemCostingFormProps = {};const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {+ const [items] = useItems();+ const item = items.find((item) => item.id === initialValues.itemId);++ const replenishmentSystem = item?.replenishmentSystem ?? "Buy";const permissions = usePermissions();const { company } = useUser();const baseCurrency = company?.baseCurrencyCode ?? "USD";- // const [partCostingMethod, setItemCostingMethod] = useState<string>(- // initialValues.costingMethod- // );-- // const partCostingMethodOptions = itemCostingMethods.map(- // (partCostingMethod) => ({- // label: partCostingMethod,- // value: partCostingMethod,- // })- // );+ const recalculateModal = useDisclosure();return (<Card>@@ -43,6 +43,7 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {method="post"validator={itemCostValidator}defaultValues={initialValues}+ key={`${initialValues.itemId}-${initialValues.unitCost}`}><CardHeader><CardTitle>Costing & Posting</CardTitle>@@ -82,7 +83,11 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {style: "currency",currency: baseCurrency}}- helperText="Weighted average cost over last year calculated when the invoice is posted"+ helperText={+ replenishmentSystem === "Make"+ ? undefined+ : "Weighted average cost over last year calculated when the invoice is posted"+ }/>{/* <Boolean name="costIsAdjusted" label="Cost Is Adjusted" /> */}@@ -91,8 +96,24 @@ const ItemCostingForm = ({ initialValues }: ItemCostingFormProps) => {</CardContent><CardFooter><Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>+ {replenishmentSystem === "Make" && (+ <Button variant="secondary" onClick={recalculateModal.onOpen}>+ Recalculate+ </Button>+ )}</CardFooter></ValidatedForm>+ {recalculateModal.isOpen && (+ <Confirm+ action={path.to.api.itemCostRecalculate(initialValues.itemId)}+ title="Recalculate Unit Cost"+ text="This will recalculate the unit cost from the active make method's bill of materials and processes using the batch size. The current cost will be overwritten. Do you want to continue?"+ confirmText="Recalculate"+ isOpen={recalculateModal.isOpen}+ onCancel={recalculateModal.onClose}+ onSubmit={recalculateModal.onClose}+ />+ )}</Card>);};diff --git a/apps/erp/app/modules/production/production.service.ts b/apps/erp/app/modules/production/production.service.tsindex a93bd685b0..027d807ef4 100644--- a/apps/erp/app/modules/production/production.service.ts+++ b/apps/erp/app/modules/production/production.service.ts@@ -1034,7 +1034,7 @@ export async function getJobMaterialsByMethodId() {return client.from("jobMaterial")- .select("*")+ .select("*, item(replenishmentSystem)").eq("jobMakeMethodId", jobMakeMethodId).order("order", { ascending: true });}diff --git a/apps/erp/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx b/apps/erp/app/modules/production/ui/Jobs/JobBillOfMaterial.tsxindex 11193c3b00..df484a3faf 100644--- a/apps/erp/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx+++ b/apps/erp/app/modules/production/ui/Jobs/JobBillOfMaterial.tsx@@ -80,6 +80,7 @@ import type { Job } from "../../types";type Material = z.infer<typeof jobMaterialValidator> & {requiresBatchTracking: boolean;requiresSerialTracking: boolean;+ item?: { replenishmentSystem: string | null } | null;};type Operation = z.infer<typeof jobOperationValidator>;@@ -675,6 +676,7 @@ function MaterialForm({requiresBatchTracking: boolean;requiresSerialTracking: boolean;shelfId?: string;+ itemReplenishmentSystem: string;}>({itemId: item.data.itemId ?? "",methodType: item.data.methodType ?? "Pull from Inventory",@@ -686,7 +688,8 @@ function MaterialForm({kit: item.data.kit ?? false,requiresBatchTracking: item.data.requiresBatchTracking ?? false,requiresSerialTracking: item.data.requiresSerialTracking ?? false,- shelfId: item.data.shelfId ?? undefined+ shelfId: item.data.shelfId ?? undefined,+ itemReplenishmentSystem: item.data.item?.replenishmentSystem ?? "Buy"});const onTypeChange = (value: MethodItemType | "Item") => {@@ -704,7 +707,8 @@ function MaterialForm({kit: false,requiresBatchTracking: false,requiresSerialTracking: false,- shelfId: ""+ shelfId: "",+ itemReplenishmentSystem: "Buy"});};@@ -719,7 +723,7 @@ function MaterialForm({carbon.from("item").select(- "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, itemTrackingType"+ "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, itemTrackingType, replenishmentSystem").eq("id", itemId).eq("companyId", company.id)@@ -748,7 +752,8 @@ function MaterialForm({methodType: item.data?.defaultMethodType ?? "Pull from Inventory",requiresBatchTracking: item.data?.itemTrackingType === "Batch",requiresSerialTracking: item.data?.itemTrackingType === "Serial",- shelfId: pickMethod.data?.defaultShelfId ?? ""+ shelfId: pickMethod.data?.defaultShelfId ?? "",+ itemReplenishmentSystem: item.data?.replenishmentSystem ?? "Buy"}));if (item.data?.type) {@@ -920,7 +925,7 @@ function MaterialForm({methodType: value?.value as MethodType}));}}- replenishmentSystem="Buy and Make"+ replenishmentSystem={itemData.itemReplenishmentSystem}/><Shelfname="shelfId"diff --git a/apps/erp/app/modules/production/ui/Jobs/JobMaterialForm.tsx b/apps/erp/app/modules/production/ui/Jobs/JobMaterialForm.tsxindex 88b5342424..1a45475135 100644--- a/apps/erp/app/modules/production/ui/Jobs/JobMaterialForm.tsx+++ b/apps/erp/app/modules/production/ui/Jobs/JobMaterialForm.tsx@@ -67,13 +67,15 @@ const JobMaterialForm = ({unitCost: number;unitOfMeasureCode: string;quantity: number;+ itemReplenishmentSystem: string;}>({itemId: initialValues.itemId ?? "",methodType: initialValues.methodType ?? "Pull from Inventory",description: initialValues.description ?? "",unitCost: initialValues.unitCost ?? 0,unitOfMeasureCode: initialValues.unitOfMeasureCode ?? "EA",- quantity: initialValues.quantity ?? 1+ quantity: initialValues.quantity ?? 1,+ itemReplenishmentSystem: "Buy"});const onTypeChange = (value: MethodItemType | "Item") => {@@ -85,7 +87,8 @@ const JobMaterialForm = ({quantity: 1,description: "",unitCost: 0,- unitOfMeasureCode: "EA"+ unitOfMeasureCode: "EA",+ itemReplenishmentSystem: "Buy"});};@@ -96,7 +99,7 @@ const JobMaterialForm = ({carbon.from("item").select(- "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType"+ "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, replenishmentSystem").eq("id", itemId).single(),@@ -114,7 +117,8 @@ const JobMaterialForm = ({description: item.data?.name ?? "",unitCost: itemCost.data?.unitCost ?? 0,unitOfMeasureCode: item.data?.unitOfMeasureCode ?? "EA",- methodType: item.data?.defaultMethodType ?? "Purchase to Order"+ methodType: item.data?.defaultMethodType ?? "Purchase to Order",+ itemReplenishmentSystem: item.data?.replenishmentSystem ?? "Buy"}));if (item.data?.type) {@@ -205,7 +209,7 @@ const JobMaterialForm = ({name="methodType"label="Method Type"value={itemData.methodType}- replenishmentSystem="Buy and Make"+ replenishmentSystem={itemData.itemReplenishmentSystem}/><Number name="quantity" label="Quantity per Parent" /><UnitOfMeasurediff --git a/apps/erp/app/modules/sales/sales.service.ts b/apps/erp/app/modules/sales/sales.service.tsindex deb56213e4..a81a8d48bf 100644--- a/apps/erp/app/modules/sales/sales.service.ts+++ b/apps/erp/app/modules/sales/sales.service.ts@@ -1060,7 +1060,7 @@ export async function getQuoteMaterialsByMethodId() {return client.from("quoteMaterial")- .select("*, item(name, itemTrackingType)")+ .select("*, item(name, itemTrackingType, replenishmentSystem)").eq("quoteMakeMethodId", quoteMakeMethodId).order("order", { ascending: true });}diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsxindex bab2b8cb19..89a442f792 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteBillOfMaterial.tsx@@ -79,6 +79,7 @@ type Material = z.infer<typeof quoteMaterialValidator> & {item: {name: string;itemTrackingType: Database["public"]["Enums"]["itemTrackingType"];+ replenishmentSystem: string | null;};};@@ -665,6 +666,7 @@ function MaterialForm({kit: boolean;shelfId?: string;quoteOperationId?: string;+ itemReplenishmentSystem: string;}>({itemId: item.data.itemId ?? "",methodType: item.data.methodType ?? "Pull from Inventory",@@ -674,7 +676,8 @@ function MaterialForm({quantity: item.data.quantity ?? 1,kit: item.data.kit ?? false,shelfId: item.data.shelfId,- quoteOperationId: item.data.quoteOperationId+ quoteOperationId: item.data.quoteOperationId,+ itemReplenishmentSystem: item.data.item?.replenishmentSystem ?? "Buy"});const onTypeChange = (value: MethodItemType | "Item") => {@@ -687,7 +690,8 @@ function MaterialForm({unitCost: 0,description: "",unitOfMeasureCode: "EA",- kit: false+ kit: false,+ itemReplenishmentSystem: "Buy"});};@@ -710,7 +714,7 @@ function MaterialForm({carbon.from("item").select(- "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, itemTrackingType"+ "name, readableIdWithRevision, type, unitOfMeasureCode, defaultMethodType, itemTrackingType, replenishmentSystem").eq("id", itemId).eq("companyId", company.id)@@ -742,7 +746,8 @@ function MaterialForm({unitOfMeasureCode: item.data?.unitOfMeasureCode ?? "EA",methodType: item.data?.defaultMethodType ?? "Pull from Inventory",requiresBatchTracking: item.data?.itemTrackingType === "Batch",- requiresSerialTracking: item.data?.itemTrackingType === "Serial"+ requiresSerialTracking: item.data?.itemTrackingType === "Serial",+ itemReplenishmentSystem: item.data?.replenishmentSystem ?? "Buy"}));if (item.data?.type) {@@ -927,7 +932,7 @@ function MaterialForm({methodType: value?.value as MethodType}));}}- replenishmentSystem="Buy and Make"+ replenishmentSystem={itemData.itemReplenishmentSystem}/><Shelfname="shelfId"diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteMaterialForm.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteMaterialForm.tsxindex 7f396dbd54..8ab3932f69 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteMaterialForm.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteMaterialForm.tsx@@ -36,6 +36,7 @@ import { quoteMaterialValidator } from "../../sales.models";type QuoteMaterialFormProps = {initialValues: z.infer<typeof quoteMaterialValidator> & {quoteMaterialMakeMethodId: string | null;+ item?: { replenishmentSystem: string | null } | null;};operations: z.infer<typeof quoteOperationValidator>[];};@@ -65,13 +66,15 @@ const QuoteMaterialForm = ({unitCost: number;unitOfMeasureCode: string;quantity: number;+ itemReplenishmentSystem: string;}>({itemId: initialValues.itemId ?? "",methodType: initialValues.methodType ?? "Pull from Inventory",description: initialValues.description ?? "",unitCost: initialValues.unitCost ?? 0,unitOfMeasureCode: initialValues.unitOfMeasureCode ?? "EA",- quantity: initialValues.quantity ?? 1+ quantity: initialValues.quantity ?? 1,+ itemReplenishmentSystem: initialValues.item?.replenishmentSystem ?? "Buy"});const onTypeChange = (value: MethodItemType | "Item") => {@@ -83,7 +86,8 @@ const QuoteMaterialForm = ({quantity: 1,description: "",unitCost: 0,- unitOfMeasureCode: "EA"+ unitOfMeasureCode: "EA",+ itemReplenishmentSystem: "Buy"});};@@ -101,7 +105,7 @@ const QuoteMaterialForm = ({carbon.from("item").select(- "name, readableIdWithRevision, unitOfMeasureCode, defaultMethodType"+ "name, readableIdWithRevision, unitOfMeasureCode, defaultMethodType, replenishmentSystem").eq("id", itemId).single(),@@ -126,7 +130,8 @@ const QuoteMaterialForm = ({description: item.data?.name ?? "",unitCost,unitOfMeasureCode: item.data?.unitOfMeasureCode ?? "EA",- methodType: item.data?.defaultMethodType ?? "Purchase to Order"+ methodType: item.data?.defaultMethodType ?? "Purchase to Order",+ itemReplenishmentSystem: item.data?.replenishmentSystem ?? "Buy"}));};@@ -239,7 +244,7 @@ const QuoteMaterialForm = ({name="methodType"label="Method Type"value={itemData.methodType}- replenishmentSystem="Buy and Make"+ replenishmentSystem={itemData.itemReplenishmentSystem}/><NumberControlledname="quantity"diff --git a/apps/erp/app/routes/api+/items.$itemId.recalculate-cost.ts b/apps/erp/app/routes/api+/items.$itemId.recalculate-cost.tsnew file mode 100644index 0000000000..ef1be3c195--- /dev/null+++ b/apps/erp/app/routes/api+/items.$itemId.recalculate-cost.ts@@ -0,0 +1,174 @@+import { assertIsPost } from "@carbon/auth";+import { requirePermissions } from "@carbon/auth/auth.server";+import type { Database } from "@carbon/database";+import type { ActionFunctionArgs } from "react-router";+import { flattenTree } from "~/components/TreeView";+import { getMethodTree } from "~/modules/items";+import type { BomOperation, WorkCenterRate } from "~/utils/bom";+import { calculateMadePartCosts, resolveOperationRates } from "~/utils/bom";++export async function action({ request, params }: ActionFunctionArgs) {+ assertIsPost(request);+ const { client, companyId, userId } = await requirePermissions(request, {+ update: "parts"+ });++ const { itemId } = params;+ if (!itemId) {+ return { success: false, message: "Item ID is required" };+ }++ // Get the active (or draft fallback) make method for this item+ const makeMethodResult = await client+ .from("activeMakeMethods")+ .select("id")+ .eq("itemId", itemId)+ .maybeSingle();++ if (makeMethodResult.error || !makeMethodResult.data) {+ return { success: false, message: "No make method found for this item" };+ }++ const makeMethodId = makeMethodResult.data.id;+ if (!makeMethodId) {+ return { success: false, message: "No make method found for this item" };+ }++ // Get the method tree+ const methodTree = await getMethodTree(client, makeMethodId);+ if (methodTree.error) {+ return { success: false, message: "Failed to load method tree" };+ }++ const methods =+ methodTree.data.length > 0 ? flattenTree(methodTree.data[0]) : [];++ if (methods.length === 0) {+ return { success: false, message: "No methods found in the method tree" };+ }++ // Get all method operations for cost calculation+ const makeMethodIds = [+ ...new Set(methods.map((method) => method.data.makeMethodId))+ ];++ const itemIds = [...new Set(methods.map((m) => m.data.itemId))];++ const [methodOperations, workCentersResult, lotSizesResult] =+ await Promise.all([+ client+ .from("methodOperation")+ .select(+ "*, ...process(processName:name), ...workCenter(workCenterName:name, laborRate, machineRate, overheadRate)"+ )+ .in("makeMethodId", makeMethodIds)+ .eq("companyId", companyId),+ client+ .from("workCenters")+ .select("id, active, laborRate, machineRate, overheadRate, processes")+ .eq("companyId", companyId),+ client+ .from("itemReplenishment")+ .select("itemId, lotSize")+ .in("itemId", itemIds)+ ]);++ const lotSizesByItemId = new Map(+ (lotSizesResult.data ?? []).map((r) => [r.itemId, r.lotSize ?? 1])+ );++ const workCenters: WorkCenterRate[] = (workCentersResult.data ?? []).map(+ (wc) => ({+ id: wc.id!,+ active: wc.active ?? false,+ laborRate: wc.laborRate,+ machineRate: wc.machineRate,+ overheadRate: wc.overheadRate,+ processes: wc.processes+ })+ );++ let operationsByMakeMethodId: Record<+ string,+ Array<+ Database["public"]["Tables"]["methodOperation"]["Row"] & {+ processName: string;+ workCenterName: string | null;+ laborRate: number | null;+ machineRate: number | null;+ overheadRate: number | null;+ }+ >+ > = {};++ if (methodOperations.data) {+ operationsByMakeMethodId = methodOperations.data.reduce(+ (acc, operation) => {+ acc[operation.makeMethodId] = [+ ...(acc[operation.makeMethodId] || []),+ operation+ ];+ return acc;+ },+ {} as typeof operationsByMakeMethodId+ );+ }++ // Build BomOperation map for cost calculation+ const bomOperationsByKey: Record<string, BomOperation[]> = {};+ for (const [key, ops] of Object.entries(operationsByMakeMethodId)) {+ // @ts-expect-error TS2322 - TODO: fix type+ bomOperationsByKey[key] = ops.map((op) => {+ const rates = resolveOperationRates(+ op.workCenterId,+ op.processId,+ op.laborRate,+ op.machineRate,+ op.overheadRate,+ workCenters+ );+ return {+ operationType: op.operationType,+ setupTime: op.setupTime,+ setupUnit: op.setupUnit,+ laborTime: op.laborTime,+ laborUnit: op.laborUnit,+ machineTime: op.machineTime,+ machineUnit: op.machineUnit,+ operationUnitCost: op.operationUnitCost,+ operationMinimumCost: op.operationMinimumCost,+ ...rates+ };+ });+ }++ // Calculate costs using the same logic as the CSV export+ const computedCosts = calculateMadePartCosts(+ methods,+ bomOperationsByKey,+ (node) => node.data.materialMakeMethodId,+ lotSizesByItemId+ );++ // The top-level cost is the root node's computed cost+ const rootNode = methods[0];+ const unitCost = computedCosts.get(rootNode.id) ?? 0;++ // Update the item cost+ const updateResult = await client+ .from("itemCost")+ .update({ unitCost, updatedBy: userId })+ .eq("itemId", itemId);++ if (updateResult.error) {+ return {+ success: false,+ message: "Failed to update item cost"+ };+ }++ return {+ success: true,+ message: `Unit cost updated to ${unitCost.toFixed(2)}`+ };+}diff --git a/apps/erp/app/routes/api+/items.methods.$id.bom.tsx b/apps/erp/app/routes/api+/items.methods.$id.bom.tsxindex 7e6f70474e..c46c44eaa1 100644--- a/apps/erp/app/routes/api+/items.methods.$id.bom.tsx+++ b/apps/erp/app/routes/api+/items.methods.$id.bom.tsx@@ -5,11 +5,12 @@ import type { FlatTreeItem } from "~/components/TreeView";import { flattenTree } from "~/components/TreeView";import type { Method } from "~/modules/items";import { getMethodTree } from "~/modules/items";-import type { BomOperation } from "~/utils/bom";+import type { BomOperation, WorkCenterRate } from "~/utils/bom";import {calculateMadePartCosts,calculateTotalQuantity,- generateBomIds+ generateBomIds,+ resolveOperationRates} from "~/utils/bom";import { makeDurations } from "~/utils/duration";@@ -38,13 +39,41 @@ export async function loader({ request, params }: LoaderFunctionArgs) {...new Set(methods.map((method) => method.data.makeMethodId))];- const methodOperations = await client- .from("methodOperation")- .select(- "*, ...process(processName:name), ...workCenter(workCenterName:name, laborRate, machineRate, overheadRate)"- )- .in("makeMethodId", makeMethodIds)- .eq("companyId", companyId);+ const itemIds = [...new Set(methods.map((m) => m.data.itemId))];++ const [methodOperations, workCentersResult, lotSizesResult] =+ await Promise.all([+ client+ .from("methodOperation")+ .select(+ "*, ...process(processName:name), ...workCenter(workCenterName:name, laborRate, machineRate, overheadRate)"+ )+ .in("makeMethodId", makeMethodIds)+ .eq("companyId", companyId),+ client+ .from("workCenters")+ .select("id, active, laborRate, machineRate, overheadRate, processes")+ .eq("companyId", companyId),+ client+ .from("itemReplenishment")+ .select("itemId, lotSize")+ .in("itemId", itemIds)+ ]);++ const lotSizesByItemId = new Map(+ (lotSizesResult.data ?? []).map((r) => [r.itemId, r.lotSize ?? 1])+ );++ const workCenters: WorkCenterRate[] = (workCentersResult.data ?? []).map(+ (wc) => ({+ id: wc.id!,+ active: wc.active ?? false,+ laborRate: wc.laborRate,+ machineRate: wc.machineRate,+ overheadRate: wc.overheadRate,+ processes: wc.processes+ })+ );let operationsByMakeMethodId: Record<string,@@ -76,26 +105,35 @@ export async function loader({ request, params }: LoaderFunctionArgs) {const bomOperationsByKey: Record<string, BomOperation[]> = {};for (const [key, ops] of Object.entries(operationsByMakeMethodId)) {// @ts-expect-error TS2322 - TODO: fix type- bomOperationsByKey[key] = ops.map((op) => ({- operationType: op.operationType,- setupTime: op.setupTime,- setupUnit: op.setupUnit,- laborTime: op.laborTime,- laborUnit: op.laborUnit,- machineTime: op.machineTime,- machineUnit: op.machineUnit,- operationUnitCost: op.operationUnitCost,- operationMinimumCost: op.operationMinimumCost,- laborRate: op.laborRate ?? 0,- machineRate: op.machineRate ?? 0,- overheadRate: op.overheadRate ?? 0- }));+ bomOperationsByKey[key] = ops.map((op) => {+ const rates = resolveOperationRates(+ op.workCenterId,+ op.processId,+ op.laborRate,+ op.machineRate,+ op.overheadRate,+ workCenters+ );+ return {+ operationType: op.operationType,+ setupTime: op.setupTime,+ setupUnit: op.setupUnit,+ laborTime: op.laborTime,+ laborUnit: op.laborUnit,+ machineTime: op.machineTime,+ machineUnit: op.machineUnit,+ operationUnitCost: op.operationUnitCost,+ operationMinimumCost: op.operationMinimumCost,+ ...rates+ };+ });}const computedCosts = calculateMadePartCosts(methods,bomOperationsByKey,- (node) => node.data.materialMakeMethodId+ (node) => node.data.materialMakeMethodId,+ lotSizesByItemId);const bomIds = generateBomIds(methods);diff --git a/apps/erp/app/routes/api+/items.methods.$id.bom[.]csv.tsx b/apps/erp/app/routes/api+/items.methods.$id.bom[.]csv.tsxindex f7c262b007..44ea6bfd70 100644--- a/apps/erp/app/routes/api+/items.methods.$id.bom[.]csv.tsx+++ b/apps/erp/app/routes/api+/items.methods.$id.bom[.]csv.tsx@@ -5,11 +5,12 @@ import type { FlatTreeItem } from "~/components/TreeView";import { flattenTree } from "~/components/TreeView";import type { Method } from "~/modules/items";import { getMethodTree } from "~/modules/items";-import type { BomOperation } from "~/utils/bom";+import type { BomOperation, WorkCenterRate } from "~/utils/bom";import {calculateMadePartCosts,calculateTotalQuantity,- generateBomIds+ generateBomIds,+ resolveOperationRates} from "~/utils/bom";import { makeDurations } from "~/utils/duration";@@ -86,13 +87,41 @@ export async function loader({ request, params }: LoaderFunctionArgs) {...new Set(methods.map((method) => method.data.makeMethodId))];- const methodOperations = await client- .from("methodOperation")- .select(- "*, ...process(processName:name), ...workCenter(workCenterName:name, laborRate, machineRate, overheadRate)"- )- .in("makeMethodId", makeMethodIds)- .eq("companyId", companyId);+ const itemIds = [...new Set(methods.map((m) => m.data.itemId))];++ const [methodOperations, workCentersResult, lotSizesResult] =+ await Promise.all([+ client+ .from("methodOperation")+ .select(+ "*, ...process(processName:name), ...workCenter(workCenterName:name, laborRate, machineRate, overheadRate)"+ )+ .in("makeMethodId", makeMethodIds)+ .eq("companyId", companyId),+ client+ .from("workCenters")+ .select("id, active, laborRate, machineRate, overheadRate, processes")+ .eq("companyId", companyId),+ client+ .from("itemReplenishment")+ .select("itemId, lotSize")+ .in("itemId", itemIds)+ ]);++ const lotSizesByItemId = new Map(+ (lotSizesResult.data ?? []).map((r) => [r.itemId, r.lotSize ?? 1])+ );++ const workCenters: WorkCenterRate[] = (workCentersResult.data ?? []).map(+ (wc) => ({+ id: wc.id!,+ active: wc.active ?? false,+ laborRate: wc.laborRate,+ machineRate: wc.machineRate,+ overheadRate: wc.overheadRate,+ processes: wc.processes+ })+ );let operationsByMakeMethodId: Record<string,@@ -124,26 +153,35 @@ export async function loader({ request, params }: LoaderFunctionArgs) {const bomOperationsByKey: Record<string, BomOperation[]> = {};for (const [key, ops] of Object.entries(operationsByMakeMethodId)) {// @ts-expect-error TS2322 - TODO: fix type- bomOperationsByKey[key] = ops.map((op) => ({- operationType: op.operationType,- setupTime: op.setupTime,- setupUnit: op.setupUnit,- laborTime: op.laborTime,- laborUnit: op.laborUnit,- machineTime: op.machineTime,- machineUnit: op.machineUnit,- operationUnitCost: op.operationUnitCost,- operationMinimumCost: op.operationMinimumCost,- laborRate: op.laborRate ?? 0,- machineRate: op.machineRate ?? 0,- overheadRate: op.overheadRate ?? 0- }));+ bomOperationsByKey[key] = ops.map((op) => {+ const rates = resolveOperationRates(+ op.workCenterId,+ op.processId,+ op.laborRate,+ op.machineRate,+ op.overheadRate,+ workCenters+ );+ return {+ operationType: op.operationType,+ setupTime: op.setupTime,+ setupUnit: op.setupUnit,+ laborTime: op.laborTime,+ laborUnit: op.laborUnit,+ machineTime: op.machineTime,+ machineUnit: op.machineUnit,+ operationUnitCost: op.operationUnitCost,+ operationMinimumCost: op.operationMinimumCost,+ ...rates+ };+ });}const computedCosts = calculateMadePartCosts(methods,bomOperationsByKey,- (node) => node.data.materialMakeMethodId+ (node) => node.data.materialMakeMethodId,+ lotSizesByItemId);const bomIds = generateBomIds(methods);diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/account.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/account.tsindex 4c57aa4530..211a760313 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/account.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/account.ts@@ -1,26 +1,26 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";+import {+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {deleteUserAttributeValue,getAccount,- getAllAttributeCategories,- getAttributeCategoryWithValues,getAttributes,getPrivateAttributes,getPublicAttributes,+ getAllAttributeCategories,+ getAttributeCategoryWithValues,updateAvatar,updatePublicAccount,- upsertUserAttributeValue+ upsertUserAttributeValue,} from "~/modules/account/account.service";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerAccountTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -28,20 +28,17 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "delete user attribute value",inputSchema: {- args: z.object({- userAttributeId: z.string(),- userAttributeValueId: z.string()- })- },- annotations: DESTRUCTIVE_ANNOTATIONS+ args: z.object({+ userAttributeId: z.string(),+ userAttributeValueId: z.string()+ }),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteUserAttributeValue(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await deleteUserAttributeValue(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: account_deleteUserAttributeValue")+ }, "Failed: account_deleteUserAttributeValue"),);server.registerTool(@@ -49,14 +46,14 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get account",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAccount(ctx.client, params.id);return toMcpResult(result);- }, "Failed: account_getAccount")+ }, "Failed: account_getAccount"),);server.registerTool(@@ -64,19 +61,14 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get attributes",inputSchema: {- isPublic: z.boolean()- },- annotations: READ_ONLY_ANNOTATIONS+ isPublic: z.boolean(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAttributes(- ctx.client,- ctx.userId,- ctx.companyId,- params.isPublic- );+ const result = await getAttributes(ctx.client, ctx.userId, ctx.companyId, params.isPublic);return toMcpResult(result);- }, "Failed: account_getAttributes")+ }, "Failed: account_getAttributes"),);server.registerTool(@@ -84,16 +76,12 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get private attributes",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPrivateAttributes(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getPrivateAttributes(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: account_getPrivateAttributes")+ }, "Failed: account_getPrivateAttributes"),);server.registerTool(@@ -101,16 +89,12 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get public attributes",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPublicAttributes(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getPublicAttributes(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: account_getPublicAttributes")+ }, "Failed: account_getPublicAttributes"),);server.registerTool(@@ -118,16 +102,12 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get all attribute categories",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAllAttributeCategories(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getAllAttributeCategories(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: account_getAllAttributeCategories")+ }, "Failed: account_getAllAttributeCategories"),);server.registerTool(@@ -135,19 +115,14 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "get attribute category with values",inputSchema: {- categoryId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ categoryId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAttributeCategoryWithValues(- ctx.client,- params.categoryId,- ctx.userId,- ctx.companyId- );+ const result = await getAttributeCategoryWithValues(ctx.client, params.categoryId, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: account_getAttributeCategoryWithValues")+ }, "Failed: account_getAttributeCategoryWithValues"),);server.registerTool(@@ -155,18 +130,14 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "update avatar",inputSchema: {- avatarUrl: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ avatarUrl: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAvatar(- ctx.client,- ctx.userId,- params.avatarUrl- );+ const result = await updateAvatar(ctx.client, ctx.userId, params.avatarUrl);return toMcpResult(result);- }, "Failed: account_updateAvatar")+ }, "Failed: account_updateAvatar"),);server.registerTool(@@ -174,19 +145,19 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "update public account",inputSchema: {- account: z.object({- id: z.string(),- firstName: z.string(),- lastName: z.string(),- about: z.string().optional()- })- },- annotations: WRITE_ANNOTATIONS+ account: z.object({+ id: z.string(),+ firstName: z.string(),+ lastName: z.string(),+ about: z.string().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await updatePublicAccount(ctx.client, params.account);return toMcpResult(result);- }, "Failed: account_updatePublicAccount")+ }, "Failed: account_updatePublicAccount"),);server.registerTool(@@ -194,22 +165,18 @@ export const registerAccountTools: RegisterTools = (server, ctx) => {{description: "upsert user attribute value",inputSchema: {- update: z.object({- userAttributeValueId: z.any().optional(),- userAttributeId: z.string(),- value: z.any(),- type: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ userAttributeValueId: z.any().optional(),+ userAttributeId: z.string(),+ value: z.any(),+ type: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertUserAttributeValue(ctx.client, {- ...params.update,- userId: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertUserAttributeValue(ctx.client, { ...params.update, userId: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: account_upsertUserAttributeValue")+ }, "Failed: account_upsertUserAttributeValue"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/accounting.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/accounting.tsindex 35e20046ce..d64b3fe4f3 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/accounting.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/accounting.ts@@ -1,36 +1,34 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- accountCategoryValidator,- accountSubcategoryValidator,- accountValidator,- currencyValidator,- defaultBalanceSheetAccountValidator,- defaultIncomeAcountValidator,- fiscalYearSettingsValidator,- paymentTermValidator-} from "~/modules/accounting/accounting.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {deleteAccount,deleteAccountCategory,deleteAccountSubcategory,deletePaymentTerm,getAccount,+ getAccounts,+ getAccountsList,getAccountCategories,getAccountCategoriesList,getAccountCategory,getAccountSubcategories,getAccountSubcategoriesByCategory,getAccountSubcategory,- getAccounts,- getAccountsList,getBaseCurrency,getChartOfAccounts,- getCurrencies,- getCurrenciesList,getCurrency,getCurrencyByCode,+ getCurrencies,+ getCurrenciesList,getCurrentAccountingPeriod,getDefaultAccounts,getFiscalYearSettings,@@ -50,16 +48,18 @@ import {upsertAccountCategory,upsertAccountSubcategory,upsertCurrency,- upsertPaymentTerm+ upsertPaymentTerm,} from "~/modules/accounting/accounting.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ defaultBalanceSheetAccountValidator,+ defaultIncomeAcountValidator,+ fiscalYearSettingsValidator,+ accountValidator,+ accountCategoryValidator,+ accountSubcategoryValidator,+ currencyValidator,+ paymentTermValidator,+} from "~/modules/accounting/accounting.models";export const registerAccountingTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -67,14 +67,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "delete account",inputSchema: {- accountId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ accountId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteAccount(ctx.client, params.accountId);return toMcpResult(result);- }, "Failed: accounting_deleteAccount")+ }, "Failed: accounting_deleteAccount"),);server.registerTool(@@ -82,17 +82,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "delete account category",inputSchema: {- accountCategoryId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ accountCategoryId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteAccountCategory(- ctx.client,- params.accountCategoryId- );+ const result = await deleteAccountCategory(ctx.client, params.accountCategoryId);return toMcpResult(result);- }, "Failed: accounting_deleteAccountCategory")+ }, "Failed: accounting_deleteAccountCategory"),);server.registerTool(@@ -100,17 +97,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "delete account subcategory",inputSchema: {- accountSubcategoryId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ accountSubcategoryId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteAccountSubcategory(- ctx.client,- params.accountSubcategoryId- );+ const result = await deleteAccountSubcategory(ctx.client, params.accountSubcategoryId);return toMcpResult(result);- }, "Failed: accounting_deleteAccountSubcategory")+ }, "Failed: accounting_deleteAccountSubcategory"),);server.registerTool(@@ -118,14 +112,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "delete payment term",inputSchema: {- paymentTermId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ paymentTermId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deletePaymentTerm(ctx.client, params.paymentTermId);return toMcpResult(result);- }, "Failed: accounting_deletePaymentTerm")+ }, "Failed: accounting_deletePaymentTerm"),);server.registerTool(@@ -133,14 +127,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account",inputSchema: {- accountId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ accountId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAccount(ctx.client, params.accountId);return toMcpResult(result);- }, "Failed: accounting_getAccount")+ }, "Failed: accounting_getAccount"),);server.registerTool(@@ -148,18 +142,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get accounts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAccounts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getAccounts")+ }, "Failed: accounting_getAccounts"),);server.registerTool(@@ -167,24 +161,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get accounts list",inputSchema: {- args: z- .object({- type: z.any().optional(),- incomeBalance: z.any().optional(),- classes: z.array(z.any()).optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ type: z.any().optional(),+ incomeBalance: z.any().optional(),+ classes: z.array(z.any()).optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountsList(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getAccountsList(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getAccountsList")+ }, "Failed: accounting_getAccountsList"),);server.registerTool(@@ -192,22 +180,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account categories",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountCategories(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getAccountCategories(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getAccountCategories")+ }, "Failed: accounting_getAccountCategories"),);server.registerTool(@@ -215,12 +199,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account categories list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAccountCategoriesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getAccountCategoriesList")+ }, "Failed: accounting_getAccountCategoriesList"),);server.registerTool(@@ -228,18 +212,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account category",inputSchema: {- accountCategoryId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ accountCategoryId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountCategory(- ctx.client,- params.accountCategoryId,- ctx.companyId- );+ const result = await getAccountCategory(ctx.client, params.accountCategoryId, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getAccountCategory")+ }, "Failed: accounting_getAccountCategory"),);server.registerTool(@@ -247,22 +227,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account subcategories",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountSubcategories(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getAccountSubcategories(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getAccountSubcategories")+ }, "Failed: accounting_getAccountSubcategories"),);server.registerTool(@@ -270,18 +246,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account subcategories by category",inputSchema: {- accountCategoryId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ accountCategoryId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountSubcategoriesByCategory(- ctx.client,- params.accountCategoryId,- ctx.companyId- );+ const result = await getAccountSubcategoriesByCategory(ctx.client, params.accountCategoryId, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getAccountSubcategoriesByCategory")+ }, "Failed: accounting_getAccountSubcategoriesByCategory"),);server.registerTool(@@ -289,17 +261,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get account subcategory",inputSchema: {- accountSubcategoryId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ accountSubcategoryId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountSubcategory(- ctx.client,- params.accountSubcategoryId- );+ const result = await getAccountSubcategory(ctx.client, params.accountSubcategoryId);return toMcpResult(result);- }, "Failed: accounting_getAccountSubcategory")+ }, "Failed: accounting_getAccountSubcategory"),);server.registerTool(@@ -307,12 +276,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get base currency",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getBaseCurrency(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getBaseCurrency")+ }, "Failed: accounting_getBaseCurrency"),);server.registerTool(@@ -320,25 +289,21 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get chart of accounts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- name: z.string().nullable(),- incomeBalance: z.enum(["Income Statement", "Balance Sheet", "null"]),- startDate: z.string().nullable(),- endDate: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ name: z.string().nullable(),+ incomeBalance: z.enum(["Income Statement", "Balance Sheet", "null"]),+ startDate: z.string().nullable(),+ endDate: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getChartOfAccounts(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getChartOfAccounts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getChartOfAccounts")+ }, "Failed: accounting_getChartOfAccounts"),);server.registerTool(@@ -346,14 +311,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get currency",inputSchema: {- currencyId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ currencyId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCurrency(ctx.client, params.currencyId);return toMcpResult(result);- }, "Failed: accounting_getCurrency")+ }, "Failed: accounting_getCurrency"),);server.registerTool(@@ -361,18 +326,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get currency by code",inputSchema: {- currencyCode: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ currencyCode: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCurrencyByCode(- ctx.client,- ctx.companyId,- params.currencyCode- );+ const result = await getCurrencyByCode(ctx.client, ctx.companyId, params.currencyCode);return toMcpResult(result);- }, "Failed: accounting_getCurrencyByCode")+ }, "Failed: accounting_getCurrencyByCode"),);server.registerTool(@@ -380,22 +341,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get currencies",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCurrencies(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getCurrencies(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getCurrencies")+ }, "Failed: accounting_getCurrencies"),);server.registerTool(@@ -403,12 +360,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get currencies list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCurrenciesList(ctx.client);return toMcpResult(result);- }, "Failed: accounting_getCurrenciesList")+ }, "Failed: accounting_getCurrenciesList"),);server.registerTool(@@ -416,18 +373,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get current accounting period",inputSchema: {- date: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ date: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCurrentAccountingPeriod(- ctx.client,- ctx.companyId,- params.date- );+ const result = await getCurrentAccountingPeriod(ctx.client, ctx.companyId, params.date);return toMcpResult(result);- }, "Failed: accounting_getCurrentAccountingPeriod")+ }, "Failed: accounting_getCurrentAccountingPeriod"),);server.registerTool(@@ -435,12 +388,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get default accounts",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDefaultAccounts(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getDefaultAccounts")+ }, "Failed: accounting_getDefaultAccounts"),);server.registerTool(@@ -448,12 +401,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get fiscal year settings",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getFiscalYearSettings(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getFiscalYearSettings")+ }, "Failed: accounting_getFiscalYearSettings"),);server.registerTool(@@ -461,21 +414,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get inventory posting group",inputSchema: {- args: z.object({- itemPostingGroupId: z.string().nullable(),- locationId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ itemPostingGroupId: z.string().nullable(),+ locationId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getInventoryPostingGroup(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getInventoryPostingGroup(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getInventoryPostingGroup")+ }, "Failed: accounting_getInventoryPostingGroup"),);server.registerTool(@@ -483,21 +432,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get inventory posting groups",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getInventoryPostingGroups(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getInventoryPostingGroups(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getInventoryPostingGroups")+ }, "Failed: accounting_getInventoryPostingGroups"),);server.registerTool(@@ -505,14 +450,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get payment term",inputSchema: {- paymentTermId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ paymentTermId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPaymentTerm(ctx.client, params.paymentTermId);return toMcpResult(result);- }, "Failed: accounting_getPaymentTerm")+ }, "Failed: accounting_getPaymentTerm"),);server.registerTool(@@ -520,22 +465,18 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get payment terms",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPaymentTerms(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPaymentTerms(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getPaymentTerms")+ }, "Failed: accounting_getPaymentTerms"),);server.registerTool(@@ -543,12 +484,12 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get payment terms list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPaymentTermsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: accounting_getPaymentTermsList")+ }, "Failed: accounting_getPaymentTermsList"),);server.registerTool(@@ -556,21 +497,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get purchasing posting group",inputSchema: {- args: z.object({- itemPostingGroupId: z.string().nullable(),- supplierTypeId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ itemPostingGroupId: z.string().nullable(),+ supplierTypeId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingPostingGroup(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPurchasingPostingGroup(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getPurchasingPostingGroup")+ }, "Failed: accounting_getPurchasingPostingGroup"),);server.registerTool(@@ -578,21 +515,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get purchasing posting groups",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingPostingGroups(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPurchasingPostingGroups(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getPurchasingPostingGroups")+ }, "Failed: accounting_getPurchasingPostingGroups"),);server.registerTool(@@ -600,17 +533,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get purchasing sales group",inputSchema: {- args: z.object({- itemPostingGroupId: z.string().nullable(),- customerTypeId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ itemPostingGroupId: z.string().nullable(),+ customerTypeId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchasingSalesGroup(ctx.client, params.args);return toMcpResult(result);- }, "Failed: accounting_getPurchasingSalesGroup")+ }, "Failed: accounting_getPurchasingSalesGroup"),);server.registerTool(@@ -618,21 +551,17 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "get sales posting groups",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesPostingGroups(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSalesPostingGroups(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: accounting_getSalesPostingGroups")+ }, "Failed: accounting_getSalesPostingGroups"),);server.registerTool(@@ -640,18 +569,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "update default balance sheet accounts",inputSchema: {- defaultAccounts: defaultBalanceSheetAccountValidator- },- annotations: WRITE_ANNOTATIONS+ defaultAccounts: defaultBalanceSheetAccountValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDefaultBalanceSheetAccounts(ctx.client, {- ...params.defaultAccounts,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await updateDefaultBalanceSheetAccounts(ctx.client, { ...params.defaultAccounts, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_updateDefaultBalanceSheetAccounts")+ }, "Failed: accounting_updateDefaultBalanceSheetAccounts"),);server.registerTool(@@ -659,18 +584,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "update default income accounts",inputSchema: {- defaultAccounts: defaultIncomeAcountValidator- },- annotations: WRITE_ANNOTATIONS+ defaultAccounts: defaultIncomeAcountValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDefaultIncomeAccounts(ctx.client, {- ...params.defaultAccounts,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await updateDefaultIncomeAccounts(ctx.client, { ...params.defaultAccounts, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_updateDefaultIncomeAccounts")+ }, "Failed: accounting_updateDefaultIncomeAccounts"),);server.registerTool(@@ -678,18 +599,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "update fiscal year settings",inputSchema: {- fiscalYearSettings: fiscalYearSettingsValidator- },- annotations: WRITE_ANNOTATIONS+ fiscalYearSettings: fiscalYearSettingsValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateFiscalYearSettings(ctx.client, {- ...params.fiscalYearSettings,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await updateFiscalYearSettings(ctx.client, { ...params.fiscalYearSettings, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_updateFiscalYearSettings")+ }, "Failed: accounting_updateFiscalYearSettings"),);server.registerTool(@@ -697,19 +614,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "upsert account",inputSchema: {- account: accountValidator- },- annotations: WRITE_ANNOTATIONS+ account: accountValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertAccount(ctx.client, {- ...params.account,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertAccount(ctx.client, { ...params.account, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_upsertAccount")+ }, "Failed: accounting_upsertAccount"),);server.registerTool(@@ -717,19 +629,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "upsert account category",inputSchema: {- accountCategory: accountCategoryValidator- },- annotations: WRITE_ANNOTATIONS+ accountCategory: accountCategoryValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertAccountCategory(ctx.client, {- ...params.accountCategory,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertAccountCategory(ctx.client, { ...params.accountCategory, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_upsertAccountCategory")+ }, "Failed: accounting_upsertAccountCategory"),);server.registerTool(@@ -737,18 +644,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "upsert account subcategory",inputSchema: {- accountSubcategory: accountSubcategoryValidator- },- annotations: WRITE_ANNOTATIONS+ accountSubcategory: accountSubcategoryValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertAccountSubcategory(ctx.client, {- ...params.accountSubcategory,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertAccountSubcategory(ctx.client, { ...params.accountSubcategory, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_upsertAccountSubcategory")+ }, "Failed: accounting_upsertAccountSubcategory"),);server.registerTool(@@ -756,19 +659,14 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "upsert currency",inputSchema: {- currency: currencyValidator- },- annotations: WRITE_ANNOTATIONS+ currency: currencyValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertCurrency(ctx.client, {- ...params.currency,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertCurrency(ctx.client, { ...params.currency, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_upsertCurrency")+ }, "Failed: accounting_upsertCurrency"),);server.registerTool(@@ -776,18 +674,13 @@ export const registerAccountingTools: RegisterTools = (server, ctx) => {{description: "upsert payment term",inputSchema: {- paymentTerm: paymentTermValidator- },- annotations: WRITE_ANNOTATIONS+ paymentTerm: paymentTermValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPaymentTerm(ctx.client, {- ...params.paymentTerm,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPaymentTerm(ctx.client, { ...params.paymentTerm, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: accounting_upsertPaymentTerm")+ }, "Failed: accounting_upsertPaymentTerm"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/documents.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/documents.tsindex 3599376283..2ea2e877a5 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/documents.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/documents.ts@@ -1,34 +1,34 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- documentLabelsValidator,- documentValidator-} from "~/modules/documents/documents.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {deleteDocument,deleteDocumentFavorite,deleteDocumentLabel,getDocument,+ getDocuments,getDocumentExtensions,getDocumentLabels,- getDocuments,insertDocumentFavorite,insertDocumentLabel,moveDocumentToTrash,restoreDocument,+ upsertDocument,updateDocumentFavorite,updateDocumentLabels,- upsertDocument} from "~/modules/documents/documents.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ documentValidator,+ documentLabelsValidator,+} from "~/modules/documents/documents.models";export const registerDocumentsTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -36,14 +36,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "delete document",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteDocument(ctx.client, params.id);return toMcpResult(result);- }, "Failed: documents_deleteDocument")+ }, "Failed: documents_deleteDocument"),);server.registerTool(@@ -51,18 +51,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "delete document favorite",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteDocumentFavorite(- ctx.client,- params.id,- ctx.userId- );+ const result = await deleteDocumentFavorite(ctx.client, params.id, ctx.userId);return toMcpResult(result);- }, "Failed: documents_deleteDocumentFavorite")+ }, "Failed: documents_deleteDocumentFavorite"),);server.registerTool(@@ -70,19 +66,15 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "delete document label",inputSchema: {- id: z.string(),- label: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ label: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteDocumentLabel(- ctx.client,- params.id,- params.label- );+ const result = await deleteDocumentLabel(ctx.client, params.id, params.label);return toMcpResult(result);- }, "Failed: documents_deleteDocumentLabel")+ }, "Failed: documents_deleteDocumentLabel"),);server.registerTool(@@ -90,14 +82,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "get document",inputSchema: {- documentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ documentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDocument(ctx.client, params.documentId);return toMcpResult(result);- }, "Failed: documents_getDocument")+ }, "Failed: documents_getDocument"),);server.registerTool(@@ -105,25 +97,21 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "get documents",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- favorite: z.boolean().optional(),- recent: z.boolean().optional(),- active: z.boolean()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ favorite: z.boolean().optional(),+ recent: z.boolean().optional(),+ active: z.boolean()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDocuments(ctx.client, ctx.companyId, {- ...params.args,- createdBy: ctx.userId,- companyId: ctx.companyId- });+ const result = await getDocuments(ctx.client, ctx.companyId, { ...params.args, createdBy: ctx.userId, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: documents_getDocuments")+ }, "Failed: documents_getDocuments"),);server.registerTool(@@ -131,12 +119,12 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "get document extensions",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDocumentExtensions(ctx.client);return toMcpResult(result);- }, "Failed: documents_getDocumentExtensions")+ }, "Failed: documents_getDocumentExtensions"),);server.registerTool(@@ -144,12 +132,12 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "get document labels",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDocumentLabels(ctx.client, ctx.userId);return toMcpResult(result);- }, "Failed: documents_getDocumentLabels")+ }, "Failed: documents_getDocumentLabels"),);server.registerTool(@@ -157,18 +145,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "insert document favorite",inputSchema: {- id: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertDocumentFavorite(- ctx.client,- params.id,- ctx.userId- );+ const result = await insertDocumentFavorite(ctx.client, params.id, ctx.userId);return toMcpResult(result);- }, "Failed: documents_insertDocumentFavorite")+ }, "Failed: documents_insertDocumentFavorite"),);server.registerTool(@@ -176,20 +160,15 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "insert document label",inputSchema: {- id: z.string(),- label: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ label: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertDocumentLabel(- ctx.client,- params.id,- params.label,- ctx.userId- );+ const result = await insertDocumentLabel(ctx.client, params.id, params.label, ctx.userId);return toMcpResult(result);- }, "Failed: documents_insertDocumentLabel")+ }, "Failed: documents_insertDocumentLabel"),);server.registerTool(@@ -197,18 +176,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "move document to trash",inputSchema: {- id: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await moveDocumentToTrash(- ctx.client,- params.id,- ctx.userId- );+ const result = await moveDocumentToTrash(ctx.client, params.id, ctx.userId);return toMcpResult(result);- }, "Failed: documents_moveDocumentToTrash")+ }, "Failed: documents_moveDocumentToTrash"),);server.registerTool(@@ -216,14 +191,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "restore document",inputSchema: {- id: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await restoreDocument(ctx.client, params.id, ctx.userId);return toMcpResult(result);- }, "Failed: documents_restoreDocument")+ }, "Failed: documents_restoreDocument"),);server.registerTool(@@ -231,19 +206,14 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "upsert document",inputSchema: {- document: documentValidator- },- annotations: WRITE_ANNOTATIONS+ document: documentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertDocument(ctx.client, {- ...params.document,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertDocument(ctx.client, { ...params.document, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: documents_upsertDocument")+ }, "Failed: documents_upsertDocument"),);server.registerTool(@@ -251,20 +221,17 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "update document favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDocumentFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateDocumentFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: documents_updateDocumentFavorite")+ }, "Failed: documents_updateDocumentFavorite"),);server.registerTool(@@ -272,16 +239,13 @@ export const registerDocumentsTools: RegisterTools = (server, ctx) => {{description: "update document labels",inputSchema: {- document: documentLabelsValidator- },- annotations: WRITE_ANNOTATIONS+ document: documentLabelsValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDocumentLabels(ctx.client, {- ...params.document,- userId: ctx.userId- });+ const result = await updateDocumentLabels(ctx.client, { ...params.document, userId: ctx.userId });return toMcpResult(result);- }, "Failed: documents_updateDocumentLabels")+ }, "Failed: documents_updateDocumentLabels"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/inventory.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/inventory.tsindex 639a9d7830..e1b2457581 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/inventory.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/inventory.ts@@ -1,19 +1,14 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- batchPropertyOrderValidator,- batchPropertyValidator,- inventoryAdjustmentValidator,- kanbanValidator,- receiptValidator,- shelfValidator,- shipmentValidator,- shippingMethodValidator,- stockTransferLineValidator,- stockTransferValidator,- warehouseTransferValidator-} from "~/modules/inventory/inventory.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {deleteBatchProperty,deleteKanban,@@ -27,75 +22,80 @@ import {deleteStockTransferLine,deleteWarehouseTransfer,deleteWarehouseTransferLine,- getBatchNumbersForItem,+ getItemLedgerPage,getBatchProperties,- getDefaultShelfForJob,- getDefaultShelfOrShelfWithHighestQuantity,getInventoryItems,getInventoryItemsCount,- getItemLedgerPage,- getKanban,getKanbans,+ getKanban,+ getStockTransfer,+ getStockTransferLine,+ getStockTransferLines,+ getStockTransferTracking,+ getStockTransfers,+ getDefaultShelfOrShelfWithHighestQuantity,+ getReceipts,getReceipt,- getReceiptFiles,getReceiptLines,- getReceiptLineTracking,- getReceipts,getReceiptTracking,+ getReceiptLineTracking,+ getReceiptFiles,getSerialNumbersForItem,- getShelf,- getShelves,+ getBatchNumbersForItem,getShelvesList,getShelvesListForLocation,+ getShelves,+ getShelf,+ getShipments,getShipment,- getShipmentFiles,getShipmentLines,getShipmentLinesWithDetails,- getShipmentLineTracking,+ getShipmentFiles,getShipmentRelatedItems,- getShipments,getShipmentTracking,+ getShipmentLineTracking,getShippingMethod,getShippingMethods,getShippingMethodsList,getShippingTermsList,- getStockTransfer,- getStockTransferLine,- getStockTransferLines,- getStockTransfers,- getStockTransferTracking,getTrackedEntities,getTrackedEntitiesByMakeMethodId,- getTrackedEntitiesByOperationId,getTrackedEntity,+ getTrackedEntitiesByOperationId,+ getWarehouseTransfers,getWarehouseTransfer,getWarehouseTransferLine,getWarehouseTransferLines,- getWarehouseTransfers,insertManualInventoryAdjustment,updateBatchPropertyOrder,updateStockTransferStatus,- updateWarehouseTransferStatus,upsertBatchProperty,upsertKanban,upsertReceipt,upsertShelf,- upsertShipment,upsertShippingMethod,+ upsertShipment,upsertStockTransfer,upsertStockTransferLine,upsertStockTransferLines,upsertWarehouseTransfer,- upsertWarehouseTransferLine+ updateWarehouseTransferStatus,+ upsertWarehouseTransferLine,+ getDefaultShelfForJob,} from "~/modules/inventory/inventory.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ inventoryAdjustmentValidator,+ batchPropertyOrderValidator,+ batchPropertyValidator,+ kanbanValidator,+ receiptValidator,+ shelfValidator,+ shippingMethodValidator,+ shipmentValidator,+ stockTransferLineValidator,+ stockTransferValidator,+ warehouseTransferValidator,+} from "~/modules/inventory/inventory.models";export const registerInventoryTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -103,14 +103,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete batch property",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteBatchProperty(ctx.client, params.id);return toMcpResult(result);- }, "Failed: inventory_deleteBatchProperty")+ }, "Failed: inventory_deleteBatchProperty"),);server.registerTool(@@ -118,14 +118,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete kanban",inputSchema: {- kanbanId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ kanbanId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteKanban(ctx.client, params.kanbanId);return toMcpResult(result);- }, "Failed: inventory_deleteKanban")+ }, "Failed: inventory_deleteKanban"),);server.registerTool(@@ -133,14 +133,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete receipt",inputSchema: {- receiptId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ receiptId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteReceipt(ctx.client, params.receiptId);return toMcpResult(result);- }, "Failed: inventory_deleteReceipt")+ }, "Failed: inventory_deleteReceipt"),);server.registerTool(@@ -148,14 +148,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete receipt line",inputSchema: {- receiptLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ receiptLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteReceiptLine(ctx.client, params.receiptLineId);return toMcpResult(result);- }, "Failed: inventory_deleteReceiptLine")+ }, "Failed: inventory_deleteReceiptLine"),);server.registerTool(@@ -163,14 +163,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete shelf",inputSchema: {- shelfId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shelfId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteShelf(ctx.client, params.shelfId);return toMcpResult(result);- }, "Failed: inventory_deleteShelf")+ }, "Failed: inventory_deleteShelf"),);server.registerTool(@@ -178,14 +178,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete shipment",inputSchema: {- shipmentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteShipment(ctx.client, params.shipmentId);return toMcpResult(result);- }, "Failed: inventory_deleteShipment")+ }, "Failed: inventory_deleteShipment"),);server.registerTool(@@ -193,17 +193,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete shipment line",inputSchema: {- shipmentLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shipmentLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteShipmentLine(- ctx.client,- params.shipmentLineId- );+ const result = await deleteShipmentLine(ctx.client, params.shipmentLineId);return toMcpResult(result);- }, "Failed: inventory_deleteShipmentLine")+ }, "Failed: inventory_deleteShipmentLine"),);server.registerTool(@@ -211,17 +208,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete shipping method",inputSchema: {- shippingMethodId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shippingMethodId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteShippingMethod(- ctx.client,- params.shippingMethodId- );+ const result = await deleteShippingMethod(ctx.client, params.shippingMethodId);return toMcpResult(result);- }, "Failed: inventory_deleteShippingMethod")+ }, "Failed: inventory_deleteShippingMethod"),);server.registerTool(@@ -229,17 +223,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete stock transfer",inputSchema: {- stockTransferId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ stockTransferId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteStockTransfer(- ctx.client,- params.stockTransferId- );+ const result = await deleteStockTransfer(ctx.client, params.stockTransferId);return toMcpResult(result);- }, "Failed: inventory_deleteStockTransfer")+ }, "Failed: inventory_deleteStockTransfer"),);server.registerTool(@@ -247,17 +238,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete stock transfer line",inputSchema: {- stockTransferLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ stockTransferLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteStockTransferLine(- ctx.client,- params.stockTransferLineId- );+ const result = await deleteStockTransferLine(ctx.client, params.stockTransferLineId);return toMcpResult(result);- }, "Failed: inventory_deleteStockTransferLine")+ }, "Failed: inventory_deleteStockTransferLine"),);server.registerTool(@@ -265,17 +253,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete warehouse transfer",inputSchema: {- transferId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ transferId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteWarehouseTransfer(- ctx.client,- params.transferId- );+ const result = await deleteWarehouseTransfer(ctx.client, params.transferId);return toMcpResult(result);- }, "Failed: inventory_deleteWarehouseTransfer")+ }, "Failed: inventory_deleteWarehouseTransfer"),);server.registerTool(@@ -283,17 +268,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "delete warehouse transfer line",inputSchema: {- transferLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ transferLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteWarehouseTransferLine(- ctx.client,- params.transferLineId- );+ const result = await deleteWarehouseTransferLine(ctx.client, params.transferLineId);return toMcpResult(result);- }, "Failed: inventory_deleteWarehouseTransferLine")+ }, "Failed: inventory_deleteWarehouseTransferLine"),);server.registerTool(@@ -301,24 +283,17 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get item ledger page",inputSchema: {- itemId: z.string(),- locationId: z.string(),- sortDescending: z.boolean().optional(),- page: z.number().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ sortDescending: z.boolean().optional(),+ page: z.number().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemLedgerPage(- ctx.client,- params.itemId,- ctx.companyId,- params.locationId,- params.sortDescending,- params.page- );+ const result = await getItemLedgerPage(ctx.client, params.itemId, ctx.companyId, params.locationId, params.sortDescending, params.page);return toMcpResult(result);- }, "Failed: inventory_getItemLedgerPage")+ }, "Failed: inventory_getItemLedgerPage"),);server.registerTool(@@ -326,18 +301,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get batch properties",inputSchema: {- itemIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ itemIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getBatchProperties(- ctx.client,- params.itemIds,- ctx.companyId- );+ const result = await getBatchProperties(ctx.client, params.itemIds, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getBatchProperties")+ }, "Failed: inventory_getBatchProperties"),);server.registerTool(@@ -345,24 +316,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get inventory items",inputSchema: {- locationId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getInventoryItems(- ctx.client,- params.locationId,- ctx.companyId,- params.args- );+ const result = await getInventoryItems(ctx.client, params.locationId, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getInventoryItems")+ }, "Failed: inventory_getInventoryItems"),);server.registerTool(@@ -370,24 +336,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get inventory items count",inputSchema: {- locationId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getInventoryItemsCount(- ctx.client,- params.locationId,- ctx.companyId,- params.args- );+ const result = await getInventoryItemsCount(ctx.client, params.locationId, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getInventoryItemsCount")+ }, "Failed: inventory_getInventoryItemsCount"),);server.registerTool(@@ -395,24 +356,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get kanbans",inputSchema: {- locationId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getKanbans(- ctx.client,- params.locationId,- ctx.companyId,- params.args- );+ const result = await getKanbans(ctx.client, params.locationId, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getKanbans")+ }, "Failed: inventory_getKanbans"),);server.registerTool(@@ -420,14 +376,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get kanban",inputSchema: {- kanbanId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ kanbanId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getKanban(ctx.client, params.kanbanId);return toMcpResult(result);- }, "Failed: inventory_getKanban")+ }, "Failed: inventory_getKanban"),);server.registerTool(@@ -435,14 +391,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get stock transfer",inputSchema: {- stockTransferId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ stockTransferId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getStockTransfer(ctx.client, params.stockTransferId);return toMcpResult(result);- }, "Failed: inventory_getStockTransfer")+ }, "Failed: inventory_getStockTransfer"),);server.registerTool(@@ -450,17 +406,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get stock transfer line",inputSchema: {- stockTransferLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ stockTransferLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getStockTransferLine(- ctx.client,- params.stockTransferLineId- );+ const result = await getStockTransferLine(ctx.client, params.stockTransferLineId);return toMcpResult(result);- }, "Failed: inventory_getStockTransferLine")+ }, "Failed: inventory_getStockTransferLine"),);server.registerTool(@@ -468,17 +421,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get stock transfer lines",inputSchema: {- stockTransferId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ stockTransferId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getStockTransferLines(- ctx.client,- params.stockTransferId- );+ const result = await getStockTransferLines(ctx.client, params.stockTransferId);return toMcpResult(result);- }, "Failed: inventory_getStockTransferLines")+ }, "Failed: inventory_getStockTransferLines"),);server.registerTool(@@ -486,18 +436,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get stock transfer tracking",inputSchema: {- stockTransferId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ stockTransferId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getStockTransferTracking(- ctx.client,- params.stockTransferId,- ctx.companyId- );+ const result = await getStockTransferTracking(ctx.client, params.stockTransferId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getStockTransferTracking")+ }, "Failed: inventory_getStockTransferTracking"),);server.registerTool(@@ -505,23 +451,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get stock transfers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- locationId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ locationId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getStockTransfers(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getStockTransfers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getStockTransfers")+ }, "Failed: inventory_getStockTransfers"),);server.registerTool(@@ -529,20 +471,15 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get default shelf or shelf with highest quantity",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDefaultShelfOrShelfWithHighestQuantity(- ctx.client,- params.itemId,- params.locationId,- ctx.companyId- );+ const result = await getDefaultShelfOrShelfWithHighestQuantity(ctx.client, params.itemId, params.locationId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getDefaultShelfOrShelfWithHighestQuantity")+ }, "Failed: inventory_getDefaultShelfOrShelfWithHighestQuantity"),);server.registerTool(@@ -550,18 +487,18 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getReceipts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getReceipts")+ }, "Failed: inventory_getReceipts"),);server.registerTool(@@ -569,14 +506,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipt",inputSchema: {- receiptId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ receiptId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getReceipt(ctx.client, params.receiptId);return toMcpResult(result);- }, "Failed: inventory_getReceipt")+ }, "Failed: inventory_getReceipt"),);server.registerTool(@@ -584,14 +521,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipt lines",inputSchema: {- receiptId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ receiptId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getReceiptLines(ctx.client, params.receiptId);return toMcpResult(result);- }, "Failed: inventory_getReceiptLines")+ }, "Failed: inventory_getReceiptLines"),);server.registerTool(@@ -599,18 +536,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipt tracking",inputSchema: {- receiptId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ receiptId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getReceiptTracking(- ctx.client,- params.receiptId,- ctx.companyId- );+ const result = await getReceiptTracking(ctx.client, params.receiptId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getReceiptTracking")+ }, "Failed: inventory_getReceiptTracking"),);server.registerTool(@@ -618,18 +551,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipt line tracking",inputSchema: {- receiptLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ receiptLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getReceiptLineTracking(- ctx.client,- params.receiptLineId,- ctx.companyId- );+ const result = await getReceiptLineTracking(ctx.client, params.receiptLineId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getReceiptLineTracking")+ }, "Failed: inventory_getReceiptLineTracking"),);server.registerTool(@@ -637,18 +566,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get receipt files",inputSchema: {- lineIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ lineIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getReceiptFiles(- ctx.client,- ctx.companyId,- params.lineIds- );+ const result = await getReceiptFiles(ctx.client, ctx.companyId, params.lineIds);return toMcpResult(result);- }, "Failed: inventory_getReceiptFiles")+ }, "Failed: inventory_getReceiptFiles"),);server.registerTool(@@ -656,19 +581,16 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get serial numbers for item",inputSchema: {- args: z.object({- itemId: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ itemId: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSerialNumbersForItem(ctx.client, {- ...params.args,- companyId: ctx.companyId- });+ const result = await getSerialNumbersForItem(ctx.client, { ...params.args, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: inventory_getSerialNumbersForItem")+ }, "Failed: inventory_getSerialNumbersForItem"),);server.registerTool(@@ -676,20 +598,17 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get batch numbers for item",inputSchema: {- args: z.object({- itemId: z.string(),- isReadOnly: z.boolean().optional()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ itemId: z.string(),+ isReadOnly: z.boolean().optional()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getBatchNumbersForItem(ctx.client, {- ...params.args,- companyId: ctx.companyId- });+ const result = await getBatchNumbersForItem(ctx.client, { ...params.args, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: inventory_getBatchNumbersForItem")+ }, "Failed: inventory_getBatchNumbersForItem"),);server.registerTool(@@ -697,12 +616,12 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shelves list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShelvesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getShelvesList")+ }, "Failed: inventory_getShelvesList"),);server.registerTool(@@ -710,18 +629,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shelves list for location",inputSchema: {- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShelvesListForLocation(- ctx.client,- ctx.companyId,- params.locationId- );+ const result = await getShelvesListForLocation(ctx.client, ctx.companyId, params.locationId);return toMcpResult(result);- }, "Failed: inventory_getShelvesListForLocation")+ }, "Failed: inventory_getShelvesListForLocation"),);server.registerTool(@@ -729,24 +644,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shelves",inputSchema: {- locationId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShelves(- ctx.client,- params.locationId,- ctx.companyId,- params.args- );+ const result = await getShelves(ctx.client, params.locationId, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getShelves")+ }, "Failed: inventory_getShelves"),);server.registerTool(@@ -754,14 +664,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shelf",inputSchema: {- shelfId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shelfId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShelf(ctx.client, params.shelfId);return toMcpResult(result);- }, "Failed: inventory_getShelf")+ }, "Failed: inventory_getShelf"),);server.registerTool(@@ -769,18 +679,18 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipments",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShipments(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getShipments")+ }, "Failed: inventory_getShipments"),);server.registerTool(@@ -788,14 +698,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment",inputSchema: {- shipmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShipment(ctx.client, params.shipmentId);return toMcpResult(result);- }, "Failed: inventory_getShipment")+ }, "Failed: inventory_getShipment"),);server.registerTool(@@ -803,14 +713,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment lines",inputSchema: {- shipmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShipmentLines(ctx.client, params.shipmentId);return toMcpResult(result);- }, "Failed: inventory_getShipmentLines")+ }, "Failed: inventory_getShipmentLines"),);server.registerTool(@@ -818,17 +728,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment lines with details",inputSchema: {- shipmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShipmentLinesWithDetails(- ctx.client,- params.shipmentId- );+ const result = await getShipmentLinesWithDetails(ctx.client, params.shipmentId);return toMcpResult(result);- }, "Failed: inventory_getShipmentLinesWithDetails")+ }, "Failed: inventory_getShipmentLinesWithDetails"),);server.registerTool(@@ -836,18 +743,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment files",inputSchema: {- lineIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ lineIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShipmentFiles(- ctx.client,- ctx.companyId,- params.lineIds- );+ const result = await getShipmentFiles(ctx.client, ctx.companyId, params.lineIds);return toMcpResult(result);- }, "Failed: inventory_getShipmentFiles")+ }, "Failed: inventory_getShipmentFiles"),);server.registerTool(@@ -855,19 +758,15 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment related items",inputSchema: {- shipmentId: z.string(),- sourceDocumentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentId: z.string(),+ sourceDocumentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShipmentRelatedItems(- ctx.client,- params.shipmentId,- params.sourceDocumentId- );+ const result = await getShipmentRelatedItems(ctx.client, params.shipmentId, params.sourceDocumentId);return toMcpResult(result);- }, "Failed: inventory_getShipmentRelatedItems")+ }, "Failed: inventory_getShipmentRelatedItems"),);server.registerTool(@@ -875,18 +774,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment tracking",inputSchema: {- shipmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShipmentTracking(- ctx.client,- params.shipmentId,- ctx.companyId- );+ const result = await getShipmentTracking(ctx.client, params.shipmentId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getShipmentTracking")+ }, "Failed: inventory_getShipmentTracking"),);server.registerTool(@@ -894,18 +789,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipment line tracking",inputSchema: {- shipmentLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shipmentLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShipmentLineTracking(- ctx.client,- params.shipmentLineId,- ctx.companyId- );+ const result = await getShipmentLineTracking(ctx.client, params.shipmentLineId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getShipmentLineTracking")+ }, "Failed: inventory_getShipmentLineTracking"),);server.registerTool(@@ -913,17 +804,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipping method",inputSchema: {- shippingMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shippingMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShippingMethod(- ctx.client,- params.shippingMethodId- );+ const result = await getShippingMethod(ctx.client, params.shippingMethodId);return toMcpResult(result);- }, "Failed: inventory_getShippingMethod")+ }, "Failed: inventory_getShippingMethod"),);server.registerTool(@@ -931,22 +819,18 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipping methods",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getShippingMethods(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getShippingMethods(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getShippingMethods")+ }, "Failed: inventory_getShippingMethods"),);server.registerTool(@@ -954,12 +838,12 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipping methods list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShippingMethodsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getShippingMethodsList")+ }, "Failed: inventory_getShippingMethodsList"),);server.registerTool(@@ -967,12 +851,12 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get shipping terms list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShippingTermsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getShippingTermsList")+ }, "Failed: inventory_getShippingTermsList"),);server.registerTool(@@ -980,22 +864,18 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get tracked entities",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrackedEntities(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getTrackedEntities(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getTrackedEntities")+ }, "Failed: inventory_getTrackedEntities"),);server.registerTool(@@ -1003,17 +883,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get tracked entities by make method id",inputSchema: {- jobMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrackedEntitiesByMakeMethodId(- ctx.client,- params.jobMakeMethodId- );+ const result = await getTrackedEntitiesByMakeMethodId(ctx.client, params.jobMakeMethodId);return toMcpResult(result);- }, "Failed: inventory_getTrackedEntitiesByMakeMethodId")+ }, "Failed: inventory_getTrackedEntitiesByMakeMethodId"),);server.registerTool(@@ -1021,14 +898,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get tracked entity",inputSchema: {- trackedEntityId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ trackedEntityId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrackedEntity(ctx.client, params.trackedEntityId);return toMcpResult(result);- }, "Failed: inventory_getTrackedEntity")+ }, "Failed: inventory_getTrackedEntity"),);server.registerTool(@@ -1036,17 +913,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get tracked entities by operation id",inputSchema: {- operationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ operationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrackedEntitiesByOperationId(- ctx.client,- params.operationId- );+ const result = await getTrackedEntitiesByOperationId(ctx.client, params.operationId);return toMcpResult(result);- }, "Failed: inventory_getTrackedEntitiesByOperationId")+ }, "Failed: inventory_getTrackedEntitiesByOperationId"),);server.registerTool(@@ -1054,22 +928,18 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get warehouse transfers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWarehouseTransfers(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getWarehouseTransfers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: inventory_getWarehouseTransfers")+ }, "Failed: inventory_getWarehouseTransfers"),);server.registerTool(@@ -1077,14 +947,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get warehouse transfer",inputSchema: {- transferId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ transferId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWarehouseTransfer(ctx.client, params.transferId);return toMcpResult(result);- }, "Failed: inventory_getWarehouseTransfer")+ }, "Failed: inventory_getWarehouseTransfer"),);server.registerTool(@@ -1092,19 +962,15 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get warehouse transfer line",inputSchema: {- transferId: z.string(),- lineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ transferId: z.string(),+ lineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWarehouseTransferLine(- ctx.client,- params.transferId,- params.lineId- );+ const result = await getWarehouseTransferLine(ctx.client, params.transferId, params.lineId);return toMcpResult(result);- }, "Failed: inventory_getWarehouseTransferLine")+ }, "Failed: inventory_getWarehouseTransferLine"),);server.registerTool(@@ -1112,17 +978,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get warehouse transfer lines",inputSchema: {- transferId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ transferId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWarehouseTransferLines(- ctx.client,- params.transferId- );+ const result = await getWarehouseTransferLines(ctx.client, params.transferId);return toMcpResult(result);- }, "Failed: inventory_getWarehouseTransferLines")+ }, "Failed: inventory_getWarehouseTransferLines"),);server.registerTool(@@ -1130,18 +993,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "insert manual inventory adjustment",inputSchema: {- inventoryAdjustment: inventoryAdjustmentValidator- },- annotations: WRITE_ANNOTATIONS+ inventoryAdjustment: inventoryAdjustmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertManualInventoryAdjustment(ctx.client, {- ...params.inventoryAdjustment,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertManualInventoryAdjustment(ctx.client, { ...params.inventoryAdjustment, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_insertManualInventoryAdjustment")+ }, "Failed: inventory_insertManualInventoryAdjustment"),);server.registerTool(@@ -1149,17 +1008,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "update batch property order",inputSchema: {- data: batchPropertyOrderValidator- },- annotations: WRITE_ANNOTATIONS+ data: batchPropertyOrderValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateBatchPropertyOrder(ctx.client, {- ...params.data,- updatedBy: ctx.userId- });+ const result = await updateBatchPropertyOrder(ctx.client, { ...params.data, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_updateBatchPropertyOrder")+ }, "Failed: inventory_updateBatchPropertyOrder"),);server.registerTool(@@ -1167,22 +1023,19 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "update stock transfer status",inputSchema: {- args: z.object({- id: z.string(),- status: z.any(),- assignee: z.string().nullable().optional(),- completedAt: z.string().nullable()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.string().nullable().optional(),+ completedAt: z.string().nullable()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateStockTransferStatus(ctx.client, {- ...params.args,- updatedBy: ctx.userId- });+ const result = await updateStockTransferStatus(ctx.client, { ...params.args, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_updateStockTransferStatus")+ }, "Failed: inventory_updateStockTransferStatus"),);server.registerTool(@@ -1190,18 +1043,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert batch property",inputSchema: {- batchProperty: batchPropertyValidator- },- annotations: WRITE_ANNOTATIONS+ batchProperty: batchPropertyValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertBatchProperty(ctx.client, {- ...params.batchProperty,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertBatchProperty(ctx.client, { ...params.batchProperty, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertBatchProperty")+ }, "Failed: inventory_upsertBatchProperty"),);server.registerTool(@@ -1209,19 +1058,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert kanban",inputSchema: {- kanban: kanbanValidator- },- annotations: WRITE_ANNOTATIONS+ kanban: kanbanValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertKanban(ctx.client, {- ...params.kanban,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertKanban(ctx.client, { ...params.kanban, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertKanban")+ }, "Failed: inventory_upsertKanban"),);server.registerTool(@@ -1229,19 +1073,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert receipt",inputSchema: {- receipt: receiptValidator- },- annotations: WRITE_ANNOTATIONS+ receipt: receiptValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertReceipt(ctx.client, {- ...params.receipt,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertReceipt(ctx.client, { ...params.receipt, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertReceipt")+ }, "Failed: inventory_upsertReceipt"),);server.registerTool(@@ -1249,19 +1088,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert shelf",inputSchema: {- shelf: shelfValidator- },- annotations: WRITE_ANNOTATIONS+ shelf: shelfValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertShelf(ctx.client, {- ...params.shelf,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertShelf(ctx.client, { ...params.shelf, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertShelf")+ }, "Failed: inventory_upsertShelf"),);server.registerTool(@@ -1269,19 +1103,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert shipping method",inputSchema: {- shippingMethod: shippingMethodValidator- },- annotations: WRITE_ANNOTATIONS+ shippingMethod: shippingMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertShippingMethod(ctx.client, {- ...params.shippingMethod,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertShippingMethod(ctx.client, { ...params.shippingMethod, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertShippingMethod")+ }, "Failed: inventory_upsertShippingMethod"),);server.registerTool(@@ -1289,19 +1118,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert shipment",inputSchema: {- shipment: shipmentValidator- },- annotations: WRITE_ANNOTATIONS+ shipment: shipmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertShipment(ctx.client, {- ...params.shipment,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertShipment(ctx.client, { ...params.shipment, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertShipment")+ }, "Failed: inventory_upsertShipment"),);server.registerTool(@@ -1309,19 +1133,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert stock transfer",inputSchema: {- stockTransfer: z.any()- },- annotations: WRITE_ANNOTATIONS+ stockTransfer: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertStockTransfer(ctx.client, {- ...params.stockTransfer,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertStockTransfer(ctx.client, { ...params.stockTransfer, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertStockTransfer")+ }, "Failed: inventory_upsertStockTransfer"),);server.registerTool(@@ -1329,19 +1148,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert stock transfer line",inputSchema: {- stockTransferLine: stockTransferLineValidator- },- annotations: WRITE_ANNOTATIONS+ stockTransferLine: stockTransferLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertStockTransferLine(ctx.client, {- ...params.stockTransferLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertStockTransferLine(ctx.client, { ...params.stockTransferLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertStockTransferLine")+ }, "Failed: inventory_upsertStockTransferLine"),);server.registerTool(@@ -1349,18 +1163,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert stock transfer lines",inputSchema: {- args: stockTransferValidator- },- annotations: WRITE_ANNOTATIONS+ args: stockTransferValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertStockTransferLines(ctx.client, {- ...params.args,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await upsertStockTransferLines(ctx.client, { ...params.args, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertStockTransferLines")+ }, "Failed: inventory_upsertStockTransferLines"),);server.registerTool(@@ -1368,19 +1178,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert warehouse transfer",inputSchema: {- transfer: warehouseTransferValidator- },- annotations: WRITE_ANNOTATIONS+ transfer: warehouseTransferValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertWarehouseTransfer(ctx.client, {- ...params.transfer,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertWarehouseTransfer(ctx.client, { ...params.transfer, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: inventory_upsertWarehouseTransfer")+ }, "Failed: inventory_upsertWarehouseTransfer"),);server.registerTool(@@ -1388,20 +1193,15 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "update warehouse transfer status",inputSchema: {- transferId: z.string(),- status: z.any()- },- annotations: WRITE_ANNOTATIONS+ transferId: z.string(),+ status: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateWarehouseTransferStatus(- ctx.client,- params.transferId,- params.status,- ctx.userId- );+ const result = await updateWarehouseTransferStatus(ctx.client, params.transferId, params.status, ctx.userId);return toMcpResult(result);- }, "Failed: inventory_updateWarehouseTransferStatus")+ }, "Failed: inventory_updateWarehouseTransferStatus"),);server.registerTool(@@ -1409,14 +1209,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "upsert warehouse transfer line",inputSchema: {- line: z.any()- },- annotations: WRITE_ANNOTATIONS+ line: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await upsertWarehouseTransferLine(ctx.client, params.line);return toMcpResult(result);- }, "Failed: inventory_upsertWarehouseTransferLine")+ }, "Failed: inventory_upsertWarehouseTransferLine"),);server.registerTool(@@ -1424,19 +1224,14 @@ export const registerInventoryTools: RegisterTools = (server, ctx) => {{description: "get default shelf for job",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDefaultShelfForJob(- ctx.client,- params.itemId,- params.locationId,- ctx.companyId- );+ const result = await getDefaultShelfForJob(ctx.client, params.itemId, params.locationId, ctx.companyId);return toMcpResult(result);- }, "Failed: inventory_getDefaultShelfForJob")+ }, "Failed: inventory_getDefaultShelfForJob"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/invoicing.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/invoicing.tsindex 695d2fd43f..2515c53b4c 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/invoicing.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/invoicing.ts@@ -1,14 +1,14 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- purchaseInvoiceDeliveryValidator,- purchaseInvoiceLineValidator,- purchaseInvoiceValidator,- salesInvoiceLineValidator,- salesInvoiceShipmentValidator,- salesInvoiceValidator-} from "~/modules/invoicing/invoicing.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {createPurchaseInvoiceFromPurchaseOrder,createSalesInvoiceFromSalesOrder,@@ -18,16 +18,16 @@ import {deleteSalesInvoice,deleteSalesInvoiceLine,getPurchaseInvoice,+ getPurchaseInvoices,getPurchaseInvoiceDelivery,- getPurchaseInvoiceLine,getPurchaseInvoiceLines,- getPurchaseInvoices,+ getPurchaseInvoiceLine,getSalesInvoice,getSalesInvoiceCustomerDetails,- getSalesInvoiceLine,- getSalesInvoiceLines,- getSalesInvoiceShipment,getSalesInvoices,+ getSalesInvoiceShipment,+ getSalesInvoiceLines,+ getSalesInvoiceLine,updatePurchaseInvoiceExchangeRate,updatePurchaseInvoiceStatus,updateSalesInvoiceExchangeRate,@@ -36,17 +36,17 @@ import {upsertPurchaseInvoiceDelivery,upsertPurchaseInvoiceLine,upsertSalesInvoice,+ upsertSalesInvoiceShipment,upsertSalesInvoiceLine,- upsertSalesInvoiceShipment} from "~/modules/invoicing/invoicing.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ purchaseInvoiceValidator,+ purchaseInvoiceDeliveryValidator,+ purchaseInvoiceLineValidator,+ salesInvoiceValidator,+ salesInvoiceShipmentValidator,+ salesInvoiceLineValidator,+} from "~/modules/invoicing/invoicing.models";export const registerInvoicingTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -54,19 +54,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "create purchase invoice from purchase order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await createPurchaseInvoiceFromPurchaseOrder(- ctx.client,- params.purchaseOrderId,- ctx.companyId,- ctx.userId- );+ const result = await createPurchaseInvoiceFromPurchaseOrder(ctx.client, params.purchaseOrderId, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: invoicing_createPurchaseInvoiceFromPurchaseOrder")+ }, "Failed: invoicing_createPurchaseInvoiceFromPurchaseOrder"),);server.registerTool(@@ -74,19 +69,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "create sales invoice from sales order",inputSchema: {- salesOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await createSalesInvoiceFromSalesOrder(- ctx.client,- params.salesOrderId,- ctx.companyId,- ctx.userId- );+ const result = await createSalesInvoiceFromSalesOrder(ctx.client, params.salesOrderId, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: invoicing_createSalesInvoiceFromSalesOrder")+ }, "Failed: invoicing_createSalesInvoiceFromSalesOrder"),);server.registerTool(@@ -94,19 +84,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "create sales invoice from shipment",inputSchema: {- shipmentId: z.string()- },- annotations: WRITE_ANNOTATIONS+ shipmentId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await createSalesInvoiceFromShipment(- ctx.client,- params.shipmentId,- ctx.companyId,- ctx.userId- );+ const result = await createSalesInvoiceFromShipment(ctx.client, params.shipmentId, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: invoicing_createSalesInvoiceFromShipment")+ }, "Failed: invoicing_createSalesInvoiceFromShipment"),);server.registerTool(@@ -114,17 +99,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "delete purchase invoice",inputSchema: {- purchaseInvoiceId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchaseInvoiceId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchaseInvoice(- ctx.client,- params.purchaseInvoiceId- );+ const result = await deletePurchaseInvoice(ctx.client, params.purchaseInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_deletePurchaseInvoice")+ }, "Failed: invoicing_deletePurchaseInvoice"),);server.registerTool(@@ -132,17 +114,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "delete purchase invoice line",inputSchema: {- purchaseInvoiceLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchaseInvoiceLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchaseInvoiceLine(- ctx.client,- params.purchaseInvoiceLineId- );+ const result = await deletePurchaseInvoiceLine(ctx.client, params.purchaseInvoiceLineId);return toMcpResult(result);- }, "Failed: invoicing_deletePurchaseInvoiceLine")+ }, "Failed: invoicing_deletePurchaseInvoiceLine"),);server.registerTool(@@ -150,17 +129,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "delete sales invoice",inputSchema: {- salesInvoiceId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesInvoiceId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSalesInvoice(- ctx.client,- params.salesInvoiceId- );+ const result = await deleteSalesInvoice(ctx.client, params.salesInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_deleteSalesInvoice")+ }, "Failed: invoicing_deleteSalesInvoice"),);server.registerTool(@@ -168,17 +144,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "delete sales invoice line",inputSchema: {- salesInvoiceLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesInvoiceLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSalesInvoiceLine(- ctx.client,- params.salesInvoiceLineId- );+ const result = await deleteSalesInvoiceLine(ctx.client, params.salesInvoiceLineId);return toMcpResult(result);- }, "Failed: invoicing_deleteSalesInvoiceLine")+ }, "Failed: invoicing_deleteSalesInvoiceLine"),);server.registerTool(@@ -186,17 +159,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get purchase invoice",inputSchema: {- purchaseInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseInvoice(- ctx.client,- params.purchaseInvoiceId- );+ const result = await getPurchaseInvoice(ctx.client, params.purchaseInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getPurchaseInvoice")+ }, "Failed: invoicing_getPurchaseInvoice"),);server.registerTool(@@ -204,23 +174,19 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get purchase invoices",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseInvoices(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPurchaseInvoices(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: invoicing_getPurchaseInvoices")+ }, "Failed: invoicing_getPurchaseInvoices"),);server.registerTool(@@ -228,17 +194,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get purchase invoice delivery",inputSchema: {- purchaseInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseInvoiceDelivery(- ctx.client,- params.purchaseInvoiceId- );+ const result = await getPurchaseInvoiceDelivery(ctx.client, params.purchaseInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getPurchaseInvoiceDelivery")+ }, "Failed: invoicing_getPurchaseInvoiceDelivery"),);server.registerTool(@@ -246,17 +209,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get purchase invoice lines",inputSchema: {- purchaseInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseInvoiceLines(- ctx.client,- params.purchaseInvoiceId- );+ const result = await getPurchaseInvoiceLines(ctx.client, params.purchaseInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getPurchaseInvoiceLines")+ }, "Failed: invoicing_getPurchaseInvoiceLines"),);server.registerTool(@@ -264,17 +224,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get purchase invoice line",inputSchema: {- purchaseInvoiceLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseInvoiceLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseInvoiceLine(- ctx.client,- params.purchaseInvoiceLineId- );+ const result = await getPurchaseInvoiceLine(ctx.client, params.purchaseInvoiceLineId);return toMcpResult(result);- }, "Failed: invoicing_getPurchaseInvoiceLine")+ }, "Failed: invoicing_getPurchaseInvoiceLine"),);server.registerTool(@@ -282,14 +239,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoice",inputSchema: {- salesInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesInvoice(ctx.client, params.salesInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoice")+ }, "Failed: invoicing_getSalesInvoice"),);server.registerTool(@@ -297,17 +254,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoice customer details",inputSchema: {- salesInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesInvoiceCustomerDetails(- ctx.client,- params.salesInvoiceId- );+ const result = await getSalesInvoiceCustomerDetails(ctx.client, params.salesInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoiceCustomerDetails")+ }, "Failed: invoicing_getSalesInvoiceCustomerDetails"),);server.registerTool(@@ -315,23 +269,19 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoices",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- customerId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ customerId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesInvoices(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSalesInvoices(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoices")+ }, "Failed: invoicing_getSalesInvoices"),);server.registerTool(@@ -339,17 +289,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoice shipment",inputSchema: {- salesInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesInvoiceShipment(- ctx.client,- params.salesInvoiceId- );+ const result = await getSalesInvoiceShipment(ctx.client, params.salesInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoiceShipment")+ }, "Failed: invoicing_getSalesInvoiceShipment"),);server.registerTool(@@ -357,17 +304,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoice lines",inputSchema: {- salesInvoiceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesInvoiceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesInvoiceLines(- ctx.client,- params.salesInvoiceId- );+ const result = await getSalesInvoiceLines(ctx.client, params.salesInvoiceId);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoiceLines")+ }, "Failed: invoicing_getSalesInvoiceLines"),);server.registerTool(@@ -375,17 +319,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "get sales invoice line",inputSchema: {- salesInvoiceLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesInvoiceLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesInvoiceLine(- ctx.client,- params.salesInvoiceLineId- );+ const result = await getSalesInvoiceLine(ctx.client, params.salesInvoiceLineId);return toMcpResult(result);- }, "Failed: invoicing_getSalesInvoiceLine")+ }, "Failed: invoicing_getSalesInvoiceLine"),);server.registerTool(@@ -393,20 +334,17 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "update purchase invoice exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseInvoiceExchangeRate(- ctx.client,- params.data- );+ const result = await updatePurchaseInvoiceExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: invoicing_updatePurchaseInvoiceExchangeRate")+ }, "Failed: invoicing_updatePurchaseInvoiceExchangeRate"),);server.registerTool(@@ -414,21 +352,18 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "update purchase invoice status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseInvoiceStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updatePurchaseInvoiceStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_updatePurchaseInvoiceStatus")+ }, "Failed: invoicing_updatePurchaseInvoiceStatus"),);server.registerTool(@@ -436,20 +371,17 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "update sales invoice exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesInvoiceExchangeRate(- ctx.client,- params.data- );+ const result = await updateSalesInvoiceExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: invoicing_updateSalesInvoiceExchangeRate")+ }, "Failed: invoicing_updateSalesInvoiceExchangeRate"),);server.registerTool(@@ -457,21 +389,18 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "update sales invoice status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesInvoiceStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateSalesInvoiceStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_updateSalesInvoiceStatus")+ }, "Failed: invoicing_updateSalesInvoiceStatus"),);server.registerTool(@@ -479,19 +408,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase invoice",inputSchema: {- purchaseInvoice: purchaseInvoiceValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseInvoice: purchaseInvoiceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseInvoice(ctx.client, {- ...params.purchaseInvoice,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseInvoice(ctx.client, { ...params.purchaseInvoice, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertPurchaseInvoice")+ }, "Failed: invoicing_upsertPurchaseInvoice"),);server.registerTool(@@ -499,19 +423,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase invoice delivery",inputSchema: {- purchaseInvoiceDelivery: purchaseInvoiceDeliveryValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseInvoiceDelivery: purchaseInvoiceDeliveryValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseInvoiceDelivery(ctx.client, {- ...params.purchaseInvoiceDelivery,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseInvoiceDelivery(ctx.client, { ...params.purchaseInvoiceDelivery, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertPurchaseInvoiceDelivery")+ }, "Failed: invoicing_upsertPurchaseInvoiceDelivery"),);server.registerTool(@@ -519,19 +438,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase invoice line",inputSchema: {- purchaseInvoiceLine: purchaseInvoiceLineValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseInvoiceLine: purchaseInvoiceLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseInvoiceLine(ctx.client, {- ...params.purchaseInvoiceLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseInvoiceLine(ctx.client, { ...params.purchaseInvoiceLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertPurchaseInvoiceLine")+ }, "Failed: invoicing_upsertPurchaseInvoiceLine"),);server.registerTool(@@ -539,19 +453,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert sales invoice",inputSchema: {- salesInvoice: salesInvoiceValidator- },- annotations: WRITE_ANNOTATIONS+ salesInvoice: salesInvoiceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesInvoice(ctx.client, {- ...params.salesInvoice,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesInvoice(ctx.client, { ...params.salesInvoice, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertSalesInvoice")+ }, "Failed: invoicing_upsertSalesInvoice"),);server.registerTool(@@ -559,19 +468,14 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert sales invoice shipment",inputSchema: {- salesInvoiceShipment: salesInvoiceShipmentValidator- },- annotations: WRITE_ANNOTATIONS+ salesInvoiceShipment: salesInvoiceShipmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesInvoiceShipment(ctx.client, {- ...params.salesInvoiceShipment,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesInvoiceShipment(ctx.client, { ...params.salesInvoiceShipment, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertSalesInvoiceShipment")+ }, "Failed: invoicing_upsertSalesInvoiceShipment"),);server.registerTool(@@ -579,18 +483,13 @@ export const registerInvoicingTools: RegisterTools = (server, ctx) => {{description: "upsert sales invoice line",inputSchema: {- salesInvoiceLine: salesInvoiceLineValidator- },- annotations: WRITE_ANNOTATIONS+ salesInvoiceLine: salesInvoiceLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesInvoiceLine(ctx.client, {- ...params.salesInvoiceLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesInvoiceLine(ctx.client, { ...params.salesInvoiceLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: invoicing_upsertSalesInvoiceLine")+ }, "Failed: invoicing_upsertSalesInvoiceLine"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/items.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/items.tsindex d9eb2b2882..d23e041113 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/items.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/items.ts@@ -1,59 +1,34 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- configurationParameterGroupOrderValidator,- configurationParameterOrderValidator,- configurationParameterValidator,- configurationRuleValidator,- consumableValidator,- customerPartValidator,- getMethodValidator,- itemCostValidator,- itemManufacturingValidator,- itemPlanningValidator,- itemPostingGroupValidator,- itemPurchasingValidator,- itemUnitSalePriceValidator,- itemValidator,- makeMethodVersionValidator,- materialDimensionValidator,- materialFinishValidator,- materialFormValidator,- materialGradeValidator,- materialSubstanceValidator,- materialTypeValidator,- materialValidator,- methodMaterialValidator,- methodOperationValidator,- partValidator,- pickMethodValidator,- serviceValidator,- supplierPartValidator,- toolValidator,- unitOfMeasureValidator-} from "~/modules/items/items.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {activateMethodVersion,- assertMethodOperationIsDraft,copyItem,copyMakeMethod,createRevision,deleteConfigurationParameter,- deleteConfigurationParameterGroup,deleteConfigurationRule,- deleteItem,deleteItemCustomerPart,+ deleteConfigurationParameterGroup,+ deleteItem,deleteItemPostingGroup,deleteMaterialDimension,deleteMaterialFinish,deleteMaterialForm,deleteMaterialGrade,deleteMaterialSubstance,- deleteMaterialType,deleteMethodMaterial,- deleteMethodOperationParameter,+ assertMethodOperationIsDraft,deleteMethodOperationStep,+ deleteMethodOperationParameter,deleteMethodOperationTool,deleteUnitOfMeasure,getConfigurationParameters,@@ -68,40 +43,37 @@ import {getItemCustomerParts,getItemDemand,getItemFiles,- getItemManufacturing,- getItemPlanning,getItemPostingGroup,getItemPostingGroups,getItemPostingGroupsList,+ getItemManufacturing,+ getItemPlanning,getItemQuantities,getItemReplenishment,getItemShelfQuantities,getItemSupply,getItemUnitSalePrice,- getMakeMethodById,+ getMaterialUsedIn,getMakeMethods,+ getMakeMethodById,getMaterial,+ getMaterials,+ getMaterialsList,getMaterialDimension,- getMaterialDimensionList,getMaterialDimensions,+ getMaterialDimensionList,getMaterialFinish,getMaterialFinishes,getMaterialFinishList,getMaterialForm,getMaterialForms,getMaterialFormsList,+ getMaterialGrades,getMaterialGrade,getMaterialGradeList,- getMaterialGrades,getMaterialSubstance,getMaterialSubstances,getMaterialSubstancesList,- getMaterials,- getMaterialsList,- getMaterialType,- getMaterialTypeList,- getMaterialTypes,- getMaterialUsedIn,getMethodMaterial,getMethodMaterials,getMethodMaterialsByMakeMethod,@@ -119,23 +91,19 @@ import {getPartUsedIn,getPickMethod,getPickMethods,- getService,getServices,+ getService,getServicesList,- getSupplierPartPriceBreaks,getSupplierParts,- getSupplierPriceBreaksForItems,getTool,getTools,getToolsList,getUnitOfMeasure,getUnitOfMeasures,getUnitOfMeasuresList,- lookupBuyPrice,updateConfigurationParameterGroupOrder,- updateConfigurationParameterOrder,updateDefaultRevision,- updateItem,+ updateConfigurationParameterOrder,updateItemCost,updateMaterialOrder,updateOperationOrder,@@ -144,46 +112,78 @@ import {upsertConfigurationParameterGroup,upsertConfigurationRule,upsertConsumable,+ upsertPart,+ updateItem,upsertItemCost,- upsertItemCustomerPart,+ upsertPickMethod,upsertItemManufacturing,upsertItemPlanning,- upsertItemPostingGroup,upsertItemPurchasing,+ upsertItemPostingGroup,+ upsertSupplierPart,+ upsertItemCustomerPart,upsertItemUnitSalePrice,upsertMakeMethodVersion,+ upsertMethodMaterial,+ upsertMethodOperation,+ upsertMethodOperationStep,+ upsertMethodOperationParameter,+ upsertMethodOperationTool,upsertMaterial,upsertMaterialDimension,upsertMaterialFinish,upsertMaterialForm,upsertMaterialGrade,- upsertMaterialSubstance,+ deleteMaterialType,+ getMaterialTypes,+ getMaterialType,+ getMaterialTypeList,upsertMaterialType,- upsertMethodMaterial,- upsertMethodOperation,- upsertMethodOperationParameter,- upsertMethodOperationStep,- upsertMethodOperationTool,- upsertPart,- upsertPickMethod,+ upsertMaterialSubstance,upsertService,- upsertSupplierPart,+ upsertUnitOfMeasure,upsertTool,- upsertUnitOfMeasure+ getSupplierPriceBreaksForItems,+ lookupBuyPrice,+ getSupplierPartPriceBreaks,} from "~/modules/items/items.service";import {- operationParameterValidator,+ getMethodValidator,+ configurationParameterGroupOrderValidator,+ configurationParameterOrderValidator,+ configurationParameterValidator,+ configurationRuleValidator,+ consumableValidator,+ partValidator,+ itemValidator,+ itemCostValidator,+ pickMethodValidator,+ itemManufacturingValidator,+ itemPlanningValidator,+ itemPurchasingValidator,+ itemPostingGroupValidator,+ supplierPartValidator,+ customerPartValidator,+ itemUnitSalePriceValidator,+ makeMethodVersionValidator,+ methodMaterialValidator,+ methodOperationValidator,+ materialValidator,+ materialDimensionValidator,+ materialFinishValidator,+ materialFormValidator,+ materialGradeValidator,+ materialTypeValidator,+ materialSubstanceValidator,+ serviceValidator,+ unitOfMeasureValidator,+ toolValidator,+} from "~/modules/items/items.models";+import {operationStepValidator,- operationToolValidator+ operationParameterValidator,+ operationToolValidator,} from "~/modules/shared";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerItemsTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -191,20 +191,16 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "activate method version",inputSchema: {- payload: z.object({- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ payload: z.object({+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await activateMethodVersion(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await activateMethodVersion(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: items_activateMethodVersion")+ }, "Failed: items_activateMethodVersion"),);server.registerTool(@@ -212,18 +208,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "copy item",inputSchema: {- args: getMethodValidator- },- annotations: WRITE_ANNOTATIONS+ args: getMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await copyItem(ctx.client, {- ...params.args,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await copyItem(ctx.client, { ...params.args, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: items_copyItem")+ }, "Failed: items_copyItem"),);server.registerTool(@@ -231,18 +223,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "copy make method",inputSchema: {- args: getMethodValidator- },- annotations: WRITE_ANNOTATIONS+ args: getMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await copyMakeMethod(ctx.client, {- ...params.args,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await copyMakeMethod(ctx.client, { ...params.args, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: items_copyMakeMethod")+ }, "Failed: items_copyMakeMethod"),);server.registerTool(@@ -250,20 +238,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "create revision",inputSchema: {- args: z.object({- item: z.any(),- revision: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ item: z.any(),+ revision: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await createRevision(ctx.client, {- ...params.args,- createdBy: ctx.userId- });+ const result = await createRevision(ctx.client, { ...params.args, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_createRevision")+ }, "Failed: items_createRevision"),);server.registerTool(@@ -271,14 +256,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete configuration parameter",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteConfigurationParameter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteConfigurationParameter")+ }, "Failed: items_deleteConfigurationParameter"),);server.registerTool(@@ -286,19 +271,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete configuration rule",inputSchema: {- field: z.string(),- itemId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ field: z.string(),+ itemId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteConfigurationRule(- ctx.client,- params.field,- params.itemId- );+ const result = await deleteConfigurationRule(ctx.client, params.field, params.itemId);return toMcpResult(result);- }, "Failed: items_deleteConfigurationRule")+ }, "Failed: items_deleteConfigurationRule"),);server.registerTool(@@ -306,18 +287,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete item customer part",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteItemCustomerPart(- ctx.client,- params.id,- ctx.companyId- );+ const result = await deleteItemCustomerPart(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_deleteItemCustomerPart")+ }, "Failed: items_deleteItemCustomerPart"),);server.registerTool(@@ -325,17 +302,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete configuration parameter group",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteConfigurationParameterGroup(- ctx.client,- params.id- );+ const result = await deleteConfigurationParameterGroup(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteConfigurationParameterGroup")+ }, "Failed: items_deleteConfigurationParameterGroup"),);server.registerTool(@@ -343,14 +317,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete item",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteItem(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteItem")+ }, "Failed: items_deleteItem"),);server.registerTool(@@ -358,14 +332,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete item posting group",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteItemPostingGroup(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteItemPostingGroup")+ }, "Failed: items_deleteItemPostingGroup"),);server.registerTool(@@ -373,14 +347,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material dimension",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialDimension(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialDimension")+ }, "Failed: items_deleteMaterialDimension"),);server.registerTool(@@ -388,14 +362,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material finish",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialFinish(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialFinish")+ }, "Failed: items_deleteMaterialFinish"),);server.registerTool(@@ -403,14 +377,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material form",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialForm(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialForm")+ }, "Failed: items_deleteMaterialForm"),);server.registerTool(@@ -418,14 +392,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material grade",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialGrade(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialGrade")+ }, "Failed: items_deleteMaterialGrade"),);server.registerTool(@@ -433,14 +407,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material substance",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialSubstance(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialSubstance")+ }, "Failed: items_deleteMaterialSubstance"),);server.registerTool(@@ -448,14 +422,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete method material",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMethodMaterial(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMethodMaterial")+ }, "Failed: items_deleteMethodMaterial"),);server.registerTool(@@ -463,17 +437,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "assert method operation is draft",inputSchema: {- operationId: z.string()- },- annotations: WRITE_ANNOTATIONS+ operationId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await assertMethodOperationIsDraft(- ctx.client,- params.operationId- );+ const result = await assertMethodOperationIsDraft(ctx.client, params.operationId);return toMcpResult(result);- }, "Failed: items_assertMethodOperationIsDraft")+ }, "Failed: items_assertMethodOperationIsDraft"),);server.registerTool(@@ -481,14 +452,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete method operation step",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMethodOperationStep(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMethodOperationStep")+ }, "Failed: items_deleteMethodOperationStep"),);server.registerTool(@@ -496,17 +467,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete method operation parameter",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMethodOperationParameter(- ctx.client,- params.id- );+ const result = await deleteMethodOperationParameter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMethodOperationParameter")+ }, "Failed: items_deleteMethodOperationParameter"),);server.registerTool(@@ -514,14 +482,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete method operation tool",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMethodOperationTool(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMethodOperationTool")+ }, "Failed: items_deleteMethodOperationTool"),);server.registerTool(@@ -529,14 +497,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete unit of measure",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteUnitOfMeasure(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteUnitOfMeasure")+ }, "Failed: items_deleteUnitOfMeasure"),);server.registerTool(@@ -544,18 +512,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get configuration parameters",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConfigurationParameters(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getConfigurationParameters(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getConfigurationParameters")+ }, "Failed: items_getConfigurationParameters"),);server.registerTool(@@ -563,18 +527,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get configuration rules",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConfigurationRules(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getConfigurationRules(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getConfigurationRules")+ }, "Failed: items_getConfigurationRules"),);server.registerTool(@@ -582,18 +542,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get consumable",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConsumable(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getConsumable(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getConsumable")+ }, "Failed: items_getConsumable"),);server.registerTool(@@ -601,23 +557,19 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get consumables",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConsumables(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getConsumables(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getConsumables")+ }, "Failed: items_getConsumables"),);server.registerTool(@@ -625,12 +577,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get consumables list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getConsumablesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getConsumablesList")+ }, "Failed: items_getConsumablesList"),);server.registerTool(@@ -638,14 +590,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getItem(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getItem")+ }, "Failed: items_getItem"),);server.registerTool(@@ -653,18 +605,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item cost",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemCost(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getItemCost(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemCost")+ }, "Failed: items_getItemCost"),);server.registerTool(@@ -672,18 +620,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item cost history",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemCostHistory(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getItemCostHistory(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemCostHistory")+ }, "Failed: items_getItemCostHistory"),);server.registerTool(@@ -691,18 +635,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item customer part",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemCustomerPart(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getItemCustomerPart(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemCustomerPart")+ }, "Failed: items_getItemCustomerPart"),);server.registerTool(@@ -710,18 +650,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item customer parts",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemCustomerParts(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getItemCustomerParts(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemCustomerParts")+ }, "Failed: items_getItemCustomerParts"),);server.registerTool(@@ -729,21 +665,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item demand",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string(),- periods: z.array(z.string())- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string(),+ periods: z.array(z.string())+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemDemand(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getItemDemand(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getItemDemand")+ }, "Failed: items_getItemDemand"),);server.registerTool(@@ -751,18 +684,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item files",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemFiles(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getItemFiles(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemFiles")+ }, "Failed: items_getItemFiles"),);server.registerTool(@@ -770,14 +699,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item posting group",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getItemPostingGroup(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getItemPostingGroup")+ }, "Failed: items_getItemPostingGroup"),);server.registerTool(@@ -785,24 +714,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item posting groups",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemPostingGroups(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getItemPostingGroups(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getItemPostingGroups")+ }, "Failed: items_getItemPostingGroups"),);server.registerTool(@@ -810,12 +733,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item posting groups list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getItemPostingGroupsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemPostingGroupsList")+ }, "Failed: items_getItemPostingGroupsList"),);server.registerTool(@@ -823,18 +746,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item manufacturing",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemManufacturing(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getItemManufacturing(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemManufacturing")+ }, "Failed: items_getItemManufacturing"),);server.registerTool(@@ -842,20 +761,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item planning",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemPlanning(- ctx.client,- params.itemId,- ctx.companyId,- params.locationId- );+ const result = await getItemPlanning(ctx.client, params.itemId, ctx.companyId, params.locationId);return toMcpResult(result);- }, "Failed: items_getItemPlanning")+ }, "Failed: items_getItemPlanning"),);server.registerTool(@@ -863,20 +777,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item quantities",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemQuantities(- ctx.client,- params.itemId,- ctx.companyId,- params.locationId- );+ const result = await getItemQuantities(ctx.client, params.itemId, ctx.companyId, params.locationId);return toMcpResult(result);- }, "Failed: items_getItemQuantities")+ }, "Failed: items_getItemQuantities"),);server.registerTool(@@ -884,18 +793,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item replenishment",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemReplenishment(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getItemReplenishment(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemReplenishment")+ }, "Failed: items_getItemReplenishment"),);server.registerTool(@@ -903,20 +808,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item shelf quantities",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemShelfQuantities(- ctx.client,- params.itemId,- ctx.companyId,- params.locationId- );+ const result = await getItemShelfQuantities(ctx.client, params.itemId, ctx.companyId, params.locationId);return toMcpResult(result);- }, "Failed: items_getItemShelfQuantities")+ }, "Failed: items_getItemShelfQuantities"),);server.registerTool(@@ -924,21 +824,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item supply",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string(),- periods: z.array(z.string())- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string(),+ periods: z.array(z.string())+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemSupply(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getItemSupply(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getItemSupply")+ }, "Failed: items_getItemSupply"),);server.registerTool(@@ -946,18 +843,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get item unit sale price",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getItemUnitSalePrice(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getItemUnitSalePrice(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getItemUnitSalePrice")+ }, "Failed: items_getItemUnitSalePrice"),);server.registerTool(@@ -965,18 +858,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material used in",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialUsedIn(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getMaterialUsedIn(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialUsedIn")+ }, "Failed: items_getMaterialUsedIn"),);server.registerTool(@@ -984,18 +873,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get make methods",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMakeMethods(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getMakeMethods(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMakeMethods")+ }, "Failed: items_getMakeMethods"),);server.registerTool(@@ -1003,18 +888,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get make method by id",inputSchema: {- makeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ makeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMakeMethodById(- ctx.client,- params.makeMethodId,- ctx.companyId- );+ const result = await getMakeMethodById(ctx.client, params.makeMethodId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMakeMethodById")+ }, "Failed: items_getMakeMethodById"),);server.registerTool(@@ -1022,18 +903,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterial(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getMaterial(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterial")+ }, "Failed: items_getMaterial"),);server.registerTool(@@ -1041,19 +918,19 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get materials",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterials(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterials")+ }, "Failed: items_getMaterials"),);server.registerTool(@@ -1061,12 +938,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get materials list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialsList")+ }, "Failed: items_getMaterialsList"),);server.registerTool(@@ -1074,14 +951,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material dimension",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialDimension(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialDimension")+ }, "Failed: items_getMaterialDimension"),);server.registerTool(@@ -1089,25 +966,19 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material dimensions",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- isMetric: z.boolean()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ isMetric: z.boolean()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialDimensions(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialDimensions(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialDimensions")+ }, "Failed: items_getMaterialDimensions"),);server.registerTool(@@ -1115,20 +986,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material dimension list",inputSchema: {- materialFormId: z.string(),- isMetric: z.boolean()- },- annotations: READ_ONLY_ANNOTATIONS+ materialFormId: z.string(),+ isMetric: z.boolean(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialDimensionList(- ctx.client,- params.materialFormId,- params.isMetric,- ctx.companyId- );+ const result = await getMaterialDimensionList(ctx.client, params.materialFormId, params.isMetric, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialDimensionList")+ }, "Failed: items_getMaterialDimensionList"),);server.registerTool(@@ -1136,14 +1002,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material finish",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialFinish(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialFinish")+ }, "Failed: items_getMaterialFinish"),);server.registerTool(@@ -1151,24 +1017,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material finishes",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialFinishes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialFinishes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialFinishes")+ }, "Failed: items_getMaterialFinishes"),);server.registerTool(@@ -1176,18 +1036,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material finish list",inputSchema: {- materialSubstanceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialSubstanceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialFinishList(- ctx.client,- params.materialSubstanceId,- ctx.companyId- );+ const result = await getMaterialFinishList(ctx.client, params.materialSubstanceId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialFinishList")+ }, "Failed: items_getMaterialFinishList"),);server.registerTool(@@ -1195,14 +1051,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material form",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialForm(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialForm")+ }, "Failed: items_getMaterialForm"),);server.registerTool(@@ -1210,24 +1066,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material forms",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialForms(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialForms(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialForms")+ }, "Failed: items_getMaterialForms"),);server.registerTool(@@ -1235,12 +1085,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material forms list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialFormsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialFormsList")+ }, "Failed: items_getMaterialFormsList"),);server.registerTool(@@ -1248,24 +1098,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material grades",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialGrades(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialGrades(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialGrades")+ }, "Failed: items_getMaterialGrades"),);server.registerTool(@@ -1273,14 +1117,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material grade",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialGrade(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialGrade")+ }, "Failed: items_getMaterialGrade"),);server.registerTool(@@ -1288,18 +1132,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material grade list",inputSchema: {- materialSubstanceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialSubstanceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialGradeList(- ctx.client,- params.materialSubstanceId,- ctx.companyId- );+ const result = await getMaterialGradeList(ctx.client, params.materialSubstanceId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialGradeList")+ }, "Failed: items_getMaterialGradeList"),);server.registerTool(@@ -1307,14 +1147,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material substance",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialSubstance(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialSubstance")+ }, "Failed: items_getMaterialSubstance"),);server.registerTool(@@ -1322,24 +1162,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material substances",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialSubstances(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialSubstances(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialSubstances")+ }, "Failed: items_getMaterialSubstances"),);server.registerTool(@@ -1347,12 +1181,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material substances list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialSubstancesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialSubstancesList")+ }, "Failed: items_getMaterialSubstancesList"),);server.registerTool(@@ -1360,14 +1194,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method material",inputSchema: {- materialId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMethodMaterial(ctx.client, params.materialId);return toMcpResult(result);- }, "Failed: items_getMethodMaterial")+ }, "Failed: items_getMethodMaterial"),);server.registerTool(@@ -1375,24 +1209,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method materials",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMethodMaterials(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMethodMaterials(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMethodMaterials")+ }, "Failed: items_getMethodMaterials"),);server.registerTool(@@ -1400,17 +1228,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method materials by make method",inputSchema: {- makeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ makeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMethodMaterialsByMakeMethod(- ctx.client,- params.makeMethodId- );+ const result = await getMethodMaterialsByMakeMethod(ctx.client, params.makeMethodId);return toMcpResult(result);- }, "Failed: items_getMethodMaterialsByMakeMethod")+ }, "Failed: items_getMethodMaterialsByMakeMethod"),);server.registerTool(@@ -1418,24 +1243,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method operations",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMethodOperations(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMethodOperations(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMethodOperations")+ }, "Failed: items_getMethodOperations"),);server.registerTool(@@ -1443,17 +1262,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method operations by make method id",inputSchema: {- makeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ makeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMethodOperationsByMakeMethodId(- ctx.client,- params.makeMethodId- );+ const result = await getMethodOperationsByMakeMethodId(ctx.client, params.makeMethodId);return toMcpResult(result);- }, "Failed: items_getMethodOperationsByMakeMethodId")+ }, "Failed: items_getMethodOperationsByMakeMethodId"),);server.registerTool(@@ -1461,14 +1277,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method tree",inputSchema: {- makeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ makeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMethodTree(ctx.client, params.makeMethodId);return toMcpResult(result);- }, "Failed: items_getMethodTree")+ }, "Failed: items_getMethodTree"),);server.registerTool(@@ -1476,14 +1292,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get method tree array",inputSchema: {- makeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ makeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMethodTreeArray(ctx.client, params.makeMethodId);return toMcpResult(result);- }, "Failed: items_getMethodTreeArray")+ }, "Failed: items_getMethodTreeArray"),);server.registerTool(@@ -1491,20 +1307,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get open job materials",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpenJobMaterials(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getOpenJobMaterials(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getOpenJobMaterials")+ }, "Failed: items_getOpenJobMaterials"),);server.registerTool(@@ -1512,20 +1325,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get open production orders",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpenProductionOrders(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getOpenProductionOrders(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getOpenProductionOrders")+ }, "Failed: items_getOpenProductionOrders"),);server.registerTool(@@ -1533,20 +1343,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get open purchase order lines",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpenPurchaseOrderLines(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getOpenPurchaseOrderLines(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getOpenPurchaseOrderLines")+ }, "Failed: items_getOpenPurchaseOrderLines"),);server.registerTool(@@ -1554,20 +1361,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get open sales order lines",inputSchema: {- arg1: z.object({- itemId: z.string(),- locationId: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ itemId: z.string(),+ locationId: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpenSalesOrderLines(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await getOpenSalesOrderLines(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_getOpenSalesOrderLines")+ }, "Failed: items_getOpenSalesOrderLines"),);server.registerTool(@@ -1575,14 +1379,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get part",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPart(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getPart")+ }, "Failed: items_getPart"),);server.registerTool(@@ -1590,19 +1394,19 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get parts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getParts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getParts")+ }, "Failed: items_getParts"),);server.registerTool(@@ -1610,12 +1414,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get parts list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPartsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getPartsList")+ }, "Failed: items_getPartsList"),);server.registerTool(@@ -1623,18 +1427,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get part used in",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPartUsedIn(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getPartUsedIn(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getPartUsedIn")+ }, "Failed: items_getPartUsedIn"),);server.registerTool(@@ -1642,20 +1442,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get pick method",inputSchema: {- itemId: z.string(),- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPickMethod(- ctx.client,- params.itemId,- ctx.companyId,- params.locationId- );+ const result = await getPickMethod(ctx.client, params.itemId, ctx.companyId, params.locationId);return toMcpResult(result);- }, "Failed: items_getPickMethod")+ }, "Failed: items_getPickMethod"),);server.registerTool(@@ -1663,18 +1458,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get pick methods",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPickMethods(- ctx.client,- params.itemId,- ctx.companyId- );+ const result = await getPickMethods(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getPickMethods")+ }, "Failed: items_getPickMethods"),);server.registerTool(@@ -1682,21 +1473,21 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get services",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- type: z.string().nullable(),- group: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ type: z.string().nullable(),+ group: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getServices(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getServices")+ }, "Failed: items_getServices"),);server.registerTool(@@ -1704,14 +1495,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get service",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getService(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getService")+ }, "Failed: items_getService"),);server.registerTool(@@ -1719,12 +1510,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get services list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getServicesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getServicesList")+ }, "Failed: items_getServicesList"),);server.registerTool(@@ -1732,18 +1523,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get supplier parts",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierParts(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getSupplierParts(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getSupplierParts")+ }, "Failed: items_getSupplierParts"),);server.registerTool(@@ -1751,14 +1538,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get tool",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTool(ctx.client, params.itemId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getTool")+ }, "Failed: items_getTool"),);server.registerTool(@@ -1766,19 +1553,19 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get tools",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTools(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getTools")+ }, "Failed: items_getTools"),);server.registerTool(@@ -1786,12 +1573,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get tools list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getToolsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getToolsList")+ }, "Failed: items_getToolsList"),);server.registerTool(@@ -1799,18 +1586,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get unit of measure",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getUnitOfMeasure(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getUnitOfMeasure(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getUnitOfMeasure")+ }, "Failed: items_getUnitOfMeasure"),);server.registerTool(@@ -1818,22 +1601,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get unit of measures",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getUnitOfMeasures(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getUnitOfMeasures(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getUnitOfMeasures")+ }, "Failed: items_getUnitOfMeasures"),);server.registerTool(@@ -1841,12 +1620,12 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get unit of measures list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getUnitOfMeasuresList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getUnitOfMeasuresList")+ }, "Failed: items_getUnitOfMeasuresList"),);server.registerTool(@@ -1854,17 +1633,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update configuration parameter group order",inputSchema: {- data: configurationParameterGroupOrderValidator- },- annotations: WRITE_ANNOTATIONS+ data: configurationParameterGroupOrderValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateConfigurationParameterGroupOrder(- ctx.client,- params.data- );+ const result = await updateConfigurationParameterGroupOrder(ctx.client, params.data);return toMcpResult(result);- }, "Failed: items_updateConfigurationParameterGroupOrder")+ }, "Failed: items_updateConfigurationParameterGroupOrder"),);server.registerTool(@@ -1872,19 +1648,16 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update default revision",inputSchema: {- data: z.object({- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDefaultRevision(ctx.client, {- ...params.data,- updatedBy: ctx.userId- });+ const result = await updateDefaultRevision(ctx.client, { ...params.data, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateDefaultRevision")+ }, "Failed: items_updateDefaultRevision"),);server.registerTool(@@ -1892,17 +1665,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update configuration parameter order",inputSchema: {- data: configurationParameterOrderValidator- },- annotations: WRITE_ANNOTATIONS+ data: configurationParameterOrderValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateConfigurationParameterOrder(ctx.client, {- ...params.data,- updatedBy: ctx.userId- });+ const result = await updateConfigurationParameterOrder(ctx.client, { ...params.data, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateConfigurationParameterOrder")+ }, "Failed: items_updateConfigurationParameterOrder"),);server.registerTool(@@ -1910,20 +1680,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update item cost",inputSchema: {- itemId: z.string(),- cost: z.object({- unitCost: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ itemId: z.string(),+ cost: z.object({+ unitCost: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateItemCost(ctx.client, params.itemId, {- ...params.cost,- updatedBy: ctx.userId- });+ const result = await updateItemCost(ctx.client, params.itemId, { ...params.cost, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateItemCost")+ }, "Failed: items_updateItemCost"),);server.registerTool(@@ -1931,20 +1698,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update material order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMaterialOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateMaterialOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateMaterialOrder")+ }, "Failed: items_updateMaterialOrder"),);server.registerTool(@@ -1952,20 +1716,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update operation order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateOperationOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateOperationOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateOperationOrder")+ }, "Failed: items_updateOperationOrder"),);server.registerTool(@@ -1973,20 +1734,17 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update revision",inputSchema: {- revision: z.object({- id: z.string(),- revision: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ revision: z.object({+ id: z.string(),+ revision: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateRevision(ctx.client, {- ...params.revision,- updatedBy: ctx.userId- });+ const result = await updateRevision(ctx.client, { ...params.revision, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_updateRevision")+ }, "Failed: items_updateRevision"),);server.registerTool(@@ -1994,18 +1752,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert configuration parameter",inputSchema: {- configurationParameter: configurationParameterValidator- },- annotations: WRITE_ANNOTATIONS+ configurationParameter: configurationParameterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertConfigurationParameter(ctx.client, {- ...params.configurationParameter,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertConfigurationParameter(ctx.client, { ...params.configurationParameter, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertConfigurationParameter")+ }, "Failed: items_upsertConfigurationParameter"),);server.registerTool(@@ -2013,17 +1767,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert configuration parameter group",inputSchema: {- configurationParameterGroup: z.any()- },- annotations: WRITE_ANNOTATIONS+ configurationParameterGroup: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertConfigurationParameterGroup(ctx.client, {- ...params.configurationParameterGroup,- companyId: ctx.companyId- });+ const result = await upsertConfigurationParameterGroup(ctx.client, { ...params.configurationParameterGroup, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertConfigurationParameterGroup")+ }, "Failed: items_upsertConfigurationParameterGroup"),);server.registerTool(@@ -2031,18 +1782,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert configuration rule",inputSchema: {- configurationRule: configurationRuleValidator- },- annotations: WRITE_ANNOTATIONS+ configurationRule: configurationRuleValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertConfigurationRule(ctx.client, {- ...params.configurationRule,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await upsertConfigurationRule(ctx.client, { ...params.configurationRule, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertConfigurationRule")+ }, "Failed: items_upsertConfigurationRule"),);server.registerTool(@@ -2050,19 +1797,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert consumable",inputSchema: {- consumable: consumableValidator- },- annotations: WRITE_ANNOTATIONS+ consumable: consumableValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertConsumable(ctx.client, {- ...params.consumable,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertConsumable(ctx.client, { ...params.consumable, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertConsumable")+ }, "Failed: items_upsertConsumable"),);server.registerTool(@@ -2070,19 +1812,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert part",inputSchema: {- part: partValidator- },- annotations: WRITE_ANNOTATIONS+ part: partValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPart(ctx.client, {- ...params.part,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPart(ctx.client, { ...params.part, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertPart")+ }, "Failed: items_upsertPart"),);server.registerTool(@@ -2090,17 +1827,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "update item",inputSchema: {- item: itemValidator- },- annotations: WRITE_ANNOTATIONS+ item: itemValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateItem(ctx.client, {- ...params.item,- companyId: ctx.companyId- });+ const result = await updateItem(ctx.client, { ...params.item, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_updateItem")+ }, "Failed: items_updateItem"),);server.registerTool(@@ -2108,17 +1842,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item cost",inputSchema: {- itemCost: itemCostValidator- },- annotations: WRITE_ANNOTATIONS+ itemCost: itemCostValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemCost(ctx.client, {- ...params.itemCost,- updatedBy: ctx.userId- });+ const result = await upsertItemCost(ctx.client, { ...params.itemCost, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemCost")+ }, "Failed: items_upsertItemCost"),);server.registerTool(@@ -2126,19 +1857,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert pick method",inputSchema: {- pickMethod: pickMethodValidator- },- annotations: WRITE_ANNOTATIONS+ pickMethod: pickMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPickMethod(ctx.client, {- ...params.pickMethod,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPickMethod(ctx.client, { ...params.pickMethod, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertPickMethod")+ }, "Failed: items_upsertPickMethod"),);server.registerTool(@@ -2146,17 +1872,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item manufacturing",inputSchema: {- partManufacturing: itemManufacturingValidator- },- annotations: WRITE_ANNOTATIONS+ partManufacturing: itemManufacturingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemManufacturing(ctx.client, {- ...params.partManufacturing,- updatedBy: ctx.userId- });+ const result = await upsertItemManufacturing(ctx.client, { ...params.partManufacturing, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemManufacturing")+ }, "Failed: items_upsertItemManufacturing"),);server.registerTool(@@ -2164,19 +1887,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item planning",inputSchema: {- partPlanning: itemPlanningValidator- },- annotations: WRITE_ANNOTATIONS+ partPlanning: itemPlanningValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemPlanning(ctx.client, {- ...params.partPlanning,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertItemPlanning(ctx.client, { ...params.partPlanning, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemPlanning")+ }, "Failed: items_upsertItemPlanning"),);server.registerTool(@@ -2184,17 +1902,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item purchasing",inputSchema: {- itemPurchasing: itemPurchasingValidator- },- annotations: WRITE_ANNOTATIONS+ itemPurchasing: itemPurchasingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemPurchasing(ctx.client, {- ...params.itemPurchasing,- updatedBy: ctx.userId- });+ const result = await upsertItemPurchasing(ctx.client, { ...params.itemPurchasing, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemPurchasing")+ }, "Failed: items_upsertItemPurchasing"),);server.registerTool(@@ -2202,19 +1917,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item posting group",inputSchema: {- itemPostingGroup: itemPostingGroupValidator- },- annotations: WRITE_ANNOTATIONS+ itemPostingGroup: itemPostingGroupValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemPostingGroup(ctx.client, {- ...params.itemPostingGroup,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertItemPostingGroup(ctx.client, { ...params.itemPostingGroup, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemPostingGroup")+ }, "Failed: items_upsertItemPostingGroup"),);server.registerTool(@@ -2222,19 +1932,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert supplier part",inputSchema: {- supplierPart: supplierPartValidator- },- annotations: WRITE_ANNOTATIONS+ supplierPart: supplierPartValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplierPart(ctx.client, {- ...params.supplierPart,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplierPart(ctx.client, { ...params.supplierPart, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertSupplierPart")+ }, "Failed: items_upsertSupplierPart"),);server.registerTool(@@ -2242,17 +1947,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item customer part",inputSchema: {- customerPart: customerPartValidator- },- annotations: WRITE_ANNOTATIONS+ customerPart: customerPartValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemCustomerPart(ctx.client, {- ...params.customerPart,- companyId: ctx.companyId- });+ const result = await upsertItemCustomerPart(ctx.client, { ...params.customerPart, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertItemCustomerPart")+ }, "Failed: items_upsertItemCustomerPart"),);server.registerTool(@@ -2260,17 +1962,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert item unit sale price",inputSchema: {- itemUnitSalePrice: itemUnitSalePriceValidator- },- annotations: WRITE_ANNOTATIONS+ itemUnitSalePrice: itemUnitSalePriceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertItemUnitSalePrice(ctx.client, {- ...params.itemUnitSalePrice,- updatedBy: ctx.userId- });+ const result = await upsertItemUnitSalePrice(ctx.client, { ...params.itemUnitSalePrice, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertItemUnitSalePrice")+ }, "Failed: items_upsertItemUnitSalePrice"),);server.registerTool(@@ -2278,18 +1977,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert make method version",inputSchema: {- makeMethodVersion: makeMethodVersionValidator- },- annotations: WRITE_ANNOTATIONS+ makeMethodVersion: makeMethodVersionValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMakeMethodVersion(ctx.client, {- ...params.makeMethodVersion,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await upsertMakeMethodVersion(ctx.client, { ...params.makeMethodVersion, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMakeMethodVersion")+ }, "Failed: items_upsertMakeMethodVersion"),);server.registerTool(@@ -2297,19 +1992,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert method material",inputSchema: {- methodMaterial: methodMaterialValidator- },- annotations: WRITE_ANNOTATIONS+ methodMaterial: methodMaterialValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMethodMaterial(ctx.client, {- ...params.methodMaterial,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMethodMaterial(ctx.client, { ...params.methodMaterial, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMethodMaterial")+ }, "Failed: items_upsertMethodMaterial"),);server.registerTool(@@ -2317,19 +2007,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert method operation",inputSchema: {- methodOperation: methodOperationValidator- },- annotations: WRITE_ANNOTATIONS+ methodOperation: methodOperationValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMethodOperation(ctx.client, {- ...params.methodOperation,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMethodOperation(ctx.client, { ...params.methodOperation, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMethodOperation")+ }, "Failed: items_upsertMethodOperation"),);server.registerTool(@@ -2337,19 +2022,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert method operation step",inputSchema: {- methodOperationStep: operationStepValidator- },- annotations: WRITE_ANNOTATIONS+ methodOperationStep: operationStepValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMethodOperationStep(ctx.client, {- ...params.methodOperationStep,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMethodOperationStep(ctx.client, { ...params.methodOperationStep, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMethodOperationStep")+ }, "Failed: items_upsertMethodOperationStep"),);server.registerTool(@@ -2357,19 +2037,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert method operation parameter",inputSchema: {- methodOperationParameter: operationParameterValidator- },- annotations: WRITE_ANNOTATIONS+ methodOperationParameter: operationParameterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMethodOperationParameter(ctx.client, {- ...params.methodOperationParameter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMethodOperationParameter(ctx.client, { ...params.methodOperationParameter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMethodOperationParameter")+ }, "Failed: items_upsertMethodOperationParameter"),);server.registerTool(@@ -2377,19 +2052,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert method operation tool",inputSchema: {- methodOperationTool: operationToolValidator- },- annotations: WRITE_ANNOTATIONS+ methodOperationTool: operationToolValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMethodOperationTool(ctx.client, {- ...params.methodOperationTool,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMethodOperationTool(ctx.client, { ...params.methodOperationTool, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMethodOperationTool")+ }, "Failed: items_upsertMethodOperationTool"),);server.registerTool(@@ -2397,19 +2067,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material",inputSchema: {- material: materialValidator- },- annotations: WRITE_ANNOTATIONS+ material: materialValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterial(ctx.client, {- ...params.material,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaterial(ctx.client, { ...params.material, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMaterial")+ }, "Failed: items_upsertMaterial"),);server.registerTool(@@ -2417,17 +2082,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material dimension",inputSchema: {- materialDimension: materialDimensionValidator- },- annotations: WRITE_ANNOTATIONS+ materialDimension: materialDimensionValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialDimension(ctx.client, {- ...params.materialDimension,- companyId: ctx.companyId- });+ const result = await upsertMaterialDimension(ctx.client, { ...params.materialDimension, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertMaterialDimension")+ }, "Failed: items_upsertMaterialDimension"),);server.registerTool(@@ -2435,17 +2097,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material finish",inputSchema: {- materialFinish: materialFinishValidator- },- annotations: WRITE_ANNOTATIONS+ materialFinish: materialFinishValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialFinish(ctx.client, {- ...params.materialFinish,- companyId: ctx.companyId- });+ const result = await upsertMaterialFinish(ctx.client, { ...params.materialFinish, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertMaterialFinish")+ }, "Failed: items_upsertMaterialFinish"),);server.registerTool(@@ -2453,19 +2112,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material form",inputSchema: {- materialForm: materialFormValidator- },- annotations: WRITE_ANNOTATIONS+ materialForm: materialFormValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialForm(ctx.client, {- ...params.materialForm,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaterialForm(ctx.client, { ...params.materialForm, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMaterialForm")+ }, "Failed: items_upsertMaterialForm"),);server.registerTool(@@ -2473,17 +2127,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material grade",inputSchema: {- materialGrade: materialGradeValidator- },- annotations: WRITE_ANNOTATIONS+ materialGrade: materialGradeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialGrade(ctx.client, {- ...params.materialGrade,- companyId: ctx.companyId- });+ const result = await upsertMaterialGrade(ctx.client, { ...params.materialGrade, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertMaterialGrade")+ }, "Failed: items_upsertMaterialGrade"),);server.registerTool(@@ -2491,14 +2142,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "delete material type",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteMaterialType(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_deleteMaterialType")+ }, "Failed: items_deleteMaterialType"),);server.registerTool(@@ -2506,24 +2157,18 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaterialTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: items_getMaterialTypes")+ }, "Failed: items_getMaterialTypes"),);server.registerTool(@@ -2531,14 +2176,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material type",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getMaterialType(ctx.client, params.id);return toMcpResult(result);- }, "Failed: items_getMaterialType")+ }, "Failed: items_getMaterialType"),);server.registerTool(@@ -2546,20 +2191,15 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get material type list",inputSchema: {- materialSubstanceId: z.string(),- materialFormId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialSubstanceId: z.string(),+ materialFormId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaterialTypeList(- ctx.client,- params.materialSubstanceId,- params.materialFormId,- ctx.companyId- );+ const result = await getMaterialTypeList(ctx.client, params.materialSubstanceId, params.materialFormId, ctx.companyId);return toMcpResult(result);- }, "Failed: items_getMaterialTypeList")+ }, "Failed: items_getMaterialTypeList"),);server.registerTool(@@ -2567,17 +2207,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material type",inputSchema: {- materialType: materialTypeValidator- },- annotations: WRITE_ANNOTATIONS+ materialType: materialTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialType(ctx.client, {- ...params.materialType,- companyId: ctx.companyId- });+ const result = await upsertMaterialType(ctx.client, { ...params.materialType, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: items_upsertMaterialType")+ }, "Failed: items_upsertMaterialType"),);server.registerTool(@@ -2585,19 +2222,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert material substance",inputSchema: {- materialSubstance: materialSubstanceValidator- },- annotations: WRITE_ANNOTATIONS+ materialSubstance: materialSubstanceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaterialSubstance(ctx.client, {- ...params.materialSubstance,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaterialSubstance(ctx.client, { ...params.materialSubstance, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertMaterialSubstance")+ }, "Failed: items_upsertMaterialSubstance"),);server.registerTool(@@ -2605,19 +2237,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert service",inputSchema: {- service: serviceValidator- },- annotations: WRITE_ANNOTATIONS+ service: serviceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertService(ctx.client, {- ...params.service,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertService(ctx.client, { ...params.service, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertService")+ }, "Failed: items_upsertService"),);server.registerTool(@@ -2625,19 +2252,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert unit of measure",inputSchema: {- unitOfMeasure: unitOfMeasureValidator- },- annotations: WRITE_ANNOTATIONS+ unitOfMeasure: unitOfMeasureValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertUnitOfMeasure(ctx.client, {- ...params.unitOfMeasure,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertUnitOfMeasure(ctx.client, { ...params.unitOfMeasure, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertUnitOfMeasure")+ }, "Failed: items_upsertUnitOfMeasure"),);server.registerTool(@@ -2645,19 +2267,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "upsert tool",inputSchema: {- tool: toolValidator- },- annotations: WRITE_ANNOTATIONS+ tool: toolValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertTool(ctx.client, {- ...params.tool,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertTool(ctx.client, { ...params.tool, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: items_upsertTool")+ }, "Failed: items_upsertTool"),);server.registerTool(@@ -2665,17 +2282,14 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get supplier price breaks for items",inputSchema: {- itemIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ itemIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierPriceBreaksForItems(- ctx.client,- params.itemIds- );+ const result = await getSupplierPriceBreaksForItems(ctx.client, params.itemIds);return toMcpResult(result);- }, "Failed: items_getSupplierPriceBreaksForItems")+ }, "Failed: items_getSupplierPriceBreaksForItems"),);server.registerTool(@@ -2683,21 +2297,16 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "lookup buy price",inputSchema: {- itemId: z.string(),- qty: z.number(),- fallbackCost: z.number()- },- annotations: WRITE_ANNOTATIONS+ itemId: z.string(),+ qty: z.number(),+ fallbackCost: z.number(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await lookupBuyPrice(- ctx.client,- params.itemId,- params.qty,- params.fallbackCost- );+ const result = await lookupBuyPrice(ctx.client, params.itemId, params.qty, params.fallbackCost);return toMcpResult(result);- }, "Failed: items_lookupBuyPrice")+ }, "Failed: items_lookupBuyPrice"),);server.registerTool(@@ -2705,16 +2314,13 @@ export const registerItemsTools: RegisterTools = (server, ctx) => {{description: "get supplier part price breaks",inputSchema: {- supplierPartId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierPartId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierPartPriceBreaks(- ctx.client,- params.supplierPartId- );+ const result = await getSupplierPartPriceBreaks(ctx.client, params.supplierPartId);return toMcpResult(result);- }, "Failed: items_getSupplierPartPriceBreaks")+ }, "Failed: items_getSupplierPartPriceBreaks"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/people.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/people.tsindex 0484deff45..2dfe7c9f08 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/people.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/people.ts@@ -1,28 +1,24 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- departmentValidator,- employeeJobValidator,- holidayValidator,- shiftValidator-} from "~/modules/people/people.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {- clockIn,- clockOut,- createTimeCardEntry,deleteAttribute,deleteAttributeCategory,deleteDepartment,deleteHoliday,deleteShift,- deleteTimeCardEntry,getAttribute,getAttributeCategories,getAttributeCategory,getAttributeDataTypes,- getClockedInEmployees,- getContacts,getDepartment,getDepartments,getDepartmentsList,@@ -30,17 +26,11 @@ import {getEmployeeSummary,getHoliday,getHolidays,- getOpenClockEntry,getPeople,- getRecentTimecards,- getScheduledEmployeesToday,+ getContacts,getShift,getShifts,getShiftsList,- getTimeCardEntries,- getTimeCardEntry,- getTimecardEntries,- getWeeklyHoursForEmployees,insertAttribute,insertAttributeCategory,insertEmployeeJob,@@ -48,19 +38,29 @@ import {updateAttributeCategory,updateAttributeSortOrder,updateEmployeeJob,- updateTimeCardEntry,upsertDepartment,upsertHoliday,- upsertShift+ upsertShift,+ clockIn,+ clockOut,+ createTimeCardEntry,+ deleteTimeCardEntry,+ getClockedInEmployees,+ getOpenClockEntry,+ getRecentTimecards,+ getScheduledEmployeesToday,+ getTimeCardEntry,+ getTimeCardEntries,+ getTimecardEntries,+ getWeeklyHoursForEmployees,+ updateTimeCardEntry,} from "~/modules/people/people.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ employeeJobValidator,+ departmentValidator,+ holidayValidator,+ shiftValidator,+} from "~/modules/people/people.models";export const registerPeopleTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -68,14 +68,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete attribute",inputSchema: {- attributeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ attributeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteAttribute(ctx.client, params.attributeId);return toMcpResult(result);- }, "Failed: people_deleteAttribute")+ }, "Failed: people_deleteAttribute"),);server.registerTool(@@ -83,17 +83,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete attribute category",inputSchema: {- attributeCategoryId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ attributeCategoryId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteAttributeCategory(- ctx.client,- params.attributeCategoryId- );+ const result = await deleteAttributeCategory(ctx.client, params.attributeCategoryId);return toMcpResult(result);- }, "Failed: people_deleteAttributeCategory")+ }, "Failed: people_deleteAttributeCategory"),);server.registerTool(@@ -101,14 +98,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete department",inputSchema: {- departmentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ departmentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteDepartment(ctx.client, params.departmentId);return toMcpResult(result);- }, "Failed: people_deleteDepartment")+ }, "Failed: people_deleteDepartment"),);server.registerTool(@@ -116,14 +113,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete holiday",inputSchema: {- holidayId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ holidayId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteHoliday(ctx.client, params.holidayId);return toMcpResult(result);- }, "Failed: people_deleteHoliday")+ }, "Failed: people_deleteHoliday"),);server.registerTool(@@ -131,14 +128,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete shift",inputSchema: {- shiftId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shiftId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteShift(ctx.client, params.shiftId);return toMcpResult(result);- }, "Failed: people_deleteShift")+ }, "Failed: people_deleteShift"),);server.registerTool(@@ -146,14 +143,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get attribute",inputSchema: {- attributeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ attributeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAttribute(ctx.client, params.attributeId);return toMcpResult(result);- }, "Failed: people_getAttribute")+ }, "Failed: people_getAttribute"),);server.registerTool(@@ -161,23 +158,17 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get attribute categories",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAttributeCategories(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getAttributeCategories(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getAttributeCategories")+ }, "Failed: people_getAttributeCategories"),);server.registerTool(@@ -185,14 +176,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get attribute category",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAttributeCategory(ctx.client, params.id);return toMcpResult(result);- }, "Failed: people_getAttributeCategory")+ }, "Failed: people_getAttributeCategory"),);server.registerTool(@@ -200,12 +191,12 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get attribute data types",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAttributeDataTypes(ctx.client);return toMcpResult(result);- }, "Failed: people_getAttributeDataTypes")+ }, "Failed: people_getAttributeDataTypes"),);server.registerTool(@@ -213,14 +204,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get department",inputSchema: {- departmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ departmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDepartment(ctx.client, params.departmentId);return toMcpResult(result);- }, "Failed: people_getDepartment")+ }, "Failed: people_getDepartment"),);server.registerTool(@@ -228,24 +219,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get departments",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDepartments(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getDepartments(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getDepartments")+ }, "Failed: people_getDepartments"),);server.registerTool(@@ -253,12 +238,12 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get departments list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getDepartmentsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getDepartmentsList")+ }, "Failed: people_getDepartmentsList"),);server.registerTool(@@ -266,18 +251,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get employee job",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getEmployeeJob(- ctx.client,- params.employeeId,- ctx.companyId- );+ const result = await getEmployeeJob(ctx.client, params.employeeId, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getEmployeeJob")+ }, "Failed: people_getEmployeeJob"),);server.registerTool(@@ -285,18 +266,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get employee summary",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getEmployeeSummary(- ctx.client,- params.employeeId,- ctx.companyId- );+ const result = await getEmployeeSummary(ctx.client, params.employeeId, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getEmployeeSummary")+ }, "Failed: people_getEmployeeSummary"),);server.registerTool(@@ -304,14 +281,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get holiday",inputSchema: {- holidayId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ holidayId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getHoliday(ctx.client, params.holidayId);return toMcpResult(result);- }, "Failed: people_getHoliday")+ }, "Failed: people_getHoliday"),);server.registerTool(@@ -319,20 +296,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get holidays",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getHolidays(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getHolidays")+ }, "Failed: people_getHolidays"),);server.registerTool(@@ -340,18 +315,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get people",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPeople(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getPeople")+ }, "Failed: people_getPeople"),);server.registerTool(@@ -359,18 +334,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get contacts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getContacts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getContacts")+ }, "Failed: people_getContacts"),);server.registerTool(@@ -378,14 +353,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get shift",inputSchema: {- shiftId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ shiftId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShift(ctx.client, params.shiftId);return toMcpResult(result);- }, "Failed: people_getShift")+ }, "Failed: people_getShift"),);server.registerTool(@@ -393,18 +368,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get shifts",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShifts(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getShifts")+ }, "Failed: people_getShifts"),);server.registerTool(@@ -412,14 +387,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get shifts list",inputSchema: {- locationId: z.string().nullable()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string().nullable(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getShiftsList(ctx.client, params.locationId);return toMcpResult(result);- }, "Failed: people_getShiftsList")+ }, "Failed: people_getShiftsList"),);server.registerTool(@@ -427,23 +402,20 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "insert attribute",inputSchema: {- attribute: z.object({- name: z.string(),- attributeDataTypeId: z.number(),- userAttributeCategoryId: z.string(),- listOptions: z.array(z.string()).optional(),- canSelfManage: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ attribute: z.object({+ name: z.string(),+ attributeDataTypeId: z.number(),+ userAttributeCategoryId: z.string(),+ listOptions: z.array(z.string()).optional(),+ canSelfManage: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertAttribute(ctx.client, {- ...params.attribute,- createdBy: ctx.userId- });+ const result = await insertAttribute(ctx.client, { ...params.attribute, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_insertAttribute")+ }, "Failed: people_insertAttribute"),);server.registerTool(@@ -451,22 +423,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "insert attribute category",inputSchema: {- attributeCategory: z.object({- name: z.string(),- emoji: z.string().optional(),- public: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ attributeCategory: z.object({+ name: z.string(),+ emoji: z.string().optional(),+ public: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertAttributeCategory(ctx.client, {- ...params.attributeCategory,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertAttributeCategory(ctx.client, { ...params.attributeCategory, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_insertAttributeCategory")+ }, "Failed: people_insertAttributeCategory"),);server.registerTool(@@ -474,20 +442,17 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "insert employee job",inputSchema: {- job: z.object({- id: z.string(),- locationId: z.string().optional()- })- },- annotations: WRITE_ANNOTATIONS+ job: z.object({+ id: z.string(),+ locationId: z.string().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertEmployeeJob(ctx.client, {- ...params.job,- companyId: ctx.companyId- });+ const result = await insertEmployeeJob(ctx.client, { ...params.job, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: people_insertEmployeeJob")+ }, "Failed: people_insertEmployeeJob"),);server.registerTool(@@ -495,22 +460,19 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "update attribute",inputSchema: {- attribute: z.object({- id: z.string().optional(),- name: z.string(),- listOptions: z.array(z.string()).optional(),- canSelfManage: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ attribute: z.object({+ id: z.string().optional(),+ name: z.string(),+ listOptions: z.array(z.string()).optional(),+ canSelfManage: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAttribute(ctx.client, {- ...params.attribute,- updatedBy: ctx.userId- });+ const result = await updateAttribute(ctx.client, { ...params.attribute, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_updateAttribute")+ }, "Failed: people_updateAttribute"),);server.registerTool(@@ -518,22 +480,19 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "update attribute category",inputSchema: {- attributeCategory: z.object({- id: z.string(),- name: z.string(),- emoji: z.string().optional(),- public: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ attributeCategory: z.object({+ id: z.string(),+ name: z.string(),+ emoji: z.string().optional(),+ public: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAttributeCategory(ctx.client, {- ...params.attributeCategory,- updatedBy: ctx.userId- });+ const result = await updateAttributeCategory(ctx.client, { ...params.attributeCategory, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_updateAttributeCategory")+ }, "Failed: people_updateAttributeCategory"),);server.registerTool(@@ -541,20 +500,17 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "update attribute sort order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAttributeSortOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateAttributeSortOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_updateAttributeSortOrder")+ }, "Failed: people_updateAttributeSortOrder"),);server.registerTool(@@ -562,19 +518,15 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "update employee job",inputSchema: {- employeeId: z.string(),- employeeJob: employeeJobValidator- },- annotations: WRITE_ANNOTATIONS+ employeeId: z.string(),+ employeeJob: employeeJobValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateEmployeeJob(ctx.client, params.employeeId, {- ...params.employeeJob,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await updateEmployeeJob(ctx.client, params.employeeId, { ...params.employeeJob, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_updateEmployeeJob")+ }, "Failed: people_updateEmployeeJob"),);server.registerTool(@@ -582,19 +534,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "upsert department",inputSchema: {- department: departmentValidator- },- annotations: WRITE_ANNOTATIONS+ department: departmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertDepartment(ctx.client, {- ...params.department,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertDepartment(ctx.client, { ...params.department, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_upsertDepartment")+ }, "Failed: people_upsertDepartment"),);server.registerTool(@@ -602,19 +549,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "upsert holiday",inputSchema: {- holiday: holidayValidator- },- annotations: WRITE_ANNOTATIONS+ holiday: holidayValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertHoliday(ctx.client, {- ...params.holiday,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertHoliday(ctx.client, { ...params.holiday, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_upsertHoliday")+ }, "Failed: people_upsertHoliday"),);server.registerTool(@@ -622,19 +564,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "upsert shift",inputSchema: {- shift: shiftValidator- },- annotations: WRITE_ANNOTATIONS+ shift: shiftValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertShift(ctx.client, {- ...params.shift,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertShift(ctx.client, { ...params.shift, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_upsertShift")+ }, "Failed: people_upsertShift"),);server.registerTool(@@ -642,20 +579,16 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "clock in",inputSchema: {- args: z.object({- employeeId: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ employeeId: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await clockIn(ctx.client, {- ...params.args,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await clockIn(ctx.client, { ...params.args, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_clockIn")+ }, "Failed: people_clockIn"),);server.registerTool(@@ -663,22 +596,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "clock out",inputSchema: {- args: z.object({- employeeId: z.string(),- clockOut: z.string().optional(),- note: z.string().optional()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ employeeId: z.string(),+ clockOut: z.string().optional(),+ note: z.string().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await clockOut(ctx.client, {- ...params.args,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await clockOut(ctx.client, { ...params.args, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_clockOut")+ }, "Failed: people_clockOut"),);server.registerTool(@@ -686,23 +615,19 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "create time card entry",inputSchema: {- entry: z.object({- employeeId: z.string(),- clockIn: z.string(),- clockOut: z.string().nullable().optional(),- note: z.string().nullable().optional()- })- },- annotations: WRITE_ANNOTATIONS+ entry: z.object({+ employeeId: z.string(),+ clockIn: z.string(),+ clockOut: z.string().nullable().optional(),+ note: z.string().nullable().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await createTimeCardEntry(ctx.client, {- ...params.entry,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await createTimeCardEntry(ctx.client, { ...params.entry, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_createTimeCardEntry")+ }, "Failed: people_createTimeCardEntry"),);server.registerTool(@@ -710,14 +635,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "delete time card entry",inputSchema: {- entryId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ entryId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteTimeCardEntry(ctx.client, params.entryId);return toMcpResult(result);- }, "Failed: people_deleteTimeCardEntry")+ }, "Failed: people_deleteTimeCardEntry"),);server.registerTool(@@ -725,12 +650,12 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get clocked in employees",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getClockedInEmployees(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getClockedInEmployees")+ }, "Failed: people_getClockedInEmployees"),);server.registerTool(@@ -738,18 +663,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get open clock entry",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpenClockEntry(- ctx.client,- params.employeeId,- ctx.companyId- );+ const result = await getOpenClockEntry(ctx.client, params.employeeId, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getOpenClockEntry")+ }, "Failed: people_getOpenClockEntry"),);server.registerTool(@@ -757,12 +678,12 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get recent timecards",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getRecentTimecards(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getRecentTimecards")+ }, "Failed: people_getRecentTimecards"),);server.registerTool(@@ -770,15 +691,12 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get scheduled employees today",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getScheduledEmployeesToday(- ctx.client,- ctx.companyId- );+ const result = await getScheduledEmployeesToday(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: people_getScheduledEmployeesToday")+ }, "Failed: people_getScheduledEmployeesToday"),);server.registerTool(@@ -786,14 +704,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get time card entry",inputSchema: {- entryId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ entryId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTimeCardEntry(ctx.client, params.entryId);return toMcpResult(result);- }, "Failed: people_getTimeCardEntry")+ }, "Failed: people_getTimeCardEntry"),);server.registerTool(@@ -801,21 +719,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get time card entries",inputSchema: {- args: z.object({- employeeId: z.string(),- from: z.string().optional(),- to: z.string().optional()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ employeeId: z.string(),+ from: z.string().optional(),+ to: z.string().optional()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTimeCardEntries(ctx.client, {- ...params.args,- companyId: ctx.companyId- });+ const result = await getTimeCardEntries(ctx.client, { ...params.args, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: people_getTimeCardEntries")+ }, "Failed: people_getTimeCardEntries"),);server.registerTool(@@ -823,22 +738,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get timecard entries",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTimecardEntries(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getTimecardEntries(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: people_getTimecardEntries")+ }, "Failed: people_getTimecardEntries"),);server.registerTool(@@ -846,18 +757,14 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "get weekly hours for employees",inputSchema: {- employeeIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ employeeIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWeeklyHoursForEmployees(- ctx.client,- ctx.companyId,- params.employeeIds- );+ const result = await getWeeklyHoursForEmployees(ctx.client, ctx.companyId, params.employeeIds);return toMcpResult(result);- }, "Failed: people_getWeeklyHoursForEmployees")+ }, "Failed: people_getWeeklyHoursForEmployees"),);server.registerTool(@@ -865,21 +772,18 @@ export const registerPeopleTools: RegisterTools = (server, ctx) => {{description: "update time card entry",inputSchema: {- args: z.object({- entryId: z.string(),- clockIn: z.string().optional(),- clockOut: z.string().nullable().optional(),- note: z.string().nullable().optional()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ entryId: z.string(),+ clockIn: z.string().optional(),+ clockOut: z.string().nullable().optional(),+ note: z.string().nullable().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateTimeCardEntry(ctx.client, {- ...params.args,- updatedBy: ctx.userId- });+ const result = await updateTimeCardEntry(ctx.client, { ...params.args, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: people_updateTimeCardEntry")+ }, "Failed: people_updateTimeCardEntry"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/production.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/production.tsindex 019f634041..f3cba16965 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/production.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/production.ts@@ -1,139 +1,134 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- failureModeValidator,- jobMaterialValidator,- jobOperationValidator,- jobValidator,- maintenanceDispatchCommentValidator,- maintenanceDispatchEventValidator,- maintenanceDispatchItemValidator,- maintenanceDispatchValidator,- maintenanceDispatchWorkCenterValidator,- maintenanceScheduleItemValidator,- maintenanceScheduleValidator,- procedureParameterValidator,- procedureStepValidator,- procedureValidator,- productionEventValidator,- productionQuantityValidator,- scrapReasonValidator-} from "~/modules/production/production.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {- calculateJobPriority,convertSalesOrderLinesToJobs,+ calculateJobPriority,deleteDemandForecasts,deleteDemandProjections,- deleteFailureMode,deleteJob,deleteJobMaterial,deleteJobOperation,- deleteJobOperationParameter,deleteJobOperationStep,+ deleteJobOperationParameter,deleteJobOperationTool,- deleteMaintenanceDispatch,- deleteMaintenanceDispatchComment,- deleteMaintenanceDispatchEvent,- deleteMaintenanceDispatchItem,- deleteMaintenanceDispatchWorkCenter,- deleteMaintenanceSchedule,- deleteMaintenanceScheduleItem,deleteProcedure,- deleteProcedureParameter,deleteProcedureStep,+ deleteProcedureParameter,deleteProductionEvent,deleteProductionQuantity,- deleteScrapReason,getActiveJobOperationByJobId,getActiveJobOperationsByLocation,+ getJobsByDateRange,+ getUnscheduledJobs,getActiveProductionEvents,+ deleteScrapReason,+ deleteFailureMode,+ deleteMaintenanceDispatch,+ deleteMaintenanceDispatchComment,+ deleteMaintenanceDispatchEvent,+ deleteMaintenanceDispatchItem,+ deleteMaintenanceDispatchWorkCenter,+ deleteMaintenanceSchedule,+ deleteMaintenanceScheduleItem,getDemandForecasts,getDemandProjections,- getFailureMode,- getFailureModes,- getFailureModesList,- getJob,- getJobByOperationId,getJobDocuments,getJobDocumentsWithItemId,+ getJob,+ getJobByOperationId,+ getJobPurchaseOrderLines,+ getJobs,+ getJobsBySalesOrderLine,+ getJobsList,getJobMakeMethodById,- getJobMaterial,- getJobMaterialsByMethodId,+ getRootMakeMethod,getJobMaterialsWithQuantityOnHand,getJobMethodTree,getJobMethodTreeArray,+ getJobMaterial,+ getJobMaterialsByMethodId,getJobOperation,- getJobOperationAttachments,- getJobOperationStepRecords,getJobOperations,getJobOperationsAssignedToEmployee,- getJobOperationsByMethodId,+ getJobOperationAttachments,getJobOperationsList,- getJobPurchaseOrderLines,- getJobs,- getJobsByDateRange,- getJobsBySalesOrderLine,- getJobsList,- getMaintenanceDispatch,- getMaintenanceDispatchComments,- getMaintenanceDispatchEvents,- getMaintenanceDispatches,- getMaintenanceDispatchItems,- getMaintenanceDispatchWorkCenters,- getMaintenanceSchedule,- getMaintenanceScheduleItems,- getMaintenanceSchedules,+ getJobOperationsByMethodId,+ getJobOperationStepRecords,getOutsideOperationsByJobId,getProcedure,- getProcedureParameters,getProcedureSteps,+ getProcedureParameters,+ getProcedureVersions,getProcedures,getProceduresList,- getProcedureVersions,- getProductionDataByOperations,getProductionEvent,getProductionEvents,- getProductionEventsByOperations,getProductionEventsPage,+ getProductionEventsByOperations,getProductionPlanning,getProductionProjections,- getProductionQuantities,getProductionQuantity,- getRootMakeMethod,+ getProductionQuantities,+ getProductionDataByOperations,+ getScrapReasonsList,getScrapReason,getScrapReasons,- getScrapReasonsList,- getTrackedEntitiesByJobId,+ getFailureMode,+ getFailureModes,+ getFailureModesList,+ getMaintenanceDispatch,+ getMaintenanceDispatches,+ getMaintenanceDispatchComments,+ getMaintenanceDispatchEvents,+ getMaintenanceDispatchItems,+ getMaintenanceDispatchWorkCenters,+ getMaintenanceSchedule,+ getMaintenanceSchedules,+ getMaintenanceScheduleItems,getTrackedEntityByJobId,- getUnscheduledJobs,- recalculateJobMakeMethodRequirements,+ getTrackedEntitiesByJobId,recalculateJobOperationDependencies,recalculateJobRequirements,+ recalculateJobMakeMethodRequirements,runMRP,updateJobBatchNumber,+ updateJobStatus,updateJobMaterialOrder,- updateJobOperationDueDate,updateJobOperationOrder,- updateJobOperationStatus,updateJobOperationStepOrder,- updateJobStatus,updateKanbanJob,+ updateQuoteOperationStepOrder,updateMethodOperationStepOrder,+ updateJobOperationStatus,+ updateJobOperationDueDate,updateProcedureStepOrder,+ upsertProductionEvent,updateProductionQuantity,- updateQuoteOperationStepOrder,- upsertDemandForecasts,- upsertDemandProjections,- upsertFailureMode,+ upsertProductionQuantity,upsertJob,upsertJobMaterial,- upsertJobMaterialMakeMethod,- upsertJobMethod,upsertJobOperation,- upsertJobOperationParameter,upsertJobOperationStep,+ upsertJobOperationParameter,upsertJobOperationTool,+ upsertJobMethod,+ upsertJobMaterialMakeMethod,+ upsertMakeMethodFromJob,+ upsertMakeMethodFromJobMethod,+ upsertProcedure,+ upsertProcedureStep,+ upsertProcedureParameter,+ upsertScrapReason,+ upsertFailureMode,upsertMaintenanceDispatch,upsertMaintenanceDispatchComment,upsertMaintenanceDispatchEvent,@@ -141,28 +136,33 @@ import {upsertMaintenanceDispatchWorkCenter,upsertMaintenanceSchedule,upsertMaintenanceScheduleItem,- upsertMakeMethodFromJob,- upsertMakeMethodFromJobMethod,- upsertProcedure,- upsertProcedureParameter,- upsertProcedureStep,- upsertProductionEvent,- upsertProductionQuantity,- upsertScrapReason+ upsertDemandForecasts,+ upsertDemandProjections,} from "~/modules/production/production.service";import {- operationParameterValidator,+ productionEventValidator,+ productionQuantityValidator,+ jobValidator,+ jobMaterialValidator,+ jobOperationValidator,+ procedureValidator,+ procedureStepValidator,+ procedureParameterValidator,+ scrapReasonValidator,+ failureModeValidator,+ maintenanceDispatchValidator,+ maintenanceDispatchCommentValidator,+ maintenanceDispatchEventValidator,+ maintenanceDispatchItemValidator,+ maintenanceDispatchWorkCenterValidator,+ maintenanceScheduleValidator,+ maintenanceScheduleItemValidator,+} from "~/modules/production/production.models";+import {operationStepValidator,- operationToolValidator+ operationParameterValidator,+ operationToolValidator,} from "~/modules/shared";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerProductionTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -170,20 +170,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "convert sales order lines to jobs",inputSchema: {- arg1: z.object({- orderId: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ arg1: z.object({+ orderId: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await convertSalesOrderLinesToJobs(ctx.client, {- ...params.arg1,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await convertSalesOrderLinesToJobs(ctx.client, { ...params.arg1, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_convertSalesOrderLinesToJobs")+ }, "Failed: production_convertSalesOrderLinesToJobs"),);server.registerTool(@@ -191,22 +187,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "calculate job priority",inputSchema: {- params: z.object({- jobId: z.string().optional(),- dueDate: z.string().nullable(),- deadlineType: z.any(),- locationId: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ jobId: z.string().optional(),+ dueDate: z.string().nullable(),+ deadlineType: z.any(),+ locationId: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await calculateJobPriority(ctx.client, {- ...params.params,- companyId: ctx.companyId- });+ const result = await calculateJobPriority(ctx.client, { ...params.params, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: production_calculateJobPriority")+ }, "Failed: production_calculateJobPriority"),);server.registerTool(@@ -214,21 +207,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete demand forecasts",inputSchema: {- params: z.object({- itemId: z.string(),- locationId: z.string(),- futurePeriodIds: z.array(z.string())- })- },- annotations: DESTRUCTIVE_ANNOTATIONS+ params: z.object({+ itemId: z.string(),+ locationId: z.string(),+ futurePeriodIds: z.array(z.string())+ }),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteDemandForecasts(ctx.client, {- ...params.params,- companyId: ctx.companyId- });+ const result = await deleteDemandForecasts(ctx.client, { ...params.params, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: production_deleteDemandForecasts")+ }, "Failed: production_deleteDemandForecasts"),);server.registerTool(@@ -236,21 +226,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete demand projections",inputSchema: {- params: z.object({- itemId: z.string(),- locationId: z.string(),- futurePeriodIds: z.array(z.string())- })- },- annotations: DESTRUCTIVE_ANNOTATIONS+ params: z.object({+ itemId: z.string(),+ locationId: z.string(),+ futurePeriodIds: z.array(z.string())+ }),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteDemandProjections(ctx.client, {- ...params.params,- companyId: ctx.companyId- });+ const result = await deleteDemandProjections(ctx.client, { ...params.params, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: production_deleteDemandProjections")+ }, "Failed: production_deleteDemandProjections"),);server.registerTool(@@ -258,14 +245,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job",inputSchema: {- jobId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteJob(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_deleteJob")+ }, "Failed: production_deleteJob"),);server.registerTool(@@ -273,14 +260,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job material",inputSchema: {- jobMaterialId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ jobMaterialId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteJobMaterial(ctx.client, params.jobMaterialId);return toMcpResult(result);- }, "Failed: production_deleteJobMaterial")+ }, "Failed: production_deleteJobMaterial"),);server.registerTool(@@ -288,17 +275,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job operation",inputSchema: {- jobOperationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ jobOperationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteJobOperation(- ctx.client,- params.jobOperationId- );+ const result = await deleteJobOperation(ctx.client, params.jobOperationId);return toMcpResult(result);- }, "Failed: production_deleteJobOperation")+ }, "Failed: production_deleteJobOperation"),);server.registerTool(@@ -306,14 +290,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job operation step",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteJobOperationStep(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_deleteJobOperationStep")+ }, "Failed: production_deleteJobOperationStep"),);server.registerTool(@@ -321,14 +305,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job operation parameter",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteJobOperationParameter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_deleteJobOperationParameter")+ }, "Failed: production_deleteJobOperationParameter"),);server.registerTool(@@ -336,14 +320,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete job operation tool",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteJobOperationTool(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_deleteJobOperationTool")+ }, "Failed: production_deleteJobOperationTool"),);server.registerTool(@@ -351,14 +335,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete procedure",inputSchema: {- procedureId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ procedureId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteProcedure(ctx.client, params.procedureId);return toMcpResult(result);- }, "Failed: production_deleteProcedure")+ }, "Failed: production_deleteProcedure"),);server.registerTool(@@ -366,18 +350,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete procedure step",inputSchema: {- procedureStepId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ procedureStepId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteProcedureStep(- ctx.client,- params.procedureStepId,- ctx.companyId- );+ const result = await deleteProcedureStep(ctx.client, params.procedureStepId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_deleteProcedureStep")+ }, "Failed: production_deleteProcedureStep"),);server.registerTool(@@ -385,18 +365,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete procedure parameter",inputSchema: {- procedureParameterId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ procedureParameterId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteProcedureParameter(- ctx.client,- params.procedureParameterId,- ctx.companyId- );+ const result = await deleteProcedureParameter(ctx.client, params.procedureParameterId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_deleteProcedureParameter")+ }, "Failed: production_deleteProcedureParameter"),);server.registerTool(@@ -404,17 +380,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete production event",inputSchema: {- productionEventId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ productionEventId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteProductionEvent(- ctx.client,- params.productionEventId- );+ const result = await deleteProductionEvent(ctx.client, params.productionEventId);return toMcpResult(result);- }, "Failed: production_deleteProductionEvent")+ }, "Failed: production_deleteProductionEvent"),);server.registerTool(@@ -422,17 +395,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete production quantity",inputSchema: {- productionQuantityId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ productionQuantityId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteProductionQuantity(- ctx.client,- params.productionQuantityId- );+ const result = await deleteProductionQuantity(ctx.client, params.productionQuantityId);return toMcpResult(result);- }, "Failed: production_deleteProductionQuantity")+ }, "Failed: production_deleteProductionQuantity"),);server.registerTool(@@ -440,18 +410,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get active job operation by job id",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getActiveJobOperationByJobId(- ctx.client,- params.jobId,- ctx.companyId- );+ const result = await getActiveJobOperationByJobId(ctx.client, params.jobId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getActiveJobOperationByJobId")+ }, "Failed: production_getActiveJobOperationByJobId"),);server.registerTool(@@ -459,19 +425,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get active job operations by location",inputSchema: {- locationId: z.string(),- workCenterIds: z.array(z.string()).optional()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ workCenterIds: z.array(z.string()).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getActiveJobOperationsByLocation(- ctx.client,- params.locationId,- params.workCenterIds- );+ const result = await getActiveJobOperationsByLocation(ctx.client, params.locationId, params.workCenterIds);return toMcpResult(result);- }, "Failed: production_getActiveJobOperationsByLocation")+ }, "Failed: production_getActiveJobOperationsByLocation"),);server.registerTool(@@ -479,21 +441,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get jobs by date range",inputSchema: {- locationId: z.string(),- startDate: z.string(),- endDate: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ startDate: z.string(),+ endDate: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobsByDateRange(- ctx.client,- params.locationId,- params.startDate,- params.endDate- );+ const result = await getJobsByDateRange(ctx.client, params.locationId, params.startDate, params.endDate);return toMcpResult(result);- }, "Failed: production_getJobsByDateRange")+ }, "Failed: production_getJobsByDateRange"),);server.registerTool(@@ -501,14 +458,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get unscheduled jobs",inputSchema: {- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getUnscheduledJobs(ctx.client, params.locationId);return toMcpResult(result);- }, "Failed: production_getUnscheduledJobs")+ }, "Failed: production_getUnscheduledJobs"),);server.registerTool(@@ -516,12 +473,12 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get active production events",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getActiveProductionEvents(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getActiveProductionEvents")+ }, "Failed: production_getActiveProductionEvents"),);server.registerTool(@@ -529,14 +486,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete scrap reason",inputSchema: {- scrapReasonId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ scrapReasonId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteScrapReason(ctx.client, params.scrapReasonId);return toMcpResult(result);- }, "Failed: production_deleteScrapReason")+ }, "Failed: production_deleteScrapReason"),);server.registerTool(@@ -544,14 +501,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete failure mode",inputSchema: {- failureModeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ failureModeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteFailureMode(ctx.client, params.failureModeId);return toMcpResult(result);- }, "Failed: production_deleteFailureMode")+ }, "Failed: production_deleteFailureMode"),);server.registerTool(@@ -559,17 +516,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch",inputSchema: {- dispatchId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatch(- ctx.client,- params.dispatchId- );+ const result = await deleteMaintenanceDispatch(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceDispatch")+ }, "Failed: production_deleteMaintenanceDispatch"),);server.registerTool(@@ -577,17 +531,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch comment",inputSchema: {- commentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ commentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchComment(- ctx.client,- params.commentId- );+ const result = await deleteMaintenanceDispatchComment(ctx.client, params.commentId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceDispatchComment")+ }, "Failed: production_deleteMaintenanceDispatchComment"),);server.registerTool(@@ -595,17 +546,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch event",inputSchema: {- eventId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ eventId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchEvent(- ctx.client,- params.eventId- );+ const result = await deleteMaintenanceDispatchEvent(ctx.client, params.eventId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceDispatchEvent")+ }, "Failed: production_deleteMaintenanceDispatchEvent"),);server.registerTool(@@ -613,17 +561,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch item",inputSchema: {- itemId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchItem(- ctx.client,- params.itemId- );+ const result = await deleteMaintenanceDispatchItem(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceDispatchItem")+ }, "Failed: production_deleteMaintenanceDispatchItem"),);server.registerTool(@@ -631,17 +576,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch work center",inputSchema: {- workCenterId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ workCenterId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchWorkCenter(- ctx.client,- params.workCenterId- );+ const result = await deleteMaintenanceDispatchWorkCenter(ctx.client, params.workCenterId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceDispatchWorkCenter")+ }, "Failed: production_deleteMaintenanceDispatchWorkCenter"),);server.registerTool(@@ -649,17 +591,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance schedule",inputSchema: {- scheduleId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceSchedule(- ctx.client,- params.scheduleId- );+ const result = await deleteMaintenanceSchedule(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceSchedule")+ }, "Failed: production_deleteMaintenanceSchedule"),);server.registerTool(@@ -667,17 +606,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "delete maintenance schedule item",inputSchema: {- itemId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceScheduleItem(- ctx.client,- params.itemId- );+ const result = await deleteMaintenanceScheduleItem(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: production_deleteMaintenanceScheduleItem")+ }, "Failed: production_deleteMaintenanceScheduleItem"),);server.registerTool(@@ -685,21 +621,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get demand forecasts",inputSchema: {- params: z.object({- itemId: z.string(),- locationId: z.string(),- periodIds: z.array(z.string())- })- },- annotations: READ_ONLY_ANNOTATIONS+ params: z.object({+ itemId: z.string(),+ locationId: z.string(),+ periodIds: z.array(z.string())+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDemandForecasts(ctx.client, {- ...params.params,- companyId: ctx.companyId- });+ const result = await getDemandForecasts(ctx.client, { ...params.params, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: production_getDemandForecasts")+ }, "Failed: production_getDemandForecasts"),);server.registerTool(@@ -707,21 +640,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get demand projections",inputSchema: {- params: z.object({- itemId: z.string(),- locationId: z.string(),- periodIds: z.array(z.string())- })- },- annotations: READ_ONLY_ANNOTATIONS+ params: z.object({+ itemId: z.string(),+ locationId: z.string(),+ periodIds: z.array(z.string())+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getDemandProjections(ctx.client, {- ...params.params,- companyId: ctx.companyId- });+ const result = await getDemandProjections(ctx.client, { ...params.params, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: production_getDemandProjections")+ }, "Failed: production_getDemandProjections"),);server.registerTool(@@ -729,23 +659,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job documents",inputSchema: {- job: z.object({- id: z.string().nullable(),- salesOrderLineId: z.string().nullable().optional(),- quoteLineId: z.string().nullable().optional(),- itemId: z.string().nullable().optional()- })- },- annotations: READ_ONLY_ANNOTATIONS+ job: z.object({+ id: z.string().nullable(),+ salesOrderLineId: z.string().nullable().optional(),+ quoteLineId: z.string().nullable().optional(),+ itemId: z.string().nullable().optional()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobDocuments(- ctx.client,- ctx.companyId,- params.job- );+ const result = await getJobDocuments(ctx.client, ctx.companyId, params.job);return toMcpResult(result);- }, "Failed: production_getJobDocuments")+ }, "Failed: production_getJobDocuments"),);server.registerTool(@@ -753,20 +679,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job documents with item id",inputSchema: {- job: z.any(),- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ job: z.any(),+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobDocumentsWithItemId(- ctx.client,- ctx.companyId,- params.job,- params.itemId- );+ const result = await getJobDocumentsWithItemId(ctx.client, ctx.companyId, params.job, params.itemId);return toMcpResult(result);- }, "Failed: production_getJobDocumentsWithItemId")+ }, "Failed: production_getJobDocumentsWithItemId"),);server.registerTool(@@ -774,14 +695,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJob(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_getJob")+ }, "Failed: production_getJob"),);server.registerTool(@@ -789,14 +710,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job by operation id",inputSchema: {- operationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ operationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobByOperationId(ctx.client, params.operationId);return toMcpResult(result);- }, "Failed: production_getJobByOperationId")+ }, "Failed: production_getJobByOperationId"),);server.registerTool(@@ -804,14 +725,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job purchase order lines",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobPurchaseOrderLines(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getJobPurchaseOrderLines")+ }, "Failed: production_getJobPurchaseOrderLines"),);server.registerTool(@@ -819,19 +740,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get jobs",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobs(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getJobs")+ }, "Failed: production_getJobs"),);server.registerTool(@@ -839,17 +758,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get jobs by sales order line",inputSchema: {- salesOrderLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobsBySalesOrderLine(- ctx.client,- params.salesOrderLineId- );+ const result = await getJobsBySalesOrderLine(ctx.client, params.salesOrderLineId);return toMcpResult(result);- }, "Failed: production_getJobsBySalesOrderLine")+ }, "Failed: production_getJobsBySalesOrderLine"),);server.registerTool(@@ -857,12 +773,12 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get jobs list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getJobsList")+ }, "Failed: production_getJobsList"),);server.registerTool(@@ -870,18 +786,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job make method by id",inputSchema: {- jobMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobMakeMethodById(- ctx.client,- params.jobMakeMethodId,- ctx.companyId- );+ const result = await getJobMakeMethodById(ctx.client, params.jobMakeMethodId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getJobMakeMethodById")+ }, "Failed: production_getJobMakeMethodById"),);server.registerTool(@@ -889,18 +801,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get root make method",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getRootMakeMethod(- ctx.client,- params.jobId,- ctx.companyId- );+ const result = await getRootMakeMethod(ctx.client, params.jobId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getRootMakeMethod")+ }, "Failed: production_getRootMakeMethod"),);server.registerTool(@@ -908,27 +816,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job materials with quantity on hand",inputSchema: {- jobId: z.string(),- locationId: z.string(),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobMaterialsWithQuantityOnHand(- ctx.client,- params.jobId,- ctx.companyId,- params.locationId,- params.args- );+ const result = await getJobMaterialsWithQuantityOnHand(ctx.client, params.jobId, ctx.companyId, params.locationId, params.args);return toMcpResult(result);- }, "Failed: production_getJobMaterialsWithQuantityOnHand")+ }, "Failed: production_getJobMaterialsWithQuantityOnHand"),);server.registerTool(@@ -936,14 +836,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job method tree",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobMethodTree(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getJobMethodTree")+ }, "Failed: production_getJobMethodTree"),);server.registerTool(@@ -951,14 +851,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job method tree array",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobMethodTreeArray(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getJobMethodTreeArray")+ }, "Failed: production_getJobMethodTreeArray"),);server.registerTool(@@ -966,14 +866,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job material",inputSchema: {- materialId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobMaterial(ctx.client, params.materialId);return toMcpResult(result);- }, "Failed: production_getJobMaterial")+ }, "Failed: production_getJobMaterial"),);server.registerTool(@@ -981,17 +881,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job materials by method id",inputSchema: {- jobMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobMaterialsByMethodId(- ctx.client,- params.jobMakeMethodId- );+ const result = await getJobMaterialsByMethodId(ctx.client, params.jobMakeMethodId);return toMcpResult(result);- }, "Failed: production_getJobMaterialsByMethodId")+ }, "Failed: production_getJobMaterialsByMethodId"),);server.registerTool(@@ -999,14 +896,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operation",inputSchema: {- jobOperationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobOperation(ctx.client, params.jobOperationId);return toMcpResult(result);- }, "Failed: production_getJobOperation")+ }, "Failed: production_getJobOperation"),);server.registerTool(@@ -1014,24 +911,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operations",inputSchema: {- jobId: z.string(),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobOperations(- ctx.client,- params.jobId,- params.args- );+ const result = await getJobOperations(ctx.client, params.jobId, params.args);return toMcpResult(result);- }, "Failed: production_getJobOperations")+ }, "Failed: production_getJobOperations"),);server.registerTool(@@ -1039,18 +930,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operations assigned to employee",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobOperationsAssignedToEmployee(- ctx.client,- params.employeeId,- ctx.companyId- );+ const result = await getJobOperationsAssignedToEmployee(ctx.client, params.employeeId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getJobOperationsAssignedToEmployee")+ }, "Failed: production_getJobOperationsAssignedToEmployee"),);server.registerTool(@@ -1058,17 +945,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operation attachments",inputSchema: {- jobOperationIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobOperationAttachments(- ctx.client,- params.jobOperationIds- );+ const result = await getJobOperationAttachments(ctx.client, params.jobOperationIds);return toMcpResult(result);- }, "Failed: production_getJobOperationAttachments")+ }, "Failed: production_getJobOperationAttachments"),);server.registerTool(@@ -1076,14 +960,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operations list",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getJobOperationsList(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getJobOperationsList")+ }, "Failed: production_getJobOperationsList"),);server.registerTool(@@ -1091,17 +975,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operations by method id",inputSchema: {- jobMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobOperationsByMethodId(- ctx.client,- params.jobMakeMethodId- );+ const result = await getJobOperationsByMethodId(ctx.client, params.jobMakeMethodId);return toMcpResult(result);- }, "Failed: production_getJobOperationsByMethodId")+ }, "Failed: production_getJobOperationsByMethodId"),);server.registerTool(@@ -1109,23 +990,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get job operation step records",inputSchema: {- jobId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getJobOperationStepRecords(- ctx.client,- params.jobId,- params.args- );+ const result = await getJobOperationStepRecords(ctx.client, params.jobId, params.args);return toMcpResult(result);- }, "Failed: production_getJobOperationStepRecords")+ }, "Failed: production_getJobOperationStepRecords"),);server.registerTool(@@ -1133,18 +1010,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get outside operations by job id",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOutsideOperationsByJobId(- ctx.client,- params.jobId,- ctx.companyId- );+ const result = await getOutsideOperationsByJobId(ctx.client, params.jobId, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getOutsideOperationsByJobId")+ }, "Failed: production_getOutsideOperationsByJobId"),);server.registerTool(@@ -1152,14 +1025,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedure",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProcedure(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_getProcedure")+ }, "Failed: production_getProcedure"),);server.registerTool(@@ -1167,14 +1040,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedure steps",inputSchema: {- procedureId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ procedureId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProcedureSteps(ctx.client, params.procedureId);return toMcpResult(result);- }, "Failed: production_getProcedureSteps")+ }, "Failed: production_getProcedureSteps"),);server.registerTool(@@ -1182,17 +1055,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedure parameters",inputSchema: {- procedureId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ procedureId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProcedureParameters(- ctx.client,- params.procedureId- );+ const result = await getProcedureParameters(ctx.client, params.procedureId);return toMcpResult(result);- }, "Failed: production_getProcedureParameters")+ }, "Failed: production_getProcedureParameters"),);server.registerTool(@@ -1200,21 +1070,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedure versions",inputSchema: {- procedure: z.object({- name: z.string(),- version: z.number()- })- },- annotations: READ_ONLY_ANNOTATIONS+ procedure: z.object({+ name: z.string(),+ version: z.number()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProcedureVersions(- ctx.client,- params.procedure,- ctx.companyId- );+ const result = await getProcedureVersions(ctx.client, params.procedure, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getProcedureVersions")+ }, "Failed: production_getProcedureVersions"),);server.registerTool(@@ -1222,23 +1088,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedures",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProcedures(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getProcedures(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getProcedures")+ }, "Failed: production_getProcedures"),);server.registerTool(@@ -1246,12 +1106,12 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get procedures list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProceduresList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getProceduresList")+ }, "Failed: production_getProceduresList"),);server.registerTool(@@ -1259,14 +1119,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production event",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProductionEvent(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_getProductionEvent")+ }, "Failed: production_getProductionEvent"),);server.registerTool(@@ -1274,24 +1134,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production events",inputSchema: {- jobOperationIds: z.array(z.string()),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationIds: z.array(z.string()),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionEvents(- ctx.client,- params.jobOperationIds,- params.args- );+ const result = await getProductionEvents(ctx.client, params.jobOperationIds, params.args);return toMcpResult(result);- }, "Failed: production_getProductionEvents")+ }, "Failed: production_getProductionEvents"),);server.registerTool(@@ -1299,22 +1153,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production events page",inputSchema: {- jobOperationId: z.string(),- sortDescending: z.boolean().optional(),- page: z.number().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationId: z.string(),+ sortDescending: z.boolean().optional(),+ page: z.number().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionEventsPage(- ctx.client,- params.jobOperationId,- ctx.companyId,- params.sortDescending,- params.page- );+ const result = await getProductionEventsPage(ctx.client, params.jobOperationId, ctx.companyId, params.sortDescending, params.page);return toMcpResult(result);- }, "Failed: production_getProductionEventsPage")+ }, "Failed: production_getProductionEventsPage"),);server.registerTool(@@ -1322,17 +1170,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production events by operations",inputSchema: {- jobOperationIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionEventsByOperations(- ctx.client,- params.jobOperationIds- );+ const result = await getProductionEventsByOperations(ctx.client, params.jobOperationIds);return toMcpResult(result);- }, "Failed: production_getProductionEventsByOperations")+ }, "Failed: production_getProductionEventsByOperations"),);server.registerTool(@@ -1340,26 +1185,20 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production planning",inputSchema: {- locationId: z.string(),- periods: z.array(z.string()),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ periods: z.array(z.string()),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionPlanning(- ctx.client,- params.locationId,- ctx.companyId,- params.periods,- params.args- );+ const result = await getProductionPlanning(ctx.client, params.locationId, ctx.companyId, params.periods, params.args);return toMcpResult(result);- }, "Failed: production_getProductionPlanning")+ }, "Failed: production_getProductionPlanning"),);server.registerTool(@@ -1367,26 +1206,20 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production projections",inputSchema: {- locationId: z.string(),- periods: z.array(z.string()),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ periods: z.array(z.string()),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionProjections(- ctx.client,- params.locationId,- params.periods,- ctx.companyId,- params.args- );+ const result = await getProductionProjections(ctx.client, params.locationId, params.periods, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getProductionProjections")+ }, "Failed: production_getProductionProjections"),);server.registerTool(@@ -1394,14 +1227,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production quantity",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProductionQuantity(ctx.client, params.id);return toMcpResult(result);- }, "Failed: production_getProductionQuantity")+ }, "Failed: production_getProductionQuantity"),);server.registerTool(@@ -1409,24 +1242,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production quantities",inputSchema: {- jobOperationIds: z.array(z.string()),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationIds: z.array(z.string()),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionQuantities(- ctx.client,- params.jobOperationIds,- params.args- );+ const result = await getProductionQuantities(ctx.client, params.jobOperationIds, params.args);return toMcpResult(result);- }, "Failed: production_getProductionQuantities")+ }, "Failed: production_getProductionQuantities"),);server.registerTool(@@ -1434,17 +1261,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get production data by operations",inputSchema: {- jobOperationIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ jobOperationIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getProductionDataByOperations(- ctx.client,- params.jobOperationIds- );+ const result = await getProductionDataByOperations(ctx.client, params.jobOperationIds);return toMcpResult(result);- }, "Failed: production_getProductionDataByOperations")+ }, "Failed: production_getProductionDataByOperations"),);server.registerTool(@@ -1452,12 +1276,12 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get scrap reasons list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getScrapReasonsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getScrapReasonsList")+ }, "Failed: production_getScrapReasonsList"),);server.registerTool(@@ -1465,14 +1289,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get scrap reason",inputSchema: {- scrapReasonId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ scrapReasonId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getScrapReason(ctx.client, params.scrapReasonId);return toMcpResult(result);- }, "Failed: production_getScrapReason")+ }, "Failed: production_getScrapReason"),);server.registerTool(@@ -1480,24 +1304,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get scrap reasons",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getScrapReasons(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getScrapReasons(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getScrapReasons")+ }, "Failed: production_getScrapReasons"),);server.registerTool(@@ -1505,14 +1323,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get failure mode",inputSchema: {- failureModeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ failureModeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getFailureMode(ctx.client, params.failureModeId);return toMcpResult(result);- }, "Failed: production_getFailureMode")+ }, "Failed: production_getFailureMode"),);server.registerTool(@@ -1520,24 +1338,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get failure modes",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getFailureModes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getFailureModes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getFailureModes")+ }, "Failed: production_getFailureModes"),);server.registerTool(@@ -1545,12 +1357,12 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get failure modes list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getFailureModesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: production_getFailureModesList")+ }, "Failed: production_getFailureModesList"),);server.registerTool(@@ -1558,17 +1370,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatch(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatch(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatch")+ }, "Failed: production_getMaintenanceDispatch"),);server.registerTool(@@ -1576,25 +1385,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatches",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.string().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.string().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatches(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaintenanceDispatches(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatches")+ }, "Failed: production_getMaintenanceDispatches"),);server.registerTool(@@ -1602,17 +1405,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch comments",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchComments(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchComments(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatchComments")+ }, "Failed: production_getMaintenanceDispatchComments"),);server.registerTool(@@ -1620,17 +1420,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch events",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchEvents(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchEvents(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatchEvents")+ }, "Failed: production_getMaintenanceDispatchEvents"),);server.registerTool(@@ -1638,17 +1435,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch items",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchItems(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchItems(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatchItems")+ }, "Failed: production_getMaintenanceDispatchItems"),);server.registerTool(@@ -1656,17 +1450,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch work centers",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchWorkCenters(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchWorkCenters(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: production_getMaintenanceDispatchWorkCenters")+ }, "Failed: production_getMaintenanceDispatchWorkCenters"),);server.registerTool(@@ -1674,17 +1465,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedule",inputSchema: {- scheduleId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceSchedule(- ctx.client,- params.scheduleId- );+ const result = await getMaintenanceSchedule(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: production_getMaintenanceSchedule")+ }, "Failed: production_getMaintenanceSchedule"),);server.registerTool(@@ -1692,25 +1480,19 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedules",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- active: z.boolean().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ active: z.boolean().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceSchedules(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaintenanceSchedules(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: production_getMaintenanceSchedules")+ }, "Failed: production_getMaintenanceSchedules"),);server.registerTool(@@ -1718,17 +1500,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedule items",inputSchema: {- scheduleId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceScheduleItems(- ctx.client,- params.scheduleId- );+ const result = await getMaintenanceScheduleItems(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: production_getMaintenanceScheduleItems")+ }, "Failed: production_getMaintenanceScheduleItems"),);server.registerTool(@@ -1736,14 +1515,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get tracked entity by job id",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrackedEntityByJobId(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getTrackedEntityByJobId")+ }, "Failed: production_getTrackedEntityByJobId"),);server.registerTool(@@ -1751,14 +1530,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "get tracked entities by job id",inputSchema: {- jobId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ jobId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrackedEntitiesByJobId(ctx.client, params.jobId);return toMcpResult(result);- }, "Failed: production_getTrackedEntitiesByJobId")+ }, "Failed: production_getTrackedEntitiesByJobId"),);server.registerTool(@@ -1766,20 +1545,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "recalculate job operation dependencies",inputSchema: {- params: z.object({- jobId: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ jobId: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await recalculateJobOperationDependencies(ctx.client, {- ...params.params,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await recalculateJobOperationDependencies(ctx.client, { ...params.params, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_recalculateJobOperationDependencies")+ }, "Failed: production_recalculateJobOperationDependencies"),);server.registerTool(@@ -1787,20 +1562,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "recalculate job requirements",inputSchema: {- params: z.object({- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await recalculateJobRequirements(ctx.client, {- ...params.params,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await recalculateJobRequirements(ctx.client, { ...params.params, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_recalculateJobRequirements")+ }, "Failed: production_recalculateJobRequirements"),);server.registerTool(@@ -1808,20 +1579,16 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "recalculate job make method requirements",inputSchema: {- params: z.object({- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await recalculateJobMakeMethodRequirements(ctx.client, {- ...params.params,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await recalculateJobMakeMethodRequirements(ctx.client, { ...params.params, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_recalculateJobMakeMethodRequirements")+ }, "Failed: production_recalculateJobMakeMethodRequirements"),);server.registerTool(@@ -1829,21 +1596,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "run m r p",inputSchema: {- params: z.object({- type: z.any(),- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ type: z.any(),+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await runMRP(ctx.client, {- ...params.params,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await runMRP(ctx.client, { ...params.params, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_runMRP")+ }, "Failed: production_runMRP"),);server.registerTool(@@ -1851,19 +1614,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job batch number",inputSchema: {- trackedEntityId: z.string(),- value: z.string()- },- annotations: WRITE_ANNOTATIONS+ trackedEntityId: z.string(),+ value: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobBatchNumber(- ctx.client,- params.trackedEntityId,- params.value- );+ const result = await updateJobBatchNumber(ctx.client, params.trackedEntityId, params.value);return toMcpResult(result);- }, "Failed: production_updateJobBatchNumber")+ }, "Failed: production_updateJobBatchNumber"),);server.registerTool(@@ -1871,21 +1630,18 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job status",inputSchema: {- params: z.object({- id: z.string(),- status: z.any(),- assignee: z.string().nullable().optional()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.string().nullable().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobStatus(ctx.client, {- ...params.params,- updatedBy: ctx.userId- });+ const result = await updateJobStatus(ctx.client, { ...params.params, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateJobStatus")+ }, "Failed: production_updateJobStatus"),);server.registerTool(@@ -1893,20 +1649,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job material order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobMaterialOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateJobMaterialOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateJobMaterialOrder")+ }, "Failed: production_updateJobMaterialOrder"),);server.registerTool(@@ -1914,20 +1667,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job operation order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobOperationOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateJobOperationOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateJobOperationOrder")+ }, "Failed: production_updateJobOperationOrder"),);server.registerTool(@@ -1935,20 +1685,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job operation step order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobOperationStepOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateJobOperationStepOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateJobOperationStepOrder")+ }, "Failed: production_updateJobOperationStepOrder"),);server.registerTool(@@ -1956,21 +1703,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update kanban job",inputSchema: {- params: z.object({- id: z.string(),- jobId: z.string().nullable()- })- },- annotations: WRITE_ANNOTATIONS+ params: z.object({+ id: z.string(),+ jobId: z.string().nullable()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateKanbanJob(ctx.client, {- ...params.params,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await updateKanbanJob(ctx.client, { ...params.params, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateKanbanJob")+ }, "Failed: production_updateKanbanJob"),);server.registerTool(@@ -1978,20 +1721,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update quote operation step order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteOperationStepOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateQuoteOperationStepOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateQuoteOperationStepOrder")+ }, "Failed: production_updateQuoteOperationStepOrder"),);server.registerTool(@@ -1999,20 +1739,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update method operation step order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMethodOperationStepOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateMethodOperationStepOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateMethodOperationStepOrder")+ }, "Failed: production_updateMethodOperationStepOrder"),);server.registerTool(@@ -2020,20 +1757,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job operation status",inputSchema: {- id: z.string(),- status: z.any()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ status: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobOperationStatus(- ctx.client,- params.id,- params.status,- ctx.userId- );+ const result = await updateJobOperationStatus(ctx.client, params.id, params.status, ctx.userId);return toMcpResult(result);- }, "Failed: production_updateJobOperationStatus")+ }, "Failed: production_updateJobOperationStatus"),);server.registerTool(@@ -2041,20 +1773,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update job operation due date",inputSchema: {- id: z.string(),- dueDate: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ dueDate: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobOperationDueDate(- ctx.client,- params.id,- params.dueDate,- ctx.userId- );+ const result = await updateJobOperationDueDate(ctx.client, params.id, params.dueDate, ctx.userId);return toMcpResult(result);- }, "Failed: production_updateJobOperationDueDate")+ }, "Failed: production_updateJobOperationDueDate"),);server.registerTool(@@ -2062,20 +1789,17 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update procedure step order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateProcedureStepOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateProcedureStepOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateProcedureStepOrder")+ }, "Failed: production_updateProcedureStepOrder"),);server.registerTool(@@ -2083,19 +1807,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert production event",inputSchema: {- productionEvent: productionEventValidator- },- annotations: WRITE_ANNOTATIONS+ productionEvent: productionEventValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProductionEvent(ctx.client, {- ...params.productionEvent,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertProductionEvent(ctx.client, { ...params.productionEvent, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertProductionEvent")+ }, "Failed: production_upsertProductionEvent"),);server.registerTool(@@ -2103,18 +1822,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "update production quantity",inputSchema: {- productionQuantity: productionQuantityValidator- },- annotations: WRITE_ANNOTATIONS+ productionQuantity: productionQuantityValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateProductionQuantity(ctx.client, {- ...params.productionQuantity,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await updateProductionQuantity(ctx.client, { ...params.productionQuantity, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_updateProductionQuantity")+ }, "Failed: production_updateProductionQuantity"),);server.registerTool(@@ -2122,18 +1837,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert production quantity",inputSchema: {- productionQuantity: productionQuantityValidator- },- annotations: WRITE_ANNOTATIONS+ productionQuantity: productionQuantityValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProductionQuantity(ctx.client, {- ...params.productionQuantity,- companyId: ctx.companyId,- updatedBy: ctx.userId- });+ const result = await upsertProductionQuantity(ctx.client, { ...params.productionQuantity, companyId: ctx.companyId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertProductionQuantity")+ }, "Failed: production_upsertProductionQuantity"),);server.registerTool(@@ -2141,24 +1852,15 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job",inputSchema: {- job: jobValidator,- status: z.any().optional()- },- annotations: WRITE_ANNOTATIONS+ job: jobValidator,+ status: z.any().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJob(- ctx.client,- {- ...params.job,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- },- params.status- );+ const result = await upsertJob(ctx.client, { ...params.job, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId }, params.status);return toMcpResult(result);- }, "Failed: production_upsertJob")+ }, "Failed: production_upsertJob"),);server.registerTool(@@ -2166,19 +1868,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job material",inputSchema: {- jobMaterial: jobMaterialValidator- },- annotations: WRITE_ANNOTATIONS+ jobMaterial: jobMaterialValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobMaterial(ctx.client, {- ...params.jobMaterial,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertJobMaterial(ctx.client, { ...params.jobMaterial, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobMaterial")+ }, "Failed: production_upsertJobMaterial"),);server.registerTool(@@ -2186,19 +1883,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job operation",inputSchema: {- jobOperation: jobOperationValidator- },- annotations: WRITE_ANNOTATIONS+ jobOperation: jobOperationValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobOperation(ctx.client, {- ...params.jobOperation,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertJobOperation(ctx.client, { ...params.jobOperation, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobOperation")+ }, "Failed: production_upsertJobOperation"),);server.registerTool(@@ -2206,19 +1898,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job operation step",inputSchema: {- jobOperationStep: operationStepValidator- },- annotations: WRITE_ANNOTATIONS+ jobOperationStep: operationStepValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobOperationStep(ctx.client, {- ...params.jobOperationStep,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertJobOperationStep(ctx.client, { ...params.jobOperationStep, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobOperationStep")+ }, "Failed: production_upsertJobOperationStep"),);server.registerTool(@@ -2226,19 +1913,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job operation parameter",inputSchema: {- jobOperationParameter: operationParameterValidator- },- annotations: WRITE_ANNOTATIONS+ jobOperationParameter: operationParameterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobOperationParameter(ctx.client, {- ...params.jobOperationParameter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertJobOperationParameter(ctx.client, { ...params.jobOperationParameter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobOperationParameter")+ }, "Failed: production_upsertJobOperationParameter"),);server.registerTool(@@ -2246,19 +1928,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job operation tool",inputSchema: {- jobOperationTool: operationToolValidator- },- annotations: WRITE_ANNOTATIONS+ jobOperationTool: operationToolValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobOperationTool(ctx.client, {- ...params.jobOperationTool,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertJobOperationTool(ctx.client, { ...params.jobOperationTool, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobOperationTool")+ }, "Failed: production_upsertJobOperationTool"),);server.registerTool(@@ -2266,30 +1943,26 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job method",inputSchema: {- type: z.string(),- jobMethod: z.object({- sourceId: z.string(),- targetId: z.string(),- configuration: z.any().optional(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ type: z.string(),+ jobMethod: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ configuration: z.any().optional(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobMethod(ctx.client, params.type, {- ...params.jobMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertJobMethod(ctx.client, params.type, { ...params.jobMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobMethod")+ }, "Failed: production_upsertJobMethod"),);server.registerTool(@@ -2297,29 +1970,25 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert job material make method",inputSchema: {- jobMaterial: z.object({- sourceId: z.string(),- targetId: z.string(),- configuration: z.any().optional(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ jobMaterial: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ configuration: z.any().optional(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertJobMaterialMakeMethod(ctx.client, {- ...params.jobMaterial,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertJobMaterialMakeMethod(ctx.client, { ...params.jobMaterial, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertJobMaterialMakeMethod")+ }, "Failed: production_upsertJobMaterialMakeMethod"),);server.registerTool(@@ -2327,28 +1996,24 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert make method from job",inputSchema: {- jobMethod: z.object({- sourceId: z.string(),- targetId: z.string(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ jobMethod: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMakeMethodFromJob(ctx.client, {- ...params.jobMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertMakeMethodFromJob(ctx.client, { ...params.jobMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMakeMethodFromJob")+ }, "Failed: production_upsertMakeMethodFromJob"),);server.registerTool(@@ -2356,28 +2021,24 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert make method from job method",inputSchema: {- jobMethod: z.object({- sourceId: z.string(),- targetId: z.string(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ jobMethod: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMakeMethodFromJobMethod(ctx.client, {- ...params.jobMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertMakeMethodFromJobMethod(ctx.client, { ...params.jobMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMakeMethodFromJobMethod")+ }, "Failed: production_upsertMakeMethodFromJobMethod"),);server.registerTool(@@ -2385,19 +2046,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert procedure",inputSchema: {- procedure: procedureValidator- },- annotations: WRITE_ANNOTATIONS+ procedure: procedureValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProcedure(ctx.client, {- ...params.procedure,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertProcedure(ctx.client, { ...params.procedure, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertProcedure")+ }, "Failed: production_upsertProcedure"),);server.registerTool(@@ -2405,19 +2061,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert procedure step",inputSchema: {- procedureStep: procedureStepValidator- },- annotations: WRITE_ANNOTATIONS+ procedureStep: procedureStepValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProcedureStep(ctx.client, {- ...params.procedureStep,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertProcedureStep(ctx.client, { ...params.procedureStep, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertProcedureStep")+ }, "Failed: production_upsertProcedureStep"),);server.registerTool(@@ -2425,19 +2076,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert procedure parameter",inputSchema: {- procedureParameter: procedureParameterValidator- },- annotations: WRITE_ANNOTATIONS+ procedureParameter: procedureParameterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProcedureParameter(ctx.client, {- ...params.procedureParameter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertProcedureParameter(ctx.client, { ...params.procedureParameter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertProcedureParameter")+ }, "Failed: production_upsertProcedureParameter"),);server.registerTool(@@ -2445,19 +2091,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert scrap reason",inputSchema: {- scrapReason: scrapReasonValidator- },- annotations: WRITE_ANNOTATIONS+ scrapReason: scrapReasonValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertScrapReason(ctx.client, {- ...params.scrapReason,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertScrapReason(ctx.client, { ...params.scrapReason, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertScrapReason")+ }, "Failed: production_upsertScrapReason"),);server.registerTool(@@ -2465,19 +2106,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert failure mode",inputSchema: {- failureMode: failureModeValidator- },- annotations: WRITE_ANNOTATIONS+ failureMode: failureModeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertFailureMode(ctx.client, {- ...params.failureMode,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertFailureMode(ctx.client, { ...params.failureMode, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertFailureMode")+ }, "Failed: production_upsertFailureMode"),);server.registerTool(@@ -2485,19 +2121,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch",inputSchema: {- dispatch: maintenanceDispatchValidator- },- annotations: WRITE_ANNOTATIONS+ dispatch: maintenanceDispatchValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatch(ctx.client, {- ...params.dispatch,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatch(ctx.client, { ...params.dispatch, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceDispatch")+ }, "Failed: production_upsertMaintenanceDispatch"),);server.registerTool(@@ -2505,19 +2136,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch comment",inputSchema: {- comment: maintenanceDispatchCommentValidator- },- annotations: WRITE_ANNOTATIONS+ comment: maintenanceDispatchCommentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchComment(ctx.client, {- ...params.comment,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchComment(ctx.client, { ...params.comment, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceDispatchComment")+ }, "Failed: production_upsertMaintenanceDispatchComment"),);server.registerTool(@@ -2525,19 +2151,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch event",inputSchema: {- event: maintenanceDispatchEventValidator- },- annotations: WRITE_ANNOTATIONS+ event: maintenanceDispatchEventValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchEvent(ctx.client, {- ...params.event,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchEvent(ctx.client, { ...params.event, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceDispatchEvent")+ }, "Failed: production_upsertMaintenanceDispatchEvent"),);server.registerTool(@@ -2545,19 +2166,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch item",inputSchema: {- item: maintenanceDispatchItemValidator- },- annotations: WRITE_ANNOTATIONS+ item: maintenanceDispatchItemValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchItem(ctx.client, {- ...params.item,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchItem(ctx.client, { ...params.item, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceDispatchItem")+ }, "Failed: production_upsertMaintenanceDispatchItem"),);server.registerTool(@@ -2565,19 +2181,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch work center",inputSchema: {- workCenter: maintenanceDispatchWorkCenterValidator- },- annotations: WRITE_ANNOTATIONS+ workCenter: maintenanceDispatchWorkCenterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchWorkCenter(ctx.client, {- ...params.workCenter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchWorkCenter(ctx.client, { ...params.workCenter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceDispatchWorkCenter")+ }, "Failed: production_upsertMaintenanceDispatchWorkCenter"),);server.registerTool(@@ -2585,19 +2196,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance schedule",inputSchema: {- schedule: maintenanceScheduleValidator- },- annotations: WRITE_ANNOTATIONS+ schedule: maintenanceScheduleValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceSchedule(ctx.client, {- ...params.schedule,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceSchedule(ctx.client, { ...params.schedule, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceSchedule")+ }, "Failed: production_upsertMaintenanceSchedule"),);server.registerTool(@@ -2605,19 +2211,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance schedule item",inputSchema: {- item: maintenanceScheduleItemValidator- },- annotations: WRITE_ANNOTATIONS+ item: maintenanceScheduleItemValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceScheduleItem(ctx.client, {- ...params.item,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceScheduleItem(ctx.client, { ...params.item, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertMaintenanceScheduleItem")+ }, "Failed: production_upsertMaintenanceScheduleItem"),);server.registerTool(@@ -2625,19 +2226,14 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert demand forecasts",inputSchema: {- forecasts: z.any()- },- annotations: WRITE_ANNOTATIONS+ forecasts: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertDemandForecasts(ctx.client, {- ...params.forecasts,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertDemandForecasts(ctx.client, { ...params.forecasts, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertDemandForecasts")+ }, "Failed: production_upsertDemandForecasts"),);server.registerTool(@@ -2645,18 +2241,13 @@ export const registerProductionTools: RegisterTools = (server, ctx) => {{description: "upsert demand projections",inputSchema: {- forecasts: z.any()- },- annotations: WRITE_ANNOTATIONS+ forecasts: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertDemandProjections(ctx.client, {- ...params.forecasts,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertDemandProjections(ctx.client, { ...params.forecasts, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: production_upsertDemandProjections")+ }, "Failed: production_upsertDemandProjections"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/purchasing.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/purchasing.tsindex 2713f7afaf..6419e5f893 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/purchasing.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/purchasing.ts@@ -1,29 +1,19 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- purchaseOrderDeliveryValidator,- purchaseOrderLineValidator,- purchaseOrderPaymentValidator,- purchaseOrderValidator,- selectedLinesValidator,- supplierAccountingValidator,- supplierContactValidator,- supplierPaymentValidator,- supplierProcessValidator,- supplierQuoteLineValidator,- supplierQuoteValidator,- supplierShippingValidator,- supplierTypeValidator,- supplierValidator-} from "~/modules/purchasing/purchasing.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {closePurchaseOrder,convertSupplierQuoteToOrder,deletePurchaseOrder,deletePurchaseOrderLine,- deletePurchasingRFQ,- deletePurchasingRFQLine,deleteSupplier,deleteSupplierContact,deleteSupplierLocation,@@ -31,30 +21,18 @@ import {deleteSupplierQuote,deleteSupplierQuoteLine,deleteSupplierType,- finalizePurchaseOrder,- finalizeSupplierQuote,- getLinkedPurchasingRfqs,- getLinkedPurchasingRfqsForInteraction,- getLinkedPurchasingRfqsForOrder,- getLinkedSupplierQuotes,getPurchaseOrder,+ finalizeSupplierQuote,+ getPurchaseOrders,getPurchaseOrderDelivery,- getPurchaseOrderLine,- getPurchaseOrderLines,getPurchaseOrderLocations,getPurchaseOrderPayment,+ getPurchaseOrderLines,+ getPurchaseOrderLine,getPurchaseOrderSuppliers,- getPurchaseOrders,getPurchasingDocumentsAssignedToMe,getPurchasingPlanning,- getPurchasingRFQ,- getPurchasingRFQLine,- getPurchasingRFQLines,- getPurchasingRFQSuppliers,- getPurchasingRFQSuppliersWithLinks,- getPurchasingRFQs,getPurchasingTerms,- getSiblingQuotesForQuote,getSupplier,getSupplierApprovalContext,getSupplierContact,@@ -62,21 +40,20 @@ import {getSupplierInteraction,getSupplierInteractionDocuments,getSupplierInteractionLineDocuments,- getSupplierLocation,getSupplierLocations,+ getSupplierLocation,getSupplierPayment,getSupplierProcessById,getSupplierProcessesByProcess,getSupplierProcessesBySupplier,getSupplierQuote,- getSupplierQuoteByExternalLinkId,getSupplierQuoteByInteractionId,+ getSupplierQuoteByExternalLinkId,+ getSupplierQuotes,getSupplierQuoteLine,+ getSupplierQuoteLines,getSupplierQuoteLinePrices,getSupplierQuoteLinePricesByQuoteId,- getSupplierQuoteLines,- getSupplierQuotes,- getSupplierQuotesForComparison,getSupplierQuotesList,getSupplierShipping,getSuppliers,@@ -88,12 +65,12 @@ import {insertSupplierContact,insertSupplierInteraction,insertSupplierLocation,+ finalizePurchaseOrder,sendSupplierQuote,updatePurchaseOrder,updatePurchaseOrderExchangeRate,updatePurchaseOrderFavorite,updatePurchaseOrderStatus,- updatePurchasingRFQStatus,updateSupplierAccounting,updateSupplierContact,updateSupplierLocation,@@ -106,23 +83,46 @@ import {upsertPurchaseOrderDelivery,upsertPurchaseOrderLine,upsertPurchaseOrderPayment,- upsertPurchasingRFQ,- upsertPurchasingRFQLine,- upsertPurchasingRFQSuppliers,upsertSupplier,upsertSupplierProcess,upsertSupplierQuote,upsertSupplierQuoteLine,- upsertSupplierType+ upsertSupplierType,+ deletePurchasingRFQ,+ deletePurchasingRFQLine,+ getPurchasingRFQ,+ getPurchasingRFQs,+ getPurchasingRFQLine,+ getPurchasingRFQLines,+ getPurchasingRFQSuppliers,+ upsertPurchasingRFQ,+ upsertPurchasingRFQLine,+ upsertPurchasingRFQSuppliers,+ updatePurchasingRFQStatus,+ getLinkedSupplierQuotes,+ getLinkedPurchasingRfqs,+ getLinkedPurchasingRfqsForInteraction,+ getSiblingQuotesForQuote,+ getLinkedPurchasingRfqsForOrder,+ getSupplierQuotesForComparison,+ getPurchasingRFQSuppliersWithLinks,} from "~/modules/purchasing/purchasing.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ selectedLinesValidator,+ supplierValidator,+ supplierContactValidator,+ supplierAccountingValidator,+ supplierPaymentValidator,+ supplierShippingValidator,+ purchaseOrderValidator,+ purchaseOrderDeliveryValidator,+ purchaseOrderLineValidator,+ purchaseOrderPaymentValidator,+ supplierProcessValidator,+ supplierQuoteValidator,+ supplierQuoteLineValidator,+ supplierTypeValidator,+} from "~/modules/purchasing/purchasing.models";export const registerPurchasingTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -130,18 +130,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "close purchase order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await closePurchaseOrder(- ctx.client,- params.purchaseOrderId,- ctx.userId- );+ const result = await closePurchaseOrder(ctx.client, params.purchaseOrderId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_closePurchaseOrder")+ }, "Failed: purchasing_closePurchaseOrder"),);server.registerTool(@@ -149,18 +145,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "convert supplier quote to order",inputSchema: {- payload: selectedLinesValidator- },- annotations: WRITE_ANNOTATIONS+ payload: selectedLinesValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await convertSupplierQuoteToOrder(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await convertSupplierQuoteToOrder(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_convertSupplierQuoteToOrder")+ }, "Failed: purchasing_convertSupplierQuoteToOrder"),);server.registerTool(@@ -168,17 +160,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete purchase order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchaseOrder(- ctx.client,- params.purchaseOrderId- );+ const result = await deletePurchaseOrder(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_deletePurchaseOrder")+ }, "Failed: purchasing_deletePurchaseOrder"),);server.registerTool(@@ -186,17 +175,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete purchase order line",inputSchema: {- purchaseOrderLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchaseOrderLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchaseOrderLine(- ctx.client,- params.purchaseOrderLineId- );+ const result = await deletePurchaseOrderLine(ctx.client, params.purchaseOrderLineId);return toMcpResult(result);- }, "Failed: purchasing_deletePurchaseOrderLine")+ }, "Failed: purchasing_deletePurchaseOrderLine"),);server.registerTool(@@ -204,14 +190,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier",inputSchema: {- supplierId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSupplier(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplier")+ }, "Failed: purchasing_deleteSupplier"),);server.registerTool(@@ -219,19 +205,15 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier contact",inputSchema: {- supplierId: z.string(),- supplierContactId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierId: z.string(),+ supplierContactId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSupplierContact(- ctx.client,- params.supplierId,- params.supplierContactId- );+ const result = await deleteSupplierContact(ctx.client, params.supplierId, params.supplierContactId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierContact")+ }, "Failed: purchasing_deleteSupplierContact"),);server.registerTool(@@ -239,19 +221,15 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier location",inputSchema: {- supplierId: z.string(),- supplierLocationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierId: z.string(),+ supplierLocationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSupplierLocation(- ctx.client,- params.supplierId,- params.supplierLocationId- );+ const result = await deleteSupplierLocation(ctx.client, params.supplierId, params.supplierLocationId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierLocation")+ }, "Failed: purchasing_deleteSupplierLocation"),);server.registerTool(@@ -259,17 +237,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier process",inputSchema: {- supplierProcessId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierProcessId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSupplierProcess(- ctx.client,- params.supplierProcessId- );+ const result = await deleteSupplierProcess(ctx.client, params.supplierProcessId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierProcess")+ }, "Failed: purchasing_deleteSupplierProcess"),);server.registerTool(@@ -277,17 +252,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier quote",inputSchema: {- supplierQuoteId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSupplierQuote(- ctx.client,- params.supplierQuoteId- );+ const result = await deleteSupplierQuote(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierQuote")+ }, "Failed: purchasing_deleteSupplierQuote"),);server.registerTool(@@ -295,14 +267,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier quote line",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSupplierQuoteLine(ctx.client, params.id);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierQuoteLine")+ }, "Failed: purchasing_deleteSupplierQuoteLine"),);server.registerTool(@@ -310,17 +282,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete supplier type",inputSchema: {- supplierTypeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ supplierTypeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSupplierType(- ctx.client,- params.supplierTypeId- );+ const result = await deleteSupplierType(ctx.client, params.supplierTypeId);return toMcpResult(result);- }, "Failed: purchasing_deleteSupplierType")+ }, "Failed: purchasing_deleteSupplierType"),);server.registerTool(@@ -328,14 +297,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchaseOrder(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrder")+ }, "Failed: purchasing_getPurchaseOrder"),);server.registerTool(@@ -343,18 +312,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "finalize supplier quote",inputSchema: {- supplierQuoteId: z.string()- },- annotations: WRITE_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await finalizeSupplierQuote(- ctx.client,- params.supplierQuoteId,- ctx.userId- );+ const result = await finalizeSupplierQuote(ctx.client, params.supplierQuoteId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_finalizeSupplierQuote")+ }, "Failed: purchasing_finalizeSupplierQuote"),);server.registerTool(@@ -362,24 +327,20 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase orders",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.string().nullable(),- supplierId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.string().nullable(),+ supplierId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrders(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPurchaseOrders(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrders")+ }, "Failed: purchasing_getPurchaseOrders"),);server.registerTool(@@ -387,17 +348,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order delivery",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrderDelivery(- ctx.client,- params.purchaseOrderId- );+ const result = await getPurchaseOrderDelivery(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderDelivery")+ }, "Failed: purchasing_getPurchaseOrderDelivery"),);server.registerTool(@@ -405,17 +363,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order locations",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrderLocations(- ctx.client,- params.purchaseOrderId- );+ const result = await getPurchaseOrderLocations(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderLocations")+ }, "Failed: purchasing_getPurchaseOrderLocations"),);server.registerTool(@@ -423,17 +378,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order payment",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrderPayment(- ctx.client,- params.purchaseOrderId- );+ const result = await getPurchaseOrderPayment(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderPayment")+ }, "Failed: purchasing_getPurchaseOrderPayment"),);server.registerTool(@@ -441,17 +393,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order lines",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrderLines(- ctx.client,- params.purchaseOrderId- );+ const result = await getPurchaseOrderLines(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderLines")+ }, "Failed: purchasing_getPurchaseOrderLines"),);server.registerTool(@@ -459,17 +408,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order line",inputSchema: {- purchaseOrderLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchaseOrderLine(- ctx.client,- params.purchaseOrderLineId- );+ const result = await getPurchaseOrderLine(ctx.client, params.purchaseOrderLineId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderLine")+ }, "Failed: purchasing_getPurchaseOrderLine"),);server.registerTool(@@ -477,12 +423,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchase order suppliers",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchaseOrderSuppliers(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getPurchaseOrderSuppliers")+ }, "Failed: purchasing_getPurchaseOrderSuppliers"),);server.registerTool(@@ -490,16 +436,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing documents assigned to me",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingDocumentsAssignedToMe(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getPurchasingDocumentsAssignedToMe(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingDocumentsAssignedToMe")+ }, "Failed: purchasing_getPurchasingDocumentsAssignedToMe"),);server.registerTool(@@ -507,26 +449,20 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing planning",inputSchema: {- locationId: z.string(),- periods: z.array(z.string()),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ periods: z.array(z.string()),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingPlanning(- ctx.client,- params.locationId,- ctx.companyId,- params.periods,- params.args- );+ const result = await getPurchasingPlanning(ctx.client, params.locationId, ctx.companyId, params.periods, params.args);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingPlanning")+ }, "Failed: purchasing_getPurchasingPlanning"),);server.registerTool(@@ -534,12 +470,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing terms",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchasingTerms(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingTerms")+ }, "Failed: purchasing_getPurchasingTerms"),);server.registerTool(@@ -547,14 +483,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplier(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplier")+ }, "Failed: purchasing_getSupplier"),);server.registerTool(@@ -562,21 +498,15 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier approval context",inputSchema: {- supplierId: z.string(),- status: z.string().nullable()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ status: z.string().nullable(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierApprovalContext(- ctx.client,- params.supplierId,- params.status,- ctx.companyId,- ctx.userId- );+ const result = await getSupplierApprovalContext(ctx.client, params.supplierId, params.status, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierApprovalContext")+ }, "Failed: purchasing_getSupplierApprovalContext"),);server.registerTool(@@ -584,17 +514,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier contact",inputSchema: {- supplierContactId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierContactId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierContact(- ctx.client,- params.supplierContactId- );+ const result = await getSupplierContact(ctx.client, params.supplierContactId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierContact")+ }, "Failed: purchasing_getSupplierContact"),);server.registerTool(@@ -602,14 +529,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier contacts",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierContacts(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierContacts")+ }, "Failed: purchasing_getSupplierContacts"),);server.registerTool(@@ -617,17 +544,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier interaction",inputSchema: {- opportunityId: z.string().nullable()- },- annotations: READ_ONLY_ANNOTATIONS+ opportunityId: z.string().nullable(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierInteraction(- ctx.client,- params.opportunityId- );+ const result = await getSupplierInteraction(ctx.client, params.opportunityId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierInteraction")+ }, "Failed: purchasing_getSupplierInteraction"),);server.registerTool(@@ -635,18 +559,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier interaction documents",inputSchema: {- interactionId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ interactionId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierInteractionDocuments(- ctx.client,- ctx.companyId,- params.interactionId- );+ const result = await getSupplierInteractionDocuments(ctx.client, ctx.companyId, params.interactionId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierInteractionDocuments")+ }, "Failed: purchasing_getSupplierInteractionDocuments"),);server.registerTool(@@ -654,18 +574,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier interaction line documents",inputSchema: {- lineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ lineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierInteractionLineDocuments(- ctx.client,- ctx.companyId,- params.lineId- );+ const result = await getSupplierInteractionLineDocuments(ctx.client, ctx.companyId, params.lineId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierInteractionLineDocuments")+ }, "Failed: purchasing_getSupplierInteractionLineDocuments"),);server.registerTool(@@ -673,14 +589,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier locations",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierLocations(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierLocations")+ }, "Failed: purchasing_getSupplierLocations"),);server.registerTool(@@ -688,17 +604,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier location",inputSchema: {- supplierContactId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierContactId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierLocation(- ctx.client,- params.supplierContactId- );+ const result = await getSupplierLocation(ctx.client, params.supplierContactId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierLocation")+ }, "Failed: purchasing_getSupplierLocation"),);server.registerTool(@@ -706,14 +619,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier payment",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierPayment(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierPayment")+ }, "Failed: purchasing_getSupplierPayment"),);server.registerTool(@@ -721,17 +634,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier process by id",inputSchema: {- supplierProcessId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierProcessId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierProcessById(- ctx.client,- params.supplierProcessId- );+ const result = await getSupplierProcessById(ctx.client, params.supplierProcessId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierProcessById")+ }, "Failed: purchasing_getSupplierProcessById"),);server.registerTool(@@ -739,17 +649,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier processes by process",inputSchema: {- processId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ processId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierProcessesByProcess(- ctx.client,- params.processId- );+ const result = await getSupplierProcessesByProcess(ctx.client, params.processId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierProcessesByProcess")+ }, "Failed: purchasing_getSupplierProcessesByProcess"),);server.registerTool(@@ -757,17 +664,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier processes by supplier",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierProcessesBySupplier(- ctx.client,- params.supplierId- );+ const result = await getSupplierProcessesBySupplier(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierProcessesBySupplier")+ }, "Failed: purchasing_getSupplierProcessesBySupplier"),);server.registerTool(@@ -775,14 +679,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote",inputSchema: {- supplierQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierQuote(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuote")+ }, "Failed: purchasing_getSupplierQuote"),);server.registerTool(@@ -790,17 +694,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote by interaction id",inputSchema: {- interactionId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ interactionId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteByInteractionId(- ctx.client,- params.interactionId- );+ const result = await getSupplierQuoteByInteractionId(ctx.client, params.interactionId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteByInteractionId")+ }, "Failed: purchasing_getSupplierQuoteByInteractionId"),);server.registerTool(@@ -808,17 +709,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote by external link id",inputSchema: {- externalLinkId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ externalLinkId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteByExternalLinkId(- ctx.client,- params.externalLinkId- );+ const result = await getSupplierQuoteByExternalLinkId(ctx.client, params.externalLinkId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteByExternalLinkId")+ }, "Failed: purchasing_getSupplierQuoteByExternalLinkId"),);server.registerTool(@@ -826,22 +724,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quotes",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuotes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSupplierQuotes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuotes")+ }, "Failed: purchasing_getSupplierQuotes"),);server.registerTool(@@ -849,17 +743,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote line",inputSchema: {- supplierQuoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteLine(- ctx.client,- params.supplierQuoteLineId- );+ const result = await getSupplierQuoteLine(ctx.client, params.supplierQuoteLineId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteLine")+ }, "Failed: purchasing_getSupplierQuoteLine"),);server.registerTool(@@ -867,17 +758,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote lines",inputSchema: {- supplierQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteLines(- ctx.client,- params.supplierQuoteId- );+ const result = await getSupplierQuoteLines(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteLines")+ }, "Failed: purchasing_getSupplierQuoteLines"),);server.registerTool(@@ -885,17 +773,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote line prices",inputSchema: {- supplierQuoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteLinePrices(- ctx.client,- params.supplierQuoteLineId- );+ const result = await getSupplierQuoteLinePrices(ctx.client, params.supplierQuoteLineId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteLinePrices")+ }, "Failed: purchasing_getSupplierQuoteLinePrices"),);server.registerTool(@@ -903,17 +788,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quote line prices by quote id",inputSchema: {- supplierQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuoteLinePricesByQuoteId(- ctx.client,- params.supplierQuoteId- );+ const result = await getSupplierQuoteLinePricesByQuoteId(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuoteLinePricesByQuoteId")+ }, "Failed: purchasing_getSupplierQuoteLinePricesByQuoteId"),);server.registerTool(@@ -921,12 +803,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quotes list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierQuotesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuotesList")+ }, "Failed: purchasing_getSupplierQuotesList"),);server.registerTool(@@ -934,14 +816,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier shipping",inputSchema: {- supplierId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierShipping(ctx.client, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierShipping")+ }, "Failed: purchasing_getSupplierShipping"),);server.registerTool(@@ -949,20 +831,20 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get suppliers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- type: z.string().nullable(),- status: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ type: z.string().nullable(),+ status: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSuppliers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: purchasing_getSuppliers")+ }, "Failed: purchasing_getSuppliers"),);server.registerTool(@@ -970,12 +852,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get suppliers list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSuppliersList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getSuppliersList")+ }, "Failed: purchasing_getSuppliersList"),);server.registerTool(@@ -983,14 +865,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier type",inputSchema: {- supplierTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierType(ctx.client, params.supplierTypeId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierType")+ }, "Failed: purchasing_getSupplierType"),);server.registerTool(@@ -998,24 +880,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSupplierTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: purchasing_getSupplierTypes")+ }, "Failed: purchasing_getSupplierTypes"),);server.registerTool(@@ -1023,12 +899,12 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier types list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSupplierTypesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierTypesList")+ }, "Failed: purchasing_getSupplierTypesList"),);server.registerTool(@@ -1036,18 +912,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "insert supplier",inputSchema: {- supplier: supplierValidator- },- annotations: WRITE_ANNOTATIONS+ supplier: supplierValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertSupplier(ctx.client, {- ...params.supplier,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertSupplier(ctx.client, { ...params.supplier, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_insertSupplier")+ }, "Failed: purchasing_insertSupplier"),);server.registerTool(@@ -1055,17 +927,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "insert supplier contact",inputSchema: {- supplierContact: supplierContactValidator- },- annotations: WRITE_ANNOTATIONS+ supplierContact: supplierContactValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertSupplierContact(ctx.client, {- ...params.supplierContact,- companyId: ctx.companyId- });+ const result = await insertSupplierContact(ctx.client, { ...params.supplierContact, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: purchasing_insertSupplierContact")+ }, "Failed: purchasing_insertSupplierContact"),);server.registerTool(@@ -1073,18 +942,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "insert supplier interaction",inputSchema: {- supplierId: z.string()- },- annotations: WRITE_ANNOTATIONS+ supplierId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertSupplierInteraction(- ctx.client,- ctx.companyId,- params.supplierId- );+ const result = await insertSupplierInteraction(ctx.client, ctx.companyId, params.supplierId);return toMcpResult(result);- }, "Failed: purchasing_insertSupplierInteraction")+ }, "Failed: purchasing_insertSupplierInteraction"),);server.registerTool(@@ -1092,28 +957,25 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "insert supplier location",inputSchema: {- supplierLocation: z.object({- supplierId: z.string(),- name: z.string(),- address: z.any(),- addressLine1: z.string().optional(),- addressLine2: z.string().optional(),- city: z.string().optional(),- stateProvince: z.string().optional(),- postalCode: z.string().optional(),- countryCode: z.string().optional(),- customFields: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ supplierLocation: z.object({+ supplierId: z.string(),+ name: z.string(),+ address: z.any(),+ addressLine1: z.string().optional(),+ addressLine2: z.string().optional(),+ city: z.string().optional(),+ stateProvince: z.string().optional(),+ postalCode: z.string().optional(),+ countryCode: z.string().optional(),+ customFields: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertSupplierLocation(ctx.client, {- ...params.supplierLocation,- companyId: ctx.companyId- });+ const result = await insertSupplierLocation(ctx.client, { ...params.supplierLocation, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: purchasing_insertSupplierLocation")+ }, "Failed: purchasing_insertSupplierLocation"),);server.registerTool(@@ -1121,18 +983,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "finalize purchase order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await finalizePurchaseOrder(- ctx.client,- params.purchaseOrderId,- ctx.userId- );+ const result = await finalizePurchaseOrder(ctx.client, params.purchaseOrderId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_finalizePurchaseOrder")+ }, "Failed: purchasing_finalizePurchaseOrder"),);server.registerTool(@@ -1140,18 +998,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "send supplier quote",inputSchema: {- supplierQuoteId: z.string()- },- annotations: WRITE_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await sendSupplierQuote(- ctx.client,- params.supplierQuoteId,- ctx.userId- );+ const result = await sendSupplierQuote(ctx.client, params.supplierQuoteId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_sendSupplierQuote")+ }, "Failed: purchasing_sendSupplierQuote"),);server.registerTool(@@ -1159,20 +1013,17 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update purchase order",inputSchema: {- purchaseOrder: z.object({- id: z.string(),- status: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ purchaseOrder: z.object({+ id: z.string(),+ status: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseOrder(ctx.client, {- ...params.purchaseOrder,- updatedBy: ctx.userId- });+ const result = await updatePurchaseOrder(ctx.client, { ...params.purchaseOrder, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updatePurchaseOrder")+ }, "Failed: purchasing_updatePurchaseOrder"),);server.registerTool(@@ -1180,20 +1031,17 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update purchase order exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseOrderExchangeRate(- ctx.client,- params.data- );+ const result = await updatePurchaseOrderExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: purchasing_updatePurchaseOrderExchangeRate")+ }, "Failed: purchasing_updatePurchaseOrderExchangeRate"),);server.registerTool(@@ -1201,20 +1049,17 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update purchase order favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseOrderFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updatePurchaseOrderFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updatePurchaseOrderFavorite")+ }, "Failed: purchasing_updatePurchaseOrderFavorite"),);server.registerTool(@@ -1222,21 +1067,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update purchase order status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchaseOrderStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updatePurchaseOrderStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updatePurchaseOrderStatus")+ }, "Failed: purchasing_updatePurchaseOrderStatus"),);server.registerTool(@@ -1244,17 +1086,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier accounting",inputSchema: {- supplierAccounting: supplierAccountingValidator- },- annotations: WRITE_ANNOTATIONS+ supplierAccounting: supplierAccountingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierAccounting(ctx.client, {- ...params.supplierAccounting,- updatedBy: ctx.userId- });+ const result = await updateSupplierAccounting(ctx.client, { ...params.supplierAccounting, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updateSupplierAccounting")+ }, "Failed: purchasing_updateSupplierAccounting"),);server.registerTool(@@ -1262,17 +1101,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier contact",inputSchema: {- supplierContact: supplierContactValidator- },- annotations: WRITE_ANNOTATIONS+ supplierContact: supplierContactValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierContact(- ctx.client,- params.supplierContact- );+ const result = await updateSupplierContact(ctx.client, params.supplierContact);return toMcpResult(result);- }, "Failed: purchasing_updateSupplierContact")+ }, "Failed: purchasing_updateSupplierContact"),);server.registerTool(@@ -1280,28 +1116,25 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier location",inputSchema: {- supplierLocation: z.object({- addressId: z.string(),- name: z.string(),- address: z.any(),- addressLine1: z.string().optional(),- addressLine2: z.string().optional(),- city: z.string().optional(),- stateProvince: z.string().optional(),- countryCode: z.string().optional(),- postalCode: z.string().optional(),- customFields: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ supplierLocation: z.object({+ addressId: z.string(),+ name: z.string(),+ address: z.any(),+ addressLine1: z.string().optional(),+ addressLine2: z.string().optional(),+ city: z.string().optional(),+ stateProvince: z.string().optional(),+ countryCode: z.string().optional(),+ postalCode: z.string().optional(),+ customFields: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierLocation(- ctx.client,- params.supplierLocation- );+ const result = await updateSupplierLocation(ctx.client, params.supplierLocation);return toMcpResult(result);- }, "Failed: purchasing_updateSupplierLocation")+ }, "Failed: purchasing_updateSupplierLocation"),);server.registerTool(@@ -1309,17 +1142,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier payment",inputSchema: {- supplierPayment: supplierPaymentValidator- },- annotations: WRITE_ANNOTATIONS+ supplierPayment: supplierPaymentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierPayment(ctx.client, {- ...params.supplierPayment,- updatedBy: ctx.userId- });+ const result = await updateSupplierPayment(ctx.client, { ...params.supplierPayment, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updateSupplierPayment")+ }, "Failed: purchasing_updateSupplierPayment"),);server.registerTool(@@ -1327,20 +1157,17 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier quote exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierQuoteExchangeRate(- ctx.client,- params.data- );+ const result = await updateSupplierQuoteExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: purchasing_updateSupplierQuoteExchangeRate")+ }, "Failed: purchasing_updateSupplierQuoteExchangeRate"),);server.registerTool(@@ -1348,20 +1175,17 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier quote favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierQuoteFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateSupplierQuoteFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updateSupplierQuoteFavorite")+ }, "Failed: purchasing_updateSupplierQuoteFavorite"),);server.registerTool(@@ -1369,21 +1193,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier quote status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierQuoteStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateSupplierQuoteStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updateSupplierQuoteStatus")+ }, "Failed: purchasing_updateSupplierQuoteStatus"),);server.registerTool(@@ -1391,17 +1212,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update supplier shipping",inputSchema: {- supplierShipping: supplierShippingValidator- },- annotations: WRITE_ANNOTATIONS+ supplierShipping: supplierShippingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierShipping(ctx.client, {- ...params.supplierShipping,- updatedBy: ctx.userId- });+ const result = await updateSupplierShipping(ctx.client, { ...params.supplierShipping, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updateSupplierShipping")+ }, "Failed: purchasing_updateSupplierShipping"),);server.registerTool(@@ -1409,24 +1227,15 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase order",inputSchema: {- purchaseOrder: purchaseOrderValidator,- receiptRequestedDate: z.string().optional()- },- annotations: WRITE_ANNOTATIONS+ purchaseOrder: purchaseOrderValidator,+ receiptRequestedDate: z.string().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseOrder(- ctx.client,- {- ...params.purchaseOrder,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- },- params.receiptRequestedDate- );+ const result = await upsertPurchaseOrder(ctx.client, { ...params.purchaseOrder, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId }, params.receiptRequestedDate);return toMcpResult(result);- }, "Failed: purchasing_upsertPurchaseOrder")+ }, "Failed: purchasing_upsertPurchaseOrder"),);server.registerTool(@@ -1434,19 +1243,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase order delivery",inputSchema: {- purchaseOrderDelivery: purchaseOrderDeliveryValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderDelivery: purchaseOrderDeliveryValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseOrderDelivery(ctx.client, {- ...params.purchaseOrderDelivery,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseOrderDelivery(ctx.client, { ...params.purchaseOrderDelivery, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertPurchaseOrderDelivery")+ }, "Failed: purchasing_upsertPurchaseOrderDelivery"),);server.registerTool(@@ -1454,19 +1258,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase order line",inputSchema: {- purchaseOrderLine: purchaseOrderLineValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderLine: purchaseOrderLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseOrderLine(ctx.client, {- ...params.purchaseOrderLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseOrderLine(ctx.client, { ...params.purchaseOrderLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertPurchaseOrderLine")+ }, "Failed: purchasing_upsertPurchaseOrderLine"),);server.registerTool(@@ -1474,18 +1273,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchase order payment",inputSchema: {- purchaseOrderPayment: purchaseOrderPaymentValidator- },- annotations: WRITE_ANNOTATIONS+ purchaseOrderPayment: purchaseOrderPaymentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchaseOrderPayment(ctx.client, {- ...params.purchaseOrderPayment,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchaseOrderPayment(ctx.client, { ...params.purchaseOrderPayment, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertPurchaseOrderPayment")+ }, "Failed: purchasing_upsertPurchaseOrderPayment"),);server.registerTool(@@ -1493,19 +1288,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert supplier",inputSchema: {- supplier: supplierValidator- },- annotations: WRITE_ANNOTATIONS+ supplier: supplierValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplier(ctx.client, {- ...params.supplier,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplier(ctx.client, { ...params.supplier, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertSupplier")+ }, "Failed: purchasing_upsertSupplier"),);server.registerTool(@@ -1513,19 +1303,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert supplier process",inputSchema: {- supplierProcess: supplierProcessValidator- },- annotations: WRITE_ANNOTATIONS+ supplierProcess: supplierProcessValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplierProcess(ctx.client, {- ...params.supplierProcess,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplierProcess(ctx.client, { ...params.supplierProcess, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertSupplierProcess")+ }, "Failed: purchasing_upsertSupplierProcess"),);server.registerTool(@@ -1533,19 +1318,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert supplier quote",inputSchema: {- supplierQuote: supplierQuoteValidator- },- annotations: WRITE_ANNOTATIONS+ supplierQuote: supplierQuoteValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplierQuote(ctx.client, {- ...params.supplierQuote,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplierQuote(ctx.client, { ...params.supplierQuote, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertSupplierQuote")+ }, "Failed: purchasing_upsertSupplierQuote"),);server.registerTool(@@ -1553,19 +1333,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert supplier quote line",inputSchema: {- supplierQuoteLine: supplierQuoteLineValidator- },- annotations: WRITE_ANNOTATIONS+ supplierQuoteLine: supplierQuoteLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplierQuoteLine(ctx.client, {- ...params.supplierQuoteLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplierQuoteLine(ctx.client, { ...params.supplierQuoteLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertSupplierQuoteLine")+ }, "Failed: purchasing_upsertSupplierQuoteLine"),);server.registerTool(@@ -1573,19 +1348,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert supplier type",inputSchema: {- supplierType: supplierTypeValidator- },- annotations: WRITE_ANNOTATIONS+ supplierType: supplierTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSupplierType(ctx.client, {- ...params.supplierType,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSupplierType(ctx.client, { ...params.supplierType, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertSupplierType")+ }, "Failed: purchasing_upsertSupplierType"),);server.registerTool(@@ -1593,17 +1363,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete purchasing r f q",inputSchema: {- purchasingRfqId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchasingRFQ(- ctx.client,- params.purchasingRfqId- );+ const result = await deletePurchasingRFQ(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_deletePurchasingRFQ")+ }, "Failed: purchasing_deletePurchasingRFQ"),);server.registerTool(@@ -1611,17 +1378,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "delete purchasing r f q line",inputSchema: {- purchasingRfqLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ purchasingRfqLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deletePurchasingRFQLine(- ctx.client,- params.purchasingRfqLineId- );+ const result = await deletePurchasingRFQLine(ctx.client, params.purchasingRfqLineId);return toMcpResult(result);- }, "Failed: purchasing_deletePurchasingRFQLine")+ }, "Failed: purchasing_deletePurchasingRFQLine"),);server.registerTool(@@ -1629,14 +1393,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f q",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchasingRFQ(ctx.client, params.id);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQ")+ }, "Failed: purchasing_getPurchasingRFQ"),);server.registerTool(@@ -1644,22 +1408,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f qs",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingRFQs(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getPurchasingRFQs(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQs")+ }, "Failed: purchasing_getPurchasingRFQs"),);server.registerTool(@@ -1667,14 +1427,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f q line",inputSchema: {- lineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ lineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPurchasingRFQLine(ctx.client, params.lineId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQLine")+ }, "Failed: purchasing_getPurchasingRFQLine"),);server.registerTool(@@ -1682,17 +1442,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f q lines",inputSchema: {- purchasingRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingRFQLines(- ctx.client,- params.purchasingRfqId- );+ const result = await getPurchasingRFQLines(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQLines")+ }, "Failed: purchasing_getPurchasingRFQLines"),);server.registerTool(@@ -1700,17 +1457,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f q suppliers",inputSchema: {- purchasingRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingRFQSuppliers(- ctx.client,- params.purchasingRfqId- );+ const result = await getPurchasingRFQSuppliers(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQSuppliers")+ }, "Failed: purchasing_getPurchasingRFQSuppliers"),);server.registerTool(@@ -1718,28 +1472,23 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchasing r f q",inputSchema: {- purchasingRfq: z.object({- id: z.string().optional(),- rfqId: z.string(),- rfqDate: z.string(),- expirationDate: z.string().optional(),- locationId: z.string().optional(),- employeeId: z.string().optional(),- status: z.any().optional(),- customFields: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ purchasingRfq: z.object({+ id: z.string().optional(),+ rfqId: z.string(),+ rfqDate: z.string(),+ expirationDate: z.string().optional(),+ locationId: z.string().optional(),+ employeeId: z.string().optional(),+ status: z.any().optional(),+ customFields: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchasingRFQ(ctx.client, {- ...params.purchasingRfq,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchasingRFQ(ctx.client, { ...params.purchasingRfq, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertPurchasingRFQ")+ }, "Failed: purchasing_upsertPurchasingRFQ"),);server.registerTool(@@ -1747,19 +1496,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchasing r f q line",inputSchema: {- purchasingRfqLine: z.any()- },- annotations: WRITE_ANNOTATIONS+ purchasingRfqLine: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchasingRFQLine(ctx.client, {- ...params.purchasingRfqLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPurchasingRFQLine(ctx.client, { ...params.purchasingRfqLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_upsertPurchasingRFQLine")+ }, "Failed: purchasing_upsertPurchasingRFQLine"),);server.registerTool(@@ -1767,21 +1511,15 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "upsert purchasing r f q suppliers",inputSchema: {- purchasingRfqId: z.string(),- supplierIds: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ purchasingRfqId: z.string(),+ supplierIds: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPurchasingRFQSuppliers(- ctx.client,- params.purchasingRfqId,- params.supplierIds,- ctx.companyId,- ctx.userId- );+ const result = await upsertPurchasingRFQSuppliers(ctx.client, params.purchasingRfqId, params.supplierIds, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: purchasing_upsertPurchasingRFQSuppliers")+ }, "Failed: purchasing_upsertPurchasingRFQSuppliers"),);server.registerTool(@@ -1789,21 +1527,18 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "update purchasing r f q status",inputSchema: {- args: z.object({- id: z.string(),- status: z.any(),- assignee: z.string().nullable().optional()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.string().nullable().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchasingRFQStatus(ctx.client, {- ...params.args,- updatedBy: ctx.userId- });+ const result = await updatePurchasingRFQStatus(ctx.client, { ...params.args, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: purchasing_updatePurchasingRFQStatus")+ }, "Failed: purchasing_updatePurchasingRFQStatus"),);server.registerTool(@@ -1811,17 +1546,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get linked supplier quotes",inputSchema: {- purchasingRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getLinkedSupplierQuotes(- ctx.client,- params.purchasingRfqId- );+ const result = await getLinkedSupplierQuotes(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_getLinkedSupplierQuotes")+ }, "Failed: purchasing_getLinkedSupplierQuotes"),);server.registerTool(@@ -1829,17 +1561,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get linked purchasing rfqs",inputSchema: {- supplierQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getLinkedPurchasingRfqs(- ctx.client,- params.supplierQuoteId- );+ const result = await getLinkedPurchasingRfqs(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_getLinkedPurchasingRfqs")+ }, "Failed: purchasing_getLinkedPurchasingRfqs"),);server.registerTool(@@ -1847,17 +1576,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get linked purchasing rfqs for interaction",inputSchema: {- supplierInteractionId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierInteractionId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getLinkedPurchasingRfqsForInteraction(- ctx.client,- params.supplierInteractionId- );+ const result = await getLinkedPurchasingRfqsForInteraction(ctx.client, params.supplierInteractionId);return toMcpResult(result);- }, "Failed: purchasing_getLinkedPurchasingRfqsForInteraction")+ }, "Failed: purchasing_getLinkedPurchasingRfqsForInteraction"),);server.registerTool(@@ -1865,17 +1591,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get sibling quotes for quote",inputSchema: {- supplierQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ supplierQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSiblingQuotesForQuote(- ctx.client,- params.supplierQuoteId- );+ const result = await getSiblingQuotesForQuote(ctx.client, params.supplierQuoteId);return toMcpResult(result);- }, "Failed: purchasing_getSiblingQuotesForQuote")+ }, "Failed: purchasing_getSiblingQuotesForQuote"),);server.registerTool(@@ -1883,17 +1606,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get linked purchasing rfqs for order",inputSchema: {- purchaseOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchaseOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getLinkedPurchasingRfqsForOrder(- ctx.client,- params.purchaseOrderId- );+ const result = await getLinkedPurchasingRfqsForOrder(ctx.client, params.purchaseOrderId);return toMcpResult(result);- }, "Failed: purchasing_getLinkedPurchasingRfqsForOrder")+ }, "Failed: purchasing_getLinkedPurchasingRfqsForOrder"),);server.registerTool(@@ -1901,17 +1621,14 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get supplier quotes for comparison",inputSchema: {- purchasingRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSupplierQuotesForComparison(- ctx.client,- params.purchasingRfqId- );+ const result = await getSupplierQuotesForComparison(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_getSupplierQuotesForComparison")+ }, "Failed: purchasing_getSupplierQuotesForComparison"),);server.registerTool(@@ -1919,16 +1636,13 @@ export const registerPurchasingTools: RegisterTools = (server, ctx) => {{description: "get purchasing r f q suppliers with links",inputSchema: {- purchasingRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ purchasingRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPurchasingRFQSuppliersWithLinks(- ctx.client,- params.purchasingRfqId- );+ const result = await getPurchasingRFQSuppliersWithLinks(ctx.client, params.purchasingRfqId);return toMcpResult(result);- }, "Failed: purchasing_getPurchasingRFQSuppliersWithLinks")+ }, "Failed: purchasing_getPurchasingRFQSuppliersWithLinks"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/quality.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/quality.tsindex aacb4e2fab..d13e07bdf6 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/quality.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/quality.ts@@ -1,18 +1,14 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- gaugeCalibrationRecordValidator,- gaugeTypeValidator,- gaugeValidator,- issueTypeValidator,- issueValidator,- issueWorkflowValidator,- nonConformanceReviewerValidator,- qualityDocumentStepValidator,- qualityDocumentValidator,- riskRegisterValidator-} from "~/modules/quality/quality.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {activateGauge,deactivateGauge,@@ -23,74 +19,78 @@ import {deleteIssueAssociation,deleteIssueType,deleteIssueWorkflow,+ deleteRequiredAction,deleteQualityDocument,deleteQualityDocumentStep,- deleteRequiredAction,deleteRisk,+ getIssueFromExternalLink,getGauge,+ getGauges,+ getGaugesList,getGaugeCalibrationRecord,getGaugeCalibrationRecords,getGaugeCalibrationRecordsByGaugeId,- getGauges,- getGaugesList,+ getGaugeTypesList,getGaugeType,getGaugeTypes,- getGaugeTypesList,getIssue,+ getIssues,+ getIssueWorkflow,getIssueAction,getIssueActionTasks,getIssueApprovalTasks,- getIssueAssociations,- getIssueFromExternalLink,getIssueItems,+ getIssueAssociations,getIssueReviewers,getIssueSuppliers,- getIssues,getIssueTasks,getIssueType,getIssueTypes,- getIssueTypesList,- getIssueWorkflow,getIssueWorkflows,getIssueWorkflowsList,+ getIssueTypesList,getQualityActions,getQualityDocument,getQualityDocumentSteps,+ getQualityDocumentVersions,getQualityDocuments,getQualityDocumentsList,- getQualityDocumentVersions,getQualityFiles,- getRequiredAction,- getRequiredActions,getRequiredActionsList,+ getRequiredActions,+ getRequiredAction,getRisk,getRisks,insertIssueReviewer,updateIssueActionProcesses,updateIssueStatus,- updateIssueTaskContent,updateIssueTaskStatus,+ updateIssueTaskContent,updateQualityDocumentStepOrder,updateRiskStatus,upsertGauge,upsertGaugeCalibrationRecord,upsertGaugeType,upsertIssue,- upsertIssueType,upsertIssueWorkflow,+ upsertIssueType,+ upsertRequiredAction,upsertQualityDocument,upsertQualityDocumentStep,- upsertRequiredAction,- upsertRisk+ upsertRisk,} from "~/modules/quality/quality.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ nonConformanceReviewerValidator,+ gaugeValidator,+ gaugeCalibrationRecordValidator,+ gaugeTypeValidator,+ issueValidator,+ issueWorkflowValidator,+ issueTypeValidator,+ qualityDocumentValidator,+ qualityDocumentStepValidator,+ riskRegisterValidator,+} from "~/modules/quality/quality.models";export const registerQualityTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -98,14 +98,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "activate gauge",inputSchema: {- gaugeId: z.string()- },- annotations: WRITE_ANNOTATIONS+ gaugeId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await activateGauge(ctx.client, params.gaugeId);return toMcpResult(result);- }, "Failed: quality_activateGauge")+ }, "Failed: quality_activateGauge"),);server.registerTool(@@ -113,14 +113,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "deactivate gauge",inputSchema: {- gaugeId: z.string()- },- annotations: WRITE_ANNOTATIONS+ gaugeId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deactivateGauge(ctx.client, params.gaugeId);return toMcpResult(result);- }, "Failed: quality_deactivateGauge")+ }, "Failed: quality_deactivateGauge"),);server.registerTool(@@ -128,14 +128,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete gauge",inputSchema: {- gaugeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ gaugeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteGauge(ctx.client, params.gaugeId);return toMcpResult(result);- }, "Failed: quality_deleteGauge")+ }, "Failed: quality_deleteGauge"),);server.registerTool(@@ -143,17 +143,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete gauge calibration record",inputSchema: {- gaugeCalibrationRecordId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ gaugeCalibrationRecordId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteGaugeCalibrationRecord(- ctx.client,- params.gaugeCalibrationRecordId- );+ const result = await deleteGaugeCalibrationRecord(ctx.client, params.gaugeCalibrationRecordId);return toMcpResult(result);- }, "Failed: quality_deleteGaugeCalibrationRecord")+ }, "Failed: quality_deleteGaugeCalibrationRecord"),);server.registerTool(@@ -161,14 +158,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete gauge type",inputSchema: {- gaugeTypeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ gaugeTypeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteGaugeType(ctx.client, params.gaugeTypeId);return toMcpResult(result);- }, "Failed: quality_deleteGaugeType")+ }, "Failed: quality_deleteGaugeType"),);server.registerTool(@@ -176,14 +173,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete issue",inputSchema: {- nonConformanceId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ nonConformanceId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteIssue(ctx.client, params.nonConformanceId);return toMcpResult(result);- }, "Failed: quality_deleteIssue")+ }, "Failed: quality_deleteIssue"),);server.registerTool(@@ -191,19 +188,15 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete issue association",inputSchema: {- type: z.string(),- associationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ type: z.string(),+ associationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteIssueAssociation(- ctx.client,- params.type,- params.associationId- );+ const result = await deleteIssueAssociation(ctx.client, params.type, params.associationId);return toMcpResult(result);- }, "Failed: quality_deleteIssueAssociation")+ }, "Failed: quality_deleteIssueAssociation"),);server.registerTool(@@ -211,17 +204,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete issue type",inputSchema: {- nonConformanceTypeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ nonConformanceTypeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteIssueType(- ctx.client,- params.nonConformanceTypeId- );+ const result = await deleteIssueType(ctx.client, params.nonConformanceTypeId);return toMcpResult(result);- }, "Failed: quality_deleteIssueType")+ }, "Failed: quality_deleteIssueType"),);server.registerTool(@@ -229,17 +219,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete issue workflow",inputSchema: {- nonConformanceWorkflowId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ nonConformanceWorkflowId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteIssueWorkflow(- ctx.client,- params.nonConformanceWorkflowId- );+ const result = await deleteIssueWorkflow(ctx.client, params.nonConformanceWorkflowId);return toMcpResult(result);- }, "Failed: quality_deleteIssueWorkflow")+ }, "Failed: quality_deleteIssueWorkflow"),);server.registerTool(@@ -247,17 +234,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete required action",inputSchema: {- requiredActionId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ requiredActionId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteRequiredAction(- ctx.client,- params.requiredActionId- );+ const result = await deleteRequiredAction(ctx.client, params.requiredActionId);return toMcpResult(result);- }, "Failed: quality_deleteRequiredAction")+ }, "Failed: quality_deleteRequiredAction"),);server.registerTool(@@ -265,17 +249,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete quality document",inputSchema: {- qualityDocumentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ qualityDocumentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteQualityDocument(- ctx.client,- params.qualityDocumentId- );+ const result = await deleteQualityDocument(ctx.client, params.qualityDocumentId);return toMcpResult(result);- }, "Failed: quality_deleteQualityDocument")+ }, "Failed: quality_deleteQualityDocument"),);server.registerTool(@@ -283,18 +264,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete quality document step",inputSchema: {- qualityDocumentStepId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ qualityDocumentStepId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteQualityDocumentStep(- ctx.client,- params.qualityDocumentStepId,- ctx.companyId- );+ const result = await deleteQualityDocumentStep(ctx.client, params.qualityDocumentStepId, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_deleteQualityDocumentStep")+ }, "Failed: quality_deleteQualityDocumentStep"),);server.registerTool(@@ -302,14 +279,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "delete risk",inputSchema: {- riskId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ riskId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteRisk(ctx.client, params.riskId);return toMcpResult(result);- }, "Failed: quality_deleteRisk")+ }, "Failed: quality_deleteRisk"),);server.registerTool(@@ -317,14 +294,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue from external link",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueFromExternalLink(ctx.client, params.id);return toMcpResult(result);- }, "Failed: quality_getIssueFromExternalLink")+ }, "Failed: quality_getIssueFromExternalLink"),);server.registerTool(@@ -332,14 +309,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge",inputSchema: {- gaugeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ gaugeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGauge(ctx.client, params.gaugeId);return toMcpResult(result);- }, "Failed: quality_getGauge")+ }, "Failed: quality_getGauge"),);server.registerTool(@@ -347,20 +324,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauges",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGauges(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getGauges")+ }, "Failed: quality_getGauges"),);server.registerTool(@@ -368,12 +343,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauges list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGaugesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getGaugesList")+ }, "Failed: quality_getGaugesList"),);server.registerTool(@@ -381,14 +356,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge calibration record",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGaugeCalibrationRecord(ctx.client, params.id);return toMcpResult(result);- }, "Failed: quality_getGaugeCalibrationRecord")+ }, "Failed: quality_getGaugeCalibrationRecord"),);server.registerTool(@@ -396,24 +371,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge calibration records",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getGaugeCalibrationRecords(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getGaugeCalibrationRecords(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getGaugeCalibrationRecords")+ }, "Failed: quality_getGaugeCalibrationRecords"),);server.registerTool(@@ -421,17 +390,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge calibration records by gauge id",inputSchema: {- gaugeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ gaugeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getGaugeCalibrationRecordsByGaugeId(- ctx.client,- params.gaugeId- );+ const result = await getGaugeCalibrationRecordsByGaugeId(ctx.client, params.gaugeId);return toMcpResult(result);- }, "Failed: quality_getGaugeCalibrationRecordsByGaugeId")+ }, "Failed: quality_getGaugeCalibrationRecordsByGaugeId"),);server.registerTool(@@ -439,12 +405,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge types list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGaugeTypesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getGaugeTypesList")+ }, "Failed: quality_getGaugeTypesList"),);server.registerTool(@@ -452,14 +418,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge type",inputSchema: {- gaugeTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ gaugeTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGaugeType(ctx.client, params.gaugeTypeId);return toMcpResult(result);- }, "Failed: quality_getGaugeType")+ }, "Failed: quality_getGaugeType"),);server.registerTool(@@ -467,24 +433,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get gauge types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getGaugeTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getGaugeTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getGaugeTypes")+ }, "Failed: quality_getGaugeTypes"),);server.registerTool(@@ -492,14 +452,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue",inputSchema: {- nonConformanceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ nonConformanceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssue(ctx.client, params.nonConformanceId);return toMcpResult(result);- }, "Failed: quality_getIssue")+ }, "Failed: quality_getIssue"),);server.registerTool(@@ -507,20 +467,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issues",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssues(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getIssues")+ }, "Failed: quality_getIssues"),);server.registerTool(@@ -528,17 +486,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue workflow",inputSchema: {- nonConformanceWorkflowId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ nonConformanceWorkflowId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueWorkflow(- ctx.client,- params.nonConformanceWorkflowId- );+ const result = await getIssueWorkflow(ctx.client, params.nonConformanceWorkflowId);return toMcpResult(result);- }, "Failed: quality_getIssueWorkflow")+ }, "Failed: quality_getIssueWorkflow"),);server.registerTool(@@ -546,14 +501,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue action",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueAction(ctx.client, params.id);return toMcpResult(result);- }, "Failed: quality_getIssueAction")+ }, "Failed: quality_getIssueAction"),);server.registerTool(@@ -561,20 +516,15 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue action tasks",inputSchema: {- id: z.string(),- supplierId: z.string().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ supplierId: z.string().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueActionTasks(- ctx.client,- params.id,- ctx.companyId,- params.supplierId- );+ const result = await getIssueActionTasks(ctx.client, params.id, ctx.companyId, params.supplierId);return toMcpResult(result);- }, "Failed: quality_getIssueActionTasks")+ }, "Failed: quality_getIssueActionTasks"),);server.registerTool(@@ -582,18 +532,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue approval tasks",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueApprovalTasks(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getIssueApprovalTasks(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueApprovalTasks")+ }, "Failed: quality_getIssueApprovalTasks"),);server.registerTool(@@ -601,14 +547,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue items",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueItems(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueItems")+ }, "Failed: quality_getIssueItems"),);server.registerTool(@@ -616,18 +562,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue associations",inputSchema: {- nonConformanceId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ nonConformanceId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueAssociations(- ctx.client,- params.nonConformanceId,- ctx.companyId- );+ const result = await getIssueAssociations(ctx.client, params.nonConformanceId, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueAssociations")+ }, "Failed: quality_getIssueAssociations"),);server.registerTool(@@ -635,18 +577,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue reviewers",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueReviewers(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getIssueReviewers(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueReviewers")+ }, "Failed: quality_getIssueReviewers"),);server.registerTool(@@ -654,18 +592,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue suppliers",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueSuppliers(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getIssueSuppliers(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueSuppliers")+ }, "Failed: quality_getIssueSuppliers"),);server.registerTool(@@ -673,14 +607,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue tasks",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueTasks(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueTasks")+ }, "Failed: quality_getIssueTasks"),);server.registerTool(@@ -688,17 +622,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue type",inputSchema: {- nonConformanceTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ nonConformanceTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueType(- ctx.client,- params.nonConformanceTypeId- );+ const result = await getIssueType(ctx.client, params.nonConformanceTypeId);return toMcpResult(result);- }, "Failed: quality_getIssueType")+ }, "Failed: quality_getIssueType"),);server.registerTool(@@ -706,24 +637,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getIssueTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getIssueTypes")+ }, "Failed: quality_getIssueTypes"),);server.registerTool(@@ -731,24 +656,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue workflows",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getIssueWorkflows(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getIssueWorkflows(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getIssueWorkflows")+ }, "Failed: quality_getIssueWorkflows"),);server.registerTool(@@ -756,12 +675,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue workflows list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueWorkflowsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueWorkflowsList")+ }, "Failed: quality_getIssueWorkflowsList"),);server.registerTool(@@ -769,12 +688,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get issue types list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIssueTypesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getIssueTypesList")+ }, "Failed: quality_getIssueTypesList"),);server.registerTool(@@ -782,24 +701,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality actions",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQualityActions(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getQualityActions(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getQualityActions")+ }, "Failed: quality_getQualityActions"),);server.registerTool(@@ -807,14 +720,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality document",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQualityDocument(ctx.client, params.id);return toMcpResult(result);- }, "Failed: quality_getQualityDocument")+ }, "Failed: quality_getQualityDocument"),);server.registerTool(@@ -822,17 +735,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality document steps",inputSchema: {- qualityDocumentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ qualityDocumentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQualityDocumentSteps(- ctx.client,- params.qualityDocumentId- );+ const result = await getQualityDocumentSteps(ctx.client, params.qualityDocumentId);return toMcpResult(result);- }, "Failed: quality_getQualityDocumentSteps")+ }, "Failed: quality_getQualityDocumentSteps"),);server.registerTool(@@ -840,21 +750,17 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality document versions",inputSchema: {- qualityDocument: z.object({- name: z.string(),- version: z.number()- })- },- annotations: READ_ONLY_ANNOTATIONS+ qualityDocument: z.object({+ name: z.string(),+ version: z.number()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQualityDocumentVersions(- ctx.client,- params.qualityDocument,- ctx.companyId- );+ const result = await getQualityDocumentVersions(ctx.client, params.qualityDocument, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getQualityDocumentVersions")+ }, "Failed: quality_getQualityDocumentVersions"),);server.registerTool(@@ -862,23 +768,17 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality documents",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQualityDocuments(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getQualityDocuments(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getQualityDocuments")+ }, "Failed: quality_getQualityDocuments"),);server.registerTool(@@ -886,12 +786,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality documents list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQualityDocumentsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getQualityDocumentsList")+ }, "Failed: quality_getQualityDocumentsList"),);server.registerTool(@@ -899,18 +799,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get quality files",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQualityFiles(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getQualityFiles(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getQualityFiles")+ }, "Failed: quality_getQualityFiles"),);server.registerTool(@@ -918,12 +814,12 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get required actions list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getRequiredActionsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: quality_getRequiredActionsList")+ }, "Failed: quality_getRequiredActionsList"),);server.registerTool(@@ -931,24 +827,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get required actions",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getRequiredActions(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getRequiredActions(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getRequiredActions")+ }, "Failed: quality_getRequiredActions"),);server.registerTool(@@ -956,17 +846,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get required action",inputSchema: {- requiredActionId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ requiredActionId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getRequiredAction(- ctx.client,- params.requiredActionId- );+ const result = await getRequiredAction(ctx.client, params.requiredActionId);return toMcpResult(result);- }, "Failed: quality_getRequiredAction")+ }, "Failed: quality_getRequiredAction"),);server.registerTool(@@ -974,14 +861,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get risk",inputSchema: {- riskId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ riskId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getRisk(ctx.client, params.riskId);return toMcpResult(result);- }, "Failed: quality_getRisk")+ }, "Failed: quality_getRisk"),);server.registerTool(@@ -989,23 +876,21 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "get risks",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.any().optional(),- source: z.any().optional(),- assignee: z.array(z.string()).optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.any().optional(),+ source: z.any().optional(),+ assignee: z.array(z.string()).optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getRisks(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: quality_getRisks")+ }, "Failed: quality_getRisks"),);server.registerTool(@@ -1013,18 +898,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "insert issue reviewer",inputSchema: {- reviewer: nonConformanceReviewerValidator- },- annotations: WRITE_ANNOTATIONS+ reviewer: nonConformanceReviewerValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertIssueReviewer(ctx.client, {- ...params.reviewer,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertIssueReviewer(ctx.client, { ...params.reviewer, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_insertIssueReviewer")+ }, "Failed: quality_insertIssueReviewer"),);server.registerTool(@@ -1032,21 +913,17 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update issue action processes",inputSchema: {- args: z.object({- actionTaskId: z.string(),- processIds: z.array(z.string())- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ actionTaskId: z.string(),+ processIds: z.array(z.string())+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateIssueActionProcesses(ctx.client, {- ...params.args,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await updateIssueActionProcesses(ctx.client, { ...params.args, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_updateIssueActionProcesses")+ }, "Failed: quality_updateIssueActionProcesses"),);server.registerTool(@@ -1054,22 +931,19 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update issue status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any(),- closeDate: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any(),+ closeDate: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateIssueStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateIssueStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_updateIssueStatus")+ }, "Failed: quality_updateIssueStatus"),);server.registerTool(@@ -1077,22 +951,19 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update issue task status",inputSchema: {- args: z.object({- id: z.string(),- status: z.enum(["Pending", "Completed", "Skipped", "In Progress"]),- type: z.enum(["investigation", "action", "approval", "review"]),- assignee: z.string().nullable().optional()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ status: z.enum(["Pending", "Completed", "Skipped", "In Progress"]),+ type: z.enum(["investigation", "action", "approval", "review"]),+ assignee: z.string().nullable().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateIssueTaskStatus(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateIssueTaskStatus(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: quality_updateIssueTaskStatus")+ }, "Failed: quality_updateIssueTaskStatus"),);server.registerTool(@@ -1100,18 +971,18 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update issue task content",inputSchema: {- args: z.object({- id: z.string(),- type: z.enum(["action", "approval", "review"]),- content: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ type: z.enum(["action", "approval", "review"]),+ content: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await updateIssueTaskContent(ctx.client, params.args);return toMcpResult(result);- }, "Failed: quality_updateIssueTaskContent")+ }, "Failed: quality_updateIssueTaskContent"),);server.registerTool(@@ -1119,20 +990,17 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update quality document step order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQualityDocumentStepOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateQualityDocumentStepOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_updateQualityDocumentStepOrder")+ }, "Failed: quality_updateQualityDocumentStepOrder"),);server.registerTool(@@ -1140,19 +1008,15 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "update risk status",inputSchema: {- riskId: z.string(),- status: z.any()- },- annotations: WRITE_ANNOTATIONS+ riskId: z.string(),+ status: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateRiskStatus(- ctx.client,- params.riskId,- params.status- );+ const result = await updateRiskStatus(ctx.client, params.riskId, params.status);return toMcpResult(result);- }, "Failed: quality_updateRiskStatus")+ }, "Failed: quality_updateRiskStatus"),);server.registerTool(@@ -1160,19 +1024,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert gauge",inputSchema: {- gauge: gaugeValidator- },- annotations: WRITE_ANNOTATIONS+ gauge: gaugeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertGauge(ctx.client, {- ...params.gauge,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertGauge(ctx.client, { ...params.gauge, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertGauge")+ }, "Failed: quality_upsertGauge"),);server.registerTool(@@ -1180,19 +1039,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert gauge calibration record",inputSchema: {- gaugeCalibrationRecord: gaugeCalibrationRecordValidator- },- annotations: WRITE_ANNOTATIONS+ gaugeCalibrationRecord: gaugeCalibrationRecordValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertGaugeCalibrationRecord(ctx.client, {- ...params.gaugeCalibrationRecord,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertGaugeCalibrationRecord(ctx.client, { ...params.gaugeCalibrationRecord, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertGaugeCalibrationRecord")+ }, "Failed: quality_upsertGaugeCalibrationRecord"),);server.registerTool(@@ -1200,19 +1054,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert gauge type",inputSchema: {- gaugeType: gaugeTypeValidator- },- annotations: WRITE_ANNOTATIONS+ gaugeType: gaugeTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertGaugeType(ctx.client, {- ...params.gaugeType,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertGaugeType(ctx.client, { ...params.gaugeType, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertGaugeType")+ }, "Failed: quality_upsertGaugeType"),);server.registerTool(@@ -1220,19 +1069,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert issue",inputSchema: {- nonConformance: issueValidator- },- annotations: WRITE_ANNOTATIONS+ nonConformance: issueValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertIssue(ctx.client, {- ...params.nonConformance,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertIssue(ctx.client, { ...params.nonConformance, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertIssue")+ }, "Failed: quality_upsertIssue"),);server.registerTool(@@ -1240,19 +1084,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert issue workflow",inputSchema: {- nonConformanceWorkflow: issueWorkflowValidator- },- annotations: WRITE_ANNOTATIONS+ nonConformanceWorkflow: issueWorkflowValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertIssueWorkflow(ctx.client, {- ...params.nonConformanceWorkflow,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertIssueWorkflow(ctx.client, { ...params.nonConformanceWorkflow, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertIssueWorkflow")+ }, "Failed: quality_upsertIssueWorkflow"),);server.registerTool(@@ -1260,19 +1099,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert issue type",inputSchema: {- nonConformanceType: issueTypeValidator- },- annotations: WRITE_ANNOTATIONS+ nonConformanceType: issueTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertIssueType(ctx.client, {- ...params.nonConformanceType,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertIssueType(ctx.client, { ...params.nonConformanceType, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertIssueType")+ }, "Failed: quality_upsertIssueType"),);server.registerTool(@@ -1280,19 +1114,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert required action",inputSchema: {- requiredAction: issueTypeValidator- },- annotations: WRITE_ANNOTATIONS+ requiredAction: issueTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertRequiredAction(ctx.client, {- ...params.requiredAction,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertRequiredAction(ctx.client, { ...params.requiredAction, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertRequiredAction")+ }, "Failed: quality_upsertRequiredAction"),);server.registerTool(@@ -1300,19 +1129,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert quality document",inputSchema: {- qualityDocument: qualityDocumentValidator- },- annotations: WRITE_ANNOTATIONS+ qualityDocument: qualityDocumentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQualityDocument(ctx.client, {- ...params.qualityDocument,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQualityDocument(ctx.client, { ...params.qualityDocument, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertQualityDocument")+ }, "Failed: quality_upsertQualityDocument"),);server.registerTool(@@ -1320,19 +1144,14 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert quality document step",inputSchema: {- qualityDocumentStep: qualityDocumentStepValidator- },- annotations: WRITE_ANNOTATIONS+ qualityDocumentStep: qualityDocumentStepValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQualityDocumentStep(ctx.client, {- ...params.qualityDocumentStep,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQualityDocumentStep(ctx.client, { ...params.qualityDocumentStep, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertQualityDocumentStep")+ }, "Failed: quality_upsertQualityDocumentStep"),);server.registerTool(@@ -1340,18 +1159,13 @@ export const registerQualityTools: RegisterTools = (server, ctx) => {{description: "upsert risk",inputSchema: {- risk: riskRegisterValidator- },- annotations: WRITE_ANNOTATIONS+ risk: riskRegisterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertRisk(ctx.client, {- ...params.risk,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertRisk(ctx.client, { ...params.risk, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: quality_upsertRisk")+ }, "Failed: quality_upsertRisk"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/resources.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/resources.tsindex 5b5afd3983..5a82f627ee 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/resources.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/resources.ts@@ -1,24 +1,15 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- failureModeValidator,- locationValidator,- maintenanceDispatchCommentValidator,- maintenanceDispatchEventValidator,- maintenanceDispatchItemValidator,- maintenanceDispatchValidator,- maintenanceDispatchWorkCenterValidator,- maintenanceScheduleItemValidator,- maintenanceScheduleValidator,- partnerValidator,- processValidator,- trainingQuestionValidator,- trainingValidator,- workCenterValidator-} from "~/modules/resources/resources.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {- activateProcess,activateWorkCenter,deleteAbility,deleteContractor,@@ -33,6 +24,8 @@ import {deleteMaintenanceSchedule,deleteMaintenanceScheduleItem,deletePartner,+ activateProcess,+ processDeactivate,deleteProcess,deleteShift,deleteSuggestion,@@ -55,10 +48,10 @@ import {getMaintenanceDispatch,getMaintenanceDispatchComments,getMaintenanceDispatchEvents,- getMaintenanceDispatches,- getMaintenanceDispatchesByLocation,getMaintenanceDispatchItems,getMaintenanceDispatchItemTrackedEntities,+ getMaintenanceDispatches,+ getMaintenanceDispatchesByLocation,getMaintenanceDispatchWorkCenters,getMaintenanceSchedule,getMaintenanceScheduleItems,@@ -76,9 +69,9 @@ import {getTraining,getTrainingAssignment,getTrainingAssignmentForCompletion,+ getTrainingAssignments,getTrainingAssignmentStatus,getTrainingAssignmentSummary,- getTrainingAssignments,getTrainingQuestions,getTrainings,getTrainingsList,@@ -90,7 +83,6 @@ import {insertAbility,insertEmployeeAbilities,insertTrainingCompletion,- processDeactivate,updateAbility,updateSuggestionEmoji,updateSuggestionTags,@@ -111,16 +103,24 @@ import {upsertTraining,upsertTrainingAssignment,upsertTrainingQuestion,- upsertWorkCenter+ upsertWorkCenter,} from "~/modules/resources/resources.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ failureModeValidator,+ locationValidator,+ maintenanceDispatchValidator,+ maintenanceDispatchCommentValidator,+ maintenanceDispatchEventValidator,+ maintenanceDispatchItemValidator,+ maintenanceDispatchWorkCenterValidator,+ maintenanceScheduleValidator,+ maintenanceScheduleItemValidator,+ partnerValidator,+ processValidator,+ trainingValidator,+ trainingQuestionValidator,+ workCenterValidator,+} from "~/modules/resources/resources.models";export const registerResourcesTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -128,14 +128,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "activate work center",inputSchema: {- id: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await activateWorkCenter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: resources_activateWorkCenter")+ }, "Failed: resources_activateWorkCenter"),);server.registerTool(@@ -143,19 +143,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete ability",inputSchema: {- abilityId: z.string(),- hardDelete: z.boolean().optional()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ abilityId: z.string(),+ hardDelete: z.boolean().optional(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteAbility(- ctx.client,- params.abilityId,- params.hardDelete- );+ const result = await deleteAbility(ctx.client, params.abilityId, params.hardDelete);return toMcpResult(result);- }, "Failed: resources_deleteAbility")+ }, "Failed: resources_deleteAbility"),);server.registerTool(@@ -163,14 +159,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete contractor",inputSchema: {- contractorId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ contractorId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteContractor(ctx.client, params.contractorId);return toMcpResult(result);- }, "Failed: resources_deleteContractor")+ }, "Failed: resources_deleteContractor"),);server.registerTool(@@ -178,17 +174,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete employee ability",inputSchema: {- employeeAbilityId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ employeeAbilityId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteEmployeeAbility(- ctx.client,- params.employeeAbilityId- );+ const result = await deleteEmployeeAbility(ctx.client, params.employeeAbilityId);return toMcpResult(result);- }, "Failed: resources_deleteEmployeeAbility")+ }, "Failed: resources_deleteEmployeeAbility"),);server.registerTool(@@ -196,14 +189,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete failure mode",inputSchema: {- failureModeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ failureModeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteFailureMode(ctx.client, params.failureModeId);return toMcpResult(result);- }, "Failed: resources_deleteFailureMode")+ }, "Failed: resources_deleteFailureMode"),);server.registerTool(@@ -211,14 +204,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete location",inputSchema: {- locationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ locationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteLocation(ctx.client, params.locationId);return toMcpResult(result);- }, "Failed: resources_deleteLocation")+ }, "Failed: resources_deleteLocation"),);server.registerTool(@@ -226,17 +219,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch",inputSchema: {- dispatchId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatch(- ctx.client,- params.dispatchId- );+ const result = await deleteMaintenanceDispatch(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceDispatch")+ }, "Failed: resources_deleteMaintenanceDispatch"),);server.registerTool(@@ -244,17 +234,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch comment",inputSchema: {- commentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ commentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchComment(- ctx.client,- params.commentId- );+ const result = await deleteMaintenanceDispatchComment(ctx.client, params.commentId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceDispatchComment")+ }, "Failed: resources_deleteMaintenanceDispatchComment"),);server.registerTool(@@ -262,17 +249,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch event",inputSchema: {- eventId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ eventId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchEvent(- ctx.client,- params.eventId- );+ const result = await deleteMaintenanceDispatchEvent(ctx.client, params.eventId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceDispatchEvent")+ }, "Failed: resources_deleteMaintenanceDispatchEvent"),);server.registerTool(@@ -280,17 +264,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch item",inputSchema: {- itemId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchItem(- ctx.client,- params.itemId- );+ const result = await deleteMaintenanceDispatchItem(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceDispatchItem")+ }, "Failed: resources_deleteMaintenanceDispatchItem"),);server.registerTool(@@ -298,17 +279,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance dispatch work center",inputSchema: {- workCenterId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ workCenterId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceDispatchWorkCenter(- ctx.client,- params.workCenterId- );+ const result = await deleteMaintenanceDispatchWorkCenter(ctx.client, params.workCenterId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceDispatchWorkCenter")+ }, "Failed: resources_deleteMaintenanceDispatchWorkCenter"),);server.registerTool(@@ -316,17 +294,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance schedule",inputSchema: {- scheduleId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceSchedule(- ctx.client,- params.scheduleId- );+ const result = await deleteMaintenanceSchedule(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceSchedule")+ }, "Failed: resources_deleteMaintenanceSchedule"),);server.registerTool(@@ -334,17 +309,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete maintenance schedule item",inputSchema: {- itemId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteMaintenanceScheduleItem(- ctx.client,- params.itemId- );+ const result = await deleteMaintenanceScheduleItem(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: resources_deleteMaintenanceScheduleItem")+ }, "Failed: resources_deleteMaintenanceScheduleItem"),);server.registerTool(@@ -352,14 +324,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete partner",inputSchema: {- partnerId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ partnerId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deletePartner(ctx.client, params.partnerId);return toMcpResult(result);- }, "Failed: resources_deletePartner")+ }, "Failed: resources_deletePartner"),);server.registerTool(@@ -367,14 +339,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "activate process",inputSchema: {- processId: z.string()- },- annotations: WRITE_ANNOTATIONS+ processId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await activateProcess(ctx.client, params.processId);return toMcpResult(result);- }, "Failed: resources_activateProcess")+ }, "Failed: resources_activateProcess"),);server.registerTool(@@ -382,14 +354,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "process deactivate",inputSchema: {- processId: z.string()- },- annotations: WRITE_ANNOTATIONS+ processId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await processDeactivate(ctx.client, params.processId);return toMcpResult(result);- }, "Failed: resources_processDeactivate")+ }, "Failed: resources_processDeactivate"),);server.registerTool(@@ -397,14 +369,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete process",inputSchema: {- processId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ processId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteProcess(ctx.client, params.processId);return toMcpResult(result);- }, "Failed: resources_deleteProcess")+ }, "Failed: resources_deleteProcess"),);server.registerTool(@@ -412,14 +384,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete shift",inputSchema: {- shiftId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ shiftId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteShift(ctx.client, params.shiftId);return toMcpResult(result);- }, "Failed: resources_deleteShift")+ }, "Failed: resources_deleteShift"),);server.registerTool(@@ -427,14 +399,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete suggestion",inputSchema: {- suggestionId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ suggestionId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSuggestion(ctx.client, params.suggestionId);return toMcpResult(result);- }, "Failed: resources_deleteSuggestion")+ }, "Failed: resources_deleteSuggestion"),);server.registerTool(@@ -442,14 +414,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete training",inputSchema: {- trainingId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ trainingId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteTraining(ctx.client, params.trainingId);return toMcpResult(result);- }, "Failed: resources_deleteTraining")+ }, "Failed: resources_deleteTraining"),);server.registerTool(@@ -457,17 +429,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete training assignment",inputSchema: {- assignmentId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ assignmentId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteTrainingAssignment(- ctx.client,- params.assignmentId- );+ const result = await deleteTrainingAssignment(ctx.client, params.assignmentId);return toMcpResult(result);- }, "Failed: resources_deleteTrainingAssignment")+ }, "Failed: resources_deleteTrainingAssignment"),);server.registerTool(@@ -475,18 +444,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete training question",inputSchema: {- trainingQuestionId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ trainingQuestionId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteTrainingQuestion(- ctx.client,- params.trainingQuestionId,- ctx.companyId- );+ const result = await deleteTrainingQuestion(ctx.client, params.trainingQuestionId, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_deleteTrainingQuestion")+ }, "Failed: resources_deleteTrainingQuestion"),);server.registerTool(@@ -494,14 +459,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "delete work center",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteWorkCenter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: resources_deleteWorkCenter")+ }, "Failed: resources_deleteWorkCenter"),);server.registerTool(@@ -509,18 +474,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get abilities",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAbilities(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getAbilities")+ }, "Failed: resources_getAbilities"),);server.registerTool(@@ -528,12 +493,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get abilities list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAbilitiesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getAbilitiesList")+ }, "Failed: resources_getAbilitiesList"),);server.registerTool(@@ -541,14 +506,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get ability",inputSchema: {- abilityId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ abilityId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getAbility(ctx.client, params.abilityId);return toMcpResult(result);- }, "Failed: resources_getAbility")+ }, "Failed: resources_getAbility"),);server.registerTool(@@ -556,14 +521,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get contractor",inputSchema: {- contractorId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ contractorId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getContractor(ctx.client, params.contractorId);return toMcpResult(result);- }, "Failed: resources_getContractor")+ }, "Failed: resources_getContractor"),);server.registerTool(@@ -571,24 +536,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get contractors",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getContractors(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getContractors(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getContractors")+ }, "Failed: resources_getContractors"),);server.registerTool(@@ -596,14 +555,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get employee abilities",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getEmployeeAbilities(ctx.client, params.employeeId);return toMcpResult(result);- }, "Failed: resources_getEmployeeAbilities")+ }, "Failed: resources_getEmployeeAbilities"),);server.registerTool(@@ -611,14 +570,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get failure mode",inputSchema: {- failureModeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ failureModeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getFailureMode(ctx.client, params.failureModeId);return toMcpResult(result);- }, "Failed: resources_getFailureMode")+ }, "Failed: resources_getFailureMode"),);server.registerTool(@@ -626,24 +585,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get failure modes",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getFailureModes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getFailureModes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getFailureModes")+ }, "Failed: resources_getFailureModes"),);server.registerTool(@@ -651,12 +604,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get failure modes list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getFailureModesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getFailureModesList")+ }, "Failed: resources_getFailureModesList"),);server.registerTool(@@ -664,14 +617,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get location",inputSchema: {- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getLocation(ctx.client, params.locationId);return toMcpResult(result);- }, "Failed: resources_getLocation")+ }, "Failed: resources_getLocation"),);server.registerTool(@@ -679,20 +632,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get locations",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getLocations(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getLocations")+ }, "Failed: resources_getLocations"),);server.registerTool(@@ -700,12 +651,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get locations list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getLocationsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getLocationsList")+ }, "Failed: resources_getLocationsList"),);server.registerTool(@@ -713,17 +664,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatch(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatch(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatch")+ }, "Failed: resources_getMaintenanceDispatch"),);server.registerTool(@@ -731,17 +679,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch comments",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchComments(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchComments(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchComments")+ }, "Failed: resources_getMaintenanceDispatchComments"),);server.registerTool(@@ -749,17 +694,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch events",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchEvents(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchEvents(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchEvents")+ }, "Failed: resources_getMaintenanceDispatchEvents"),);server.registerTool(@@ -767,17 +709,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch items",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchItems(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchItems(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchItems")+ }, "Failed: resources_getMaintenanceDispatchItems"),);server.registerTool(@@ -785,17 +724,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch item tracked entities",inputSchema: {- maintenanceDispatchItemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ maintenanceDispatchItemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchItemTrackedEntities(- ctx.client,- params.maintenanceDispatchItemId- );+ const result = await getMaintenanceDispatchItemTrackedEntities(ctx.client, params.maintenanceDispatchItemId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchItemTrackedEntities")+ }, "Failed: resources_getMaintenanceDispatchItemTrackedEntities"),);server.registerTool(@@ -803,25 +739,19 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatches",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.string().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.string().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatches(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaintenanceDispatches(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatches")+ }, "Failed: resources_getMaintenanceDispatches"),);server.registerTool(@@ -829,27 +759,20 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatches by location",inputSchema: {- locationId: z.string(),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.string().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.string().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchesByLocation(- ctx.client,- ctx.companyId,- params.locationId,- params.args- );+ const result = await getMaintenanceDispatchesByLocation(ctx.client, ctx.companyId, params.locationId, params.args);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchesByLocation")+ }, "Failed: resources_getMaintenanceDispatchesByLocation"),);server.registerTool(@@ -857,17 +780,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance dispatch work centers",inputSchema: {- dispatchId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ dispatchId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceDispatchWorkCenters(- ctx.client,- params.dispatchId- );+ const result = await getMaintenanceDispatchWorkCenters(ctx.client, params.dispatchId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceDispatchWorkCenters")+ }, "Failed: resources_getMaintenanceDispatchWorkCenters"),);server.registerTool(@@ -875,17 +795,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedule",inputSchema: {- scheduleId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceSchedule(- ctx.client,- params.scheduleId- );+ const result = await getMaintenanceSchedule(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceSchedule")+ }, "Failed: resources_getMaintenanceSchedule"),);server.registerTool(@@ -893,17 +810,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedule items",inputSchema: {- scheduleId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ scheduleId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceScheduleItems(- ctx.client,- params.scheduleId- );+ const result = await getMaintenanceScheduleItems(ctx.client, params.scheduleId);return toMcpResult(result);- }, "Failed: resources_getMaintenanceScheduleItems")+ }, "Failed: resources_getMaintenanceScheduleItems"),);server.registerTool(@@ -911,25 +825,19 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedules",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- active: z.boolean().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ active: z.boolean().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceSchedules(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getMaintenanceSchedules(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getMaintenanceSchedules")+ }, "Failed: resources_getMaintenanceSchedules"),);server.registerTool(@@ -937,27 +845,20 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get maintenance schedules by location",inputSchema: {- locationId: z.string(),- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- active: z.boolean().optional()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ active: z.boolean().optional()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getMaintenanceSchedulesByLocation(- ctx.client,- ctx.companyId,- params.locationId,- params.args- );+ const result = await getMaintenanceSchedulesByLocation(ctx.client, ctx.companyId, params.locationId, params.args);return toMcpResult(result);- }, "Failed: resources_getMaintenanceSchedulesByLocation")+ }, "Failed: resources_getMaintenanceSchedulesByLocation"),);server.registerTool(@@ -965,18 +866,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get outstanding trainings for user",inputSchema: {- employeeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOutstandingTrainingsForUser(- ctx.client,- ctx.companyId,- params.employeeId- );+ const result = await getOutstandingTrainingsForUser(ctx.client, ctx.companyId, params.employeeId);return toMcpResult(result);- }, "Failed: resources_getOutstandingTrainingsForUser")+ }, "Failed: resources_getOutstandingTrainingsForUser"),);server.registerTool(@@ -984,19 +881,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get partner",inputSchema: {- partnerId: z.string(),- abilityId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ partnerId: z.string(),+ abilityId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPartner(- ctx.client,- params.partnerId,- params.abilityId- );+ const result = await getPartner(ctx.client, params.partnerId, params.abilityId);return toMcpResult(result);- }, "Failed: resources_getPartner")+ }, "Failed: resources_getPartner"),);server.registerTool(@@ -1004,14 +897,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get partner by supplier id",inputSchema: {- partnerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ partnerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPartnerBySupplierId(ctx.client, params.partnerId);return toMcpResult(result);- }, "Failed: resources_getPartnerBySupplierId")+ }, "Failed: resources_getPartnerBySupplierId"),);server.registerTool(@@ -1019,20 +912,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get partners",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPartners(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getPartners")+ }, "Failed: resources_getPartners"),);server.registerTool(@@ -1040,14 +931,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get process",inputSchema: {- processId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ processId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProcess(ctx.client, params.processId);return toMcpResult(result);- }, "Failed: resources_getProcess")+ }, "Failed: resources_getProcess"),);server.registerTool(@@ -1055,20 +946,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get processes",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProcesses(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getProcesses")+ }, "Failed: resources_getProcesses"),);server.registerTool(@@ -1076,12 +965,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get processes list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getProcessesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getProcessesList")+ }, "Failed: resources_getProcessesList"),);server.registerTool(@@ -1089,14 +978,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get suggestion",inputSchema: {- suggestionId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ suggestionId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSuggestion(ctx.client, params.suggestionId);return toMcpResult(result);- }, "Failed: resources_getSuggestion")+ }, "Failed: resources_getSuggestion"),);server.registerTool(@@ -1104,24 +993,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get suggestions",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSuggestions(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSuggestions(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getSuggestions")+ }, "Failed: resources_getSuggestions"),);server.registerTool(@@ -1129,14 +1012,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTraining(ctx.client, params.id);return toMcpResult(result);- }, "Failed: resources_getTraining")+ }, "Failed: resources_getTraining"),);server.registerTool(@@ -1144,17 +1027,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training assignment",inputSchema: {- assignmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ assignmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrainingAssignment(- ctx.client,- params.assignmentId- );+ const result = await getTrainingAssignment(ctx.client, params.assignmentId);return toMcpResult(result);- }, "Failed: resources_getTrainingAssignment")+ }, "Failed: resources_getTrainingAssignment"),);server.registerTool(@@ -1162,17 +1042,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training assignment for completion",inputSchema: {- assignmentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ assignmentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrainingAssignmentForCompletion(- ctx.client,- params.assignmentId- );+ const result = await getTrainingAssignmentForCompletion(ctx.client, params.assignmentId);return toMcpResult(result);- }, "Failed: resources_getTrainingAssignmentForCompletion")+ }, "Failed: resources_getTrainingAssignmentForCompletion"),);server.registerTool(@@ -1180,18 +1057,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training assignments",inputSchema: {- trainingId: z.string().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ trainingId: z.string().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrainingAssignments(- ctx.client,- ctx.companyId,- params.trainingId- );+ const result = await getTrainingAssignments(ctx.client, ctx.companyId, params.trainingId);return toMcpResult(result);- }, "Failed: resources_getTrainingAssignments")+ }, "Failed: resources_getTrainingAssignments"),);server.registerTool(@@ -1199,23 +1072,17 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training assignment status",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrainingAssignmentStatus(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getTrainingAssignmentStatus(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getTrainingAssignmentStatus")+ }, "Failed: resources_getTrainingAssignmentStatus"),);server.registerTool(@@ -1223,15 +1090,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training assignment summary",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getTrainingAssignmentSummary(- ctx.client,- ctx.companyId- );+ const result = await getTrainingAssignmentSummary(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getTrainingAssignmentSummary")+ }, "Failed: resources_getTrainingAssignmentSummary"),);server.registerTool(@@ -1239,14 +1103,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get training questions",inputSchema: {- trainingId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ trainingId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrainingQuestions(ctx.client, params.trainingId);return toMcpResult(result);- }, "Failed: resources_getTrainingQuestions")+ }, "Failed: resources_getTrainingQuestions"),);server.registerTool(@@ -1254,19 +1118,17 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get trainings",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrainings(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getTrainings")+ }, "Failed: resources_getTrainings"),);server.registerTool(@@ -1274,12 +1136,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get trainings list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTrainingsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getTrainingsList")+ }, "Failed: resources_getTrainingsList"),);server.registerTool(@@ -1287,14 +1149,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get work center",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWorkCenter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: resources_getWorkCenter")+ }, "Failed: resources_getWorkCenter"),);server.registerTool(@@ -1302,23 +1164,17 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get work centers",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWorkCenters(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getWorkCenters(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: resources_getWorkCenters")+ }, "Failed: resources_getWorkCenters"),);server.registerTool(@@ -1326,17 +1182,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get work centers by location",inputSchema: {- locationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ locationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWorkCentersByLocation(- ctx.client,- params.locationId- );+ const result = await getWorkCentersByLocation(ctx.client, params.locationId);return toMcpResult(result);- }, "Failed: resources_getWorkCentersByLocation")+ }, "Failed: resources_getWorkCentersByLocation"),);server.registerTool(@@ -1344,12 +1197,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get work centers list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWorkCentersList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getWorkCentersList")+ }, "Failed: resources_getWorkCentersList"),);server.registerTool(@@ -1357,15 +1210,12 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "get work centers list with blocking status",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getWorkCentersListWithBlockingStatus(- ctx.client,- ctx.companyId- );+ const result = await getWorkCentersListWithBlockingStatus(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_getWorkCentersListWithBlockingStatus")+ }, "Failed: resources_getWorkCentersListWithBlockingStatus"),);server.registerTool(@@ -1373,25 +1223,21 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "insert ability",inputSchema: {- ability: z.object({- name: z.string(),- curve: z.any(),- data: z.any(),- week: z.number(),- value: z.number(),- shadowWeeks: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ ability: z.object({+ name: z.string(),+ curve: z.any(),+ data: z.any(),+ week: z.number(),+ value: z.number(),+ shadowWeeks: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertAbility(ctx.client, {- ...params.ability,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertAbility(ctx.client, { ...params.ability, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_insertAbility")+ }, "Failed: resources_insertAbility"),);server.registerTool(@@ -1399,20 +1245,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "insert employee abilities",inputSchema: {- abilityId: z.string(),- employeeIds: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ abilityId: z.string(),+ employeeIds: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertEmployeeAbilities(- ctx.client,- params.abilityId,- params.employeeIds,- ctx.companyId- );+ const result = await insertEmployeeAbilities(ctx.client, params.abilityId, params.employeeIds, ctx.companyId);return toMcpResult(result);- }, "Failed: resources_insertEmployeeAbilities")+ }, "Failed: resources_insertEmployeeAbilities"),);server.registerTool(@@ -1420,23 +1261,19 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "insert training completion",inputSchema: {- completion: z.object({- trainingAssignmentId: z.string(),- employeeId: z.string(),- period: z.string().nullable(),- completedBy: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ completion: z.object({+ trainingAssignmentId: z.string(),+ employeeId: z.string(),+ period: z.string().nullable(),+ completedBy: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertTrainingCompletion(ctx.client, {- ...params.completion,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertTrainingCompletion(ctx.client, { ...params.completion, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_insertTrainingCompletion")+ }, "Failed: resources_insertTrainingCompletion"),);server.registerTool(@@ -1444,15 +1281,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "update ability",inputSchema: {- id: z.string(),- ability: z.any()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ ability: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await updateAbility(ctx.client, params.id, params.ability);return toMcpResult(result);- }, "Failed: resources_updateAbility")+ }, "Failed: resources_updateAbility"),);server.registerTool(@@ -1460,19 +1297,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "update suggestion emoji",inputSchema: {- suggestionId: z.string(),- emoji: z.string()- },- annotations: WRITE_ANNOTATIONS+ suggestionId: z.string(),+ emoji: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSuggestionEmoji(- ctx.client,- params.suggestionId,- params.emoji- );+ const result = await updateSuggestionEmoji(ctx.client, params.suggestionId, params.emoji);return toMcpResult(result);- }, "Failed: resources_updateSuggestionEmoji")+ }, "Failed: resources_updateSuggestionEmoji"),);server.registerTool(@@ -1480,19 +1313,15 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "update suggestion tags",inputSchema: {- suggestionId: z.string(),- tags: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ suggestionId: z.string(),+ tags: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSuggestionTags(- ctx.client,- params.suggestionId,- params.tags- );+ const result = await updateSuggestionTags(ctx.client, params.suggestionId, params.tags);return toMcpResult(result);- }, "Failed: resources_updateSuggestionTags")+ }, "Failed: resources_updateSuggestionTags"),);server.registerTool(@@ -1500,20 +1329,17 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "update training question order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateTrainingQuestionOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateTrainingQuestionOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_updateTrainingQuestionOrder")+ }, "Failed: resources_updateTrainingQuestionOrder"),);server.registerTool(@@ -1521,19 +1347,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert contractor",inputSchema: {- contractorWithAbilities: z.any()- },- annotations: WRITE_ANNOTATIONS+ contractorWithAbilities: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertContractor(ctx.client, {- ...params.contractorWithAbilities,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertContractor(ctx.client, { ...params.contractorWithAbilities, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertContractor")+ }, "Failed: resources_upsertContractor"),);server.registerTool(@@ -1541,23 +1362,20 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert employee ability",inputSchema: {- employeeAbility: z.object({- id: z.string().optional(),- abilityId: z.string(),- employeeId: z.string(),- trainingCompleted: z.boolean(),- trainingDays: z.number().optional()- })- },- annotations: WRITE_ANNOTATIONS+ employeeAbility: z.object({+ id: z.string().optional(),+ abilityId: z.string(),+ employeeId: z.string(),+ trainingCompleted: z.boolean(),+ trainingDays: z.number().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertEmployeeAbility(ctx.client, {- ...params.employeeAbility,- companyId: ctx.companyId- });+ const result = await upsertEmployeeAbility(ctx.client, { ...params.employeeAbility, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: resources_upsertEmployeeAbility")+ }, "Failed: resources_upsertEmployeeAbility"),);server.registerTool(@@ -1565,19 +1383,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert failure mode",inputSchema: {- failureMode: failureModeValidator- },- annotations: WRITE_ANNOTATIONS+ failureMode: failureModeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertFailureMode(ctx.client, {- ...params.failureMode,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertFailureMode(ctx.client, { ...params.failureMode, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertFailureMode")+ }, "Failed: resources_upsertFailureMode"),);server.registerTool(@@ -1585,19 +1398,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert location",inputSchema: {- location: locationValidator- },- annotations: WRITE_ANNOTATIONS+ location: locationValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertLocation(ctx.client, {- ...params.location,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertLocation(ctx.client, { ...params.location, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertLocation")+ }, "Failed: resources_upsertLocation"),);server.registerTool(@@ -1605,19 +1413,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch",inputSchema: {- dispatch: maintenanceDispatchValidator- },- annotations: WRITE_ANNOTATIONS+ dispatch: maintenanceDispatchValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatch(ctx.client, {- ...params.dispatch,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatch(ctx.client, { ...params.dispatch, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceDispatch")+ }, "Failed: resources_upsertMaintenanceDispatch"),);server.registerTool(@@ -1625,19 +1428,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch comment",inputSchema: {- comment: maintenanceDispatchCommentValidator- },- annotations: WRITE_ANNOTATIONS+ comment: maintenanceDispatchCommentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchComment(ctx.client, {- ...params.comment,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchComment(ctx.client, { ...params.comment, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceDispatchComment")+ }, "Failed: resources_upsertMaintenanceDispatchComment"),);server.registerTool(@@ -1645,19 +1443,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch event",inputSchema: {- event: maintenanceDispatchEventValidator- },- annotations: WRITE_ANNOTATIONS+ event: maintenanceDispatchEventValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchEvent(ctx.client, {- ...params.event,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchEvent(ctx.client, { ...params.event, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceDispatchEvent")+ }, "Failed: resources_upsertMaintenanceDispatchEvent"),);server.registerTool(@@ -1665,19 +1458,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch item",inputSchema: {- item: maintenanceDispatchItemValidator- },- annotations: WRITE_ANNOTATIONS+ item: maintenanceDispatchItemValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchItem(ctx.client, {- ...params.item,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchItem(ctx.client, { ...params.item, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceDispatchItem")+ }, "Failed: resources_upsertMaintenanceDispatchItem"),);server.registerTool(@@ -1685,19 +1473,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance dispatch work center",inputSchema: {- workCenter: maintenanceDispatchWorkCenterValidator- },- annotations: WRITE_ANNOTATIONS+ workCenter: maintenanceDispatchWorkCenterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceDispatchWorkCenter(ctx.client, {- ...params.workCenter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceDispatchWorkCenter(ctx.client, { ...params.workCenter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceDispatchWorkCenter")+ }, "Failed: resources_upsertMaintenanceDispatchWorkCenter"),);server.registerTool(@@ -1705,19 +1488,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance schedule",inputSchema: {- schedule: maintenanceScheduleValidator- },- annotations: WRITE_ANNOTATIONS+ schedule: maintenanceScheduleValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceSchedule(ctx.client, {- ...params.schedule,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceSchedule(ctx.client, { ...params.schedule, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceSchedule")+ }, "Failed: resources_upsertMaintenanceSchedule"),);server.registerTool(@@ -1725,19 +1503,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert maintenance schedule item",inputSchema: {- item: maintenanceScheduleItemValidator- },- annotations: WRITE_ANNOTATIONS+ item: maintenanceScheduleItemValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMaintenanceScheduleItem(ctx.client, {- ...params.item,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertMaintenanceScheduleItem(ctx.client, { ...params.item, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertMaintenanceScheduleItem")+ }, "Failed: resources_upsertMaintenanceScheduleItem"),);server.registerTool(@@ -1745,19 +1518,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert partner",inputSchema: {- partner: partnerValidator- },- annotations: WRITE_ANNOTATIONS+ partner: partnerValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertPartner(ctx.client, {- ...params.partner,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertPartner(ctx.client, { ...params.partner, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertPartner")+ }, "Failed: resources_upsertPartner"),);server.registerTool(@@ -1765,19 +1533,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert process",inputSchema: {- process: processValidator- },- annotations: WRITE_ANNOTATIONS+ process: processValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertProcess(ctx.client, {- ...params.process,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertProcess(ctx.client, { ...params.process, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertProcess")+ }, "Failed: resources_upsertProcess"),);server.registerTool(@@ -1785,19 +1548,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert training",inputSchema: {- training: trainingValidator- },- annotations: WRITE_ANNOTATIONS+ training: trainingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertTraining(ctx.client, {- ...params.training,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertTraining(ctx.client, { ...params.training, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertTraining")+ }, "Failed: resources_upsertTraining"),);server.registerTool(@@ -1805,23 +1563,18 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert training assignment",inputSchema: {- assignment: z.object({- id: z.string().optional(),- trainingId: z.string(),- groupIds: z.array(z.string())- })- },- annotations: WRITE_ANNOTATIONS+ assignment: z.object({+ id: z.string().optional(),+ trainingId: z.string(),+ groupIds: z.array(z.string())+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertTrainingAssignment(ctx.client, {- ...params.assignment,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertTrainingAssignment(ctx.client, { ...params.assignment, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertTrainingAssignment")+ }, "Failed: resources_upsertTrainingAssignment"),);server.registerTool(@@ -1829,19 +1582,14 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert training question",inputSchema: {- trainingQuestion: trainingQuestionValidator- },- annotations: WRITE_ANNOTATIONS+ trainingQuestion: trainingQuestionValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertTrainingQuestion(ctx.client, {- ...params.trainingQuestion,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertTrainingQuestion(ctx.client, { ...params.trainingQuestion, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertTrainingQuestion")+ }, "Failed: resources_upsertTrainingQuestion"),);server.registerTool(@@ -1849,18 +1597,13 @@ export const registerResourcesTools: RegisterTools = (server, ctx) => {{description: "upsert work center",inputSchema: {- workCenter: workCenterValidator- },- annotations: WRITE_ANNOTATIONS+ workCenter: workCenterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertWorkCenter(ctx.client, {- ...params.workCenter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertWorkCenter(ctx.client, { ...params.workCenter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: resources_upsertWorkCenter")+ }, "Failed: resources_upsertWorkCenter"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/sales.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/sales.tsindex f937bbc099..730da923a6 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/sales.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/sales.ts@@ -1,38 +1,20 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- customerAccountingValidator,- customerContactValidator,- customerPaymentValidator,- customerShippingValidator,- customerStatusValidator,- customerTypeValidator,- customerValidator,- getMethodValidator,- noQuoteReasonValidator,- quoteLineAdditionalChargesValidator,- quoteLineValidator,- quoteMaterialValidator,- quoteOperationValidator,- quotePaymentValidator,- quoteShipmentValidator,- quoteValidator,- salesOrderLineValidator,- salesOrderPaymentValidator,- salesOrderShipmentValidator,- salesOrderValidator,- salesRfqLineValidator,- salesRfqValidator,- selectedLinesValidator-} from "~/modules/sales/sales.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {- calculatePricesForQuantities,closeSalesOrder,- convertQuoteToOrder,convertSalesRfqToQuote,- copyQuote,+ convertQuoteToOrder,copyQuoteLine,+ copyQuote,deleteCustomer,deleteCustomerContact,deleteCustomerLocation,@@ -40,18 +22,17 @@ import {deleteCustomerType,deleteNoQuoteReason,deleteQuote,- deleteQuoteLine,deleteQuoteMakeMethod,+ deleteQuoteLine,deleteQuoteMaterial,deleteQuoteOperation,- deleteQuoteOperationParameter,deleteQuoteOperationStep,+ deleteQuoteOperationParameter,deleteQuoteOperationTool,deleteSalesOrder,deleteSalesOrderLine,deleteSalesRFQ,deleteSalesRFQLine,- finalizeQuote,getConfigurationParametersByQuoteLineId,getCustomer,getCustomerContact,@@ -60,137 +41,156 @@ import {getCustomerLocations,getCustomerPayment,getCustomerShipping,+ getCustomers,+ getCustomersList,getCustomerStatus,getCustomerStatuses,getCustomerStatusesList,- getCustomers,- getCustomersList,getCustomerType,getCustomerTypes,getCustomerTypesList,getExternalSalesOrderLines,getModelByQuoteLineId,+ getNoQuoteReasonsList,getNoQuoteReason,getNoQuoteReasons,- getNoQuoteReasonsList,getOpportunity,getOpportunityDocuments,getOpportunityLineDocuments,getQuote,- getQuoteAssemblies,+ getQuoteFavorites,+ getQuotes,+ getQuotesList,getQuoteAssembliesByLine,- getQuoteByExternalId,+ getQuoteAssemblies,getQuoteCustomerDetails,- getQuoteFavorites,getQuoteLine,+ getQuoteLinesList,+ getQuoteMakeMethod,+ getRootQuoteMakeMethod,+ getQuoteMethodTrees,+ getQuoteMethodTreeArray,+ getQuoteLines,+ getQuoteByExternalId,getQuoteLinePrices,+ getQuoteLinePricesByQuoteId,getQuoteLinePricesByItemId,getQuoteLinePricesByItemIds,- getQuoteLinePricesByQuoteId,- getQuoteLines,- getQuoteLinesList,- getQuoteMakeMethod,- getQuoteMaterial,getQuoteMaterials,+ getQuoteMaterial,getQuoteMaterialsByLine,getQuoteMaterialsByMethodId,getQuoteMaterialsByOperation,- getQuoteMethodTreeArray,- getQuoteMethodTrees,getQuoteOperation,- getQuoteOperations,getQuoteOperationsByLine,getQuoteOperationsByMethodId,+ getQuoteOperations,getQuotePayment,getQuoteShipment,- getQuotes,- getQuotesList,getRelatedPricesForQuoteLine,- getRootQuoteMakeMethod,getSalesDocumentsAssignedToMe,getSalesOrder,getSalesOrderCustomerDetails,- getSalesOrderCustomers,getSalesOrderFavorites,+ getSalesOrderRelatedItems,+ getSalesOrders,+ getSalesOrdersList,+ getSalesOrderPayment,+ getSalesTerms,+ getSalesOrderShipment,+ getSalesOrderCustomers,+ getSalesOrderLines,getSalesOrderInvoiceLines,getSalesOrderInvoicesByIds,- getSalesOrderLine,- getSalesOrderLineShipments,- getSalesOrderLines,getSalesOrderLinesByItemId,getSalesOrderLinesByItemIds,- getSalesOrderPayment,- getSalesOrderRelatedItems,- getSalesOrderShipment,- getSalesOrders,- getSalesOrdersList,+ getSalesOrderLine,+ getSalesOrderLineShipments,getSalesRFQ,getSalesRFQFavorites,+ getSalesRFQs,getSalesRFQLine,getSalesRFQLines,- getSalesRFQs,- getSalesTerms,insertCustomerContact,insertCustomerLocation,insertSalesOrderLines,- recalculateQuoteLinePrices,+ finalizeQuote,releaseSalesOrder,+ upsertCustomer,updateCustomerAccounting,updateCustomerContact,updateCustomerLocation,updateCustomerPayment,updateCustomerShipping,+ upsertCustomerStatus,+ upsertCustomerType,+ upsertNoQuoteReason,+ updateSalesRFQFavorite,+ updateSalesRFQLineOrder,updateQuoteExchangeRate,- updateQuoteFavorite,updateQuoteLinePrecision,+ updateSalesOrderExchangeRate,+ updateQuoteFavorite,+ updateSalesRFQStatus,updateQuoteMaterialOrder,updateQuoteOperationOrder,updateQuoteStatus,- updateSalesOrderExchangeRate,- updateSalesOrderFavorite,- updateSalesOrderStatus,- updateSalesRFQFavorite,- updateSalesRFQLineOrder,- updateSalesRFQStatus,- upsertCustomer,- upsertCustomerStatus,- upsertCustomerType,upsertMakeMethodFromQuoteLine,upsertMakeMethodFromQuoteMethod,- upsertNoQuoteReason,upsertQuote,upsertQuoteLine,upsertQuoteLineAdditionalCharges,- upsertQuoteLineMethod,upsertQuoteLinePrices,+ calculatePricesForQuantities,+ recalculateQuoteLinePrices,+ upsertQuoteLineMethod,upsertQuoteMaterial,upsertQuoteMaterialMakeMethod,upsertQuoteOperation,- upsertQuoteOperationParameter,upsertQuoteOperationStep,+ upsertQuoteOperationParameter,upsertQuoteOperationTool,upsertQuotePayment,upsertQuoteShipment,+ updateSalesOrderFavorite,+ updateSalesOrderStatus,upsertSalesOrder,+ upsertSalesOrderShipment,upsertSalesOrderLine,upsertSalesOrderPayment,- upsertSalesOrderShipment,upsertSalesRFQ,- upsertSalesRFQLine+ upsertSalesRFQLine,} from "~/modules/sales/sales.service";import {- operationParameterValidator,+ selectedLinesValidator,+ getMethodValidator,+ customerContactValidator,+ salesOrderLineValidator,+ customerValidator,+ customerAccountingValidator,+ customerPaymentValidator,+ customerShippingValidator,+ customerStatusValidator,+ customerTypeValidator,+ noQuoteReasonValidator,+ quoteValidator,+ quoteLineValidator,+ quoteLineAdditionalChargesValidator,+ quoteMaterialValidator,+ quoteOperationValidator,+ quotePaymentValidator,+ quoteShipmentValidator,+ salesOrderValidator,+ salesOrderShipmentValidator,+ salesOrderPaymentValidator,+ salesRfqValidator,+ salesRfqLineValidator,+} from "~/modules/sales/sales.models";+import {operationStepValidator,- operationToolValidator+ operationParameterValidator,+ operationToolValidator,} from "~/modules/shared";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerSalesTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -198,18 +198,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "close sales order",inputSchema: {- salesOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await closeSalesOrder(- ctx.client,- params.salesOrderId,- ctx.userId- );+ const result = await closeSalesOrder(ctx.client, params.salesOrderId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_closeSalesOrder")+ }, "Failed: sales_closeSalesOrder"),);server.registerTool(@@ -217,20 +213,16 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "convert sales rfq to quote",inputSchema: {- payload: z.object({- id: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ payload: z.object({+ id: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await convertSalesRfqToQuote(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await convertSalesRfqToQuote(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_convertSalesRfqToQuote")+ }, "Failed: sales_convertSalesRfqToQuote"),);server.registerTool(@@ -238,18 +230,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "convert quote to order",inputSchema: {- payload: selectedLinesValidator- },- annotations: WRITE_ANNOTATIONS+ payload: selectedLinesValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await convertQuoteToOrder(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await convertQuoteToOrder(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_convertQuoteToOrder")+ }, "Failed: sales_convertQuoteToOrder"),);server.registerTool(@@ -257,18 +245,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "copy quote line",inputSchema: {- payload: getMethodValidator- },- annotations: WRITE_ANNOTATIONS+ payload: getMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await copyQuoteLine(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await copyQuoteLine(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_copyQuoteLine")+ }, "Failed: sales_copyQuoteLine"),);server.registerTool(@@ -276,18 +260,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "copy quote",inputSchema: {- payload: getMethodValidator- },- annotations: WRITE_ANNOTATIONS+ payload: getMethodValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await copyQuote(ctx.client, {- ...params.payload,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await copyQuote(ctx.client, { ...params.payload, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_copyQuote")+ }, "Failed: sales_copyQuote"),);server.registerTool(@@ -295,14 +275,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete customer",inputSchema: {- customerId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteCustomer(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_deleteCustomer")+ }, "Failed: sales_deleteCustomer"),);server.registerTool(@@ -310,19 +290,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete customer contact",inputSchema: {- customerId: z.string(),- customerContactId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ customerId: z.string(),+ customerContactId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteCustomerContact(- ctx.client,- params.customerId,- params.customerContactId- );+ const result = await deleteCustomerContact(ctx.client, params.customerId, params.customerContactId);return toMcpResult(result);- }, "Failed: sales_deleteCustomerContact")+ }, "Failed: sales_deleteCustomerContact"),);server.registerTool(@@ -330,19 +306,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete customer location",inputSchema: {- customerId: z.string(),- customerLocationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ customerId: z.string(),+ customerLocationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteCustomerLocation(- ctx.client,- params.customerId,- params.customerLocationId- );+ const result = await deleteCustomerLocation(ctx.client, params.customerId, params.customerLocationId);return toMcpResult(result);- }, "Failed: sales_deleteCustomerLocation")+ }, "Failed: sales_deleteCustomerLocation"),);server.registerTool(@@ -350,17 +322,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete customer status",inputSchema: {- customerStatusId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ customerStatusId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteCustomerStatus(- ctx.client,- params.customerStatusId- );+ const result = await deleteCustomerStatus(ctx.client, params.customerStatusId);return toMcpResult(result);- }, "Failed: sales_deleteCustomerStatus")+ }, "Failed: sales_deleteCustomerStatus"),);server.registerTool(@@ -368,17 +337,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete customer type",inputSchema: {- customerTypeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ customerTypeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteCustomerType(- ctx.client,- params.customerTypeId- );+ const result = await deleteCustomerType(ctx.client, params.customerTypeId);return toMcpResult(result);- }, "Failed: sales_deleteCustomerType")+ }, "Failed: sales_deleteCustomerType"),);server.registerTool(@@ -386,17 +352,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete no quote reason",inputSchema: {- noQuoteReasonId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ noQuoteReasonId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteNoQuoteReason(- ctx.client,- params.noQuoteReasonId- );+ const result = await deleteNoQuoteReason(ctx.client, params.noQuoteReasonId);return toMcpResult(result);- }, "Failed: sales_deleteNoQuoteReason")+ }, "Failed: sales_deleteNoQuoteReason"),);server.registerTool(@@ -404,14 +367,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote",inputSchema: {- quoteId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteQuote(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_deleteQuote")+ }, "Failed: sales_deleteQuote"),);server.registerTool(@@ -419,17 +382,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote make method",inputSchema: {- quoteMakeMethodId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ quoteMakeMethodId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteQuoteMakeMethod(- ctx.client,- params.quoteMakeMethodId- );+ const result = await deleteQuoteMakeMethod(ctx.client, params.quoteMakeMethodId);return toMcpResult(result);- }, "Failed: sales_deleteQuoteMakeMethod")+ }, "Failed: sales_deleteQuoteMakeMethod"),);server.registerTool(@@ -437,14 +397,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote line",inputSchema: {- quoteLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteQuoteLine(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_deleteQuoteLine")+ }, "Failed: sales_deleteQuoteLine"),);server.registerTool(@@ -452,17 +412,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote material",inputSchema: {- quoteMaterialId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ quoteMaterialId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteQuoteMaterial(- ctx.client,- params.quoteMaterialId- );+ const result = await deleteQuoteMaterial(ctx.client, params.quoteMaterialId);return toMcpResult(result);- }, "Failed: sales_deleteQuoteMaterial")+ }, "Failed: sales_deleteQuoteMaterial"),);server.registerTool(@@ -470,17 +427,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote operation",inputSchema: {- quoteOperationId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ quoteOperationId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteQuoteOperation(- ctx.client,- params.quoteOperationId- );+ const result = await deleteQuoteOperation(ctx.client, params.quoteOperationId);return toMcpResult(result);- }, "Failed: sales_deleteQuoteOperation")+ }, "Failed: sales_deleteQuoteOperation"),);server.registerTool(@@ -488,14 +442,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote operation step",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteQuoteOperationStep(ctx.client, params.id);return toMcpResult(result);- }, "Failed: sales_deleteQuoteOperationStep")+ }, "Failed: sales_deleteQuoteOperationStep"),);server.registerTool(@@ -503,14 +457,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote operation parameter",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteQuoteOperationParameter(ctx.client, params.id);return toMcpResult(result);- }, "Failed: sales_deleteQuoteOperationParameter")+ }, "Failed: sales_deleteQuoteOperationParameter"),);server.registerTool(@@ -518,14 +472,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete quote operation tool",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteQuoteOperationTool(ctx.client, params.id);return toMcpResult(result);- }, "Failed: sales_deleteQuoteOperationTool")+ }, "Failed: sales_deleteQuoteOperationTool"),);server.registerTool(@@ -533,14 +487,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete sales order",inputSchema: {- salesOrderId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSalesOrder(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_deleteSalesOrder")+ }, "Failed: sales_deleteSalesOrder"),);server.registerTool(@@ -548,17 +502,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete sales order line",inputSchema: {- salesOrderLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesOrderLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSalesOrderLine(- ctx.client,- params.salesOrderLineId- );+ const result = await deleteSalesOrderLine(ctx.client, params.salesOrderLineId);return toMcpResult(result);- }, "Failed: sales_deleteSalesOrderLine")+ }, "Failed: sales_deleteSalesOrderLine"),);server.registerTool(@@ -566,14 +517,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete sales r f q",inputSchema: {- salesRfqId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesRfqId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSalesRFQ(ctx.client, params.salesRfqId);return toMcpResult(result);- }, "Failed: sales_deleteSalesRFQ")+ }, "Failed: sales_deleteSalesRFQ"),);server.registerTool(@@ -581,17 +532,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "delete sales r f q line",inputSchema: {- salesRFQLineId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ salesRFQLineId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteSalesRFQLine(- ctx.client,- params.salesRFQLineId- );+ const result = await deleteSalesRFQLine(ctx.client, params.salesRFQLineId);return toMcpResult(result);- }, "Failed: sales_deleteSalesRFQLine")+ }, "Failed: sales_deleteSalesRFQLine"),);server.registerTool(@@ -599,18 +547,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get configuration parameters by quote line id",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConfigurationParametersByQuoteLineId(- ctx.client,- params.quoteLineId,- ctx.companyId- );+ const result = await getConfigurationParametersByQuoteLineId(ctx.client, params.quoteLineId, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getConfigurationParametersByQuoteLineId")+ }, "Failed: sales_getConfigurationParametersByQuoteLineId"),);server.registerTool(@@ -618,14 +562,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer",inputSchema: {- customerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomer(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_getCustomer")+ }, "Failed: sales_getCustomer"),);server.registerTool(@@ -633,17 +577,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer contact",inputSchema: {- customerContactId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerContactId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerContact(- ctx.client,- params.customerContactId- );+ const result = await getCustomerContact(ctx.client, params.customerContactId);return toMcpResult(result);- }, "Failed: sales_getCustomerContact")+ }, "Failed: sales_getCustomerContact"),);server.registerTool(@@ -651,14 +592,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer contacts",inputSchema: {- customerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerContacts(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_getCustomerContacts")+ }, "Failed: sales_getCustomerContacts"),);server.registerTool(@@ -666,17 +607,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer location",inputSchema: {- customerLocationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerLocationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerLocation(- ctx.client,- params.customerLocationId- );+ const result = await getCustomerLocation(ctx.client, params.customerLocationId);return toMcpResult(result);- }, "Failed: sales_getCustomerLocation")+ }, "Failed: sales_getCustomerLocation"),);server.registerTool(@@ -684,14 +622,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer locations",inputSchema: {- customerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerLocations(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_getCustomerLocations")+ }, "Failed: sales_getCustomerLocations"),);server.registerTool(@@ -699,14 +637,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer payment",inputSchema: {- customerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerPayment(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_getCustomerPayment")+ }, "Failed: sales_getCustomerPayment"),);server.registerTool(@@ -714,14 +652,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer shipping",inputSchema: {- customerId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerShipping(ctx.client, params.customerId);return toMcpResult(result);- }, "Failed: sales_getCustomerShipping")+ }, "Failed: sales_getCustomerShipping"),);server.registerTool(@@ -729,18 +667,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getCustomers")+ }, "Failed: sales_getCustomers"),);server.registerTool(@@ -748,12 +686,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customers list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomersList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getCustomersList")+ }, "Failed: sales_getCustomersList"),);server.registerTool(@@ -761,17 +699,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer status",inputSchema: {- customerStatusId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerStatusId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerStatus(- ctx.client,- params.customerStatusId- );+ const result = await getCustomerStatus(ctx.client, params.customerStatusId);return toMcpResult(result);- }, "Failed: sales_getCustomerStatus")+ }, "Failed: sales_getCustomerStatus"),);server.registerTool(@@ -779,24 +714,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer statuses",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerStatuses(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getCustomerStatuses(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getCustomerStatuses")+ }, "Failed: sales_getCustomerStatuses"),);server.registerTool(@@ -804,12 +733,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer statuses list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerStatusesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getCustomerStatusesList")+ }, "Failed: sales_getCustomerStatusesList"),);server.registerTool(@@ -817,14 +746,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer type",inputSchema: {- customerTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ customerTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerType(ctx.client, params.customerTypeId);return toMcpResult(result);- }, "Failed: sales_getCustomerType")+ }, "Failed: sales_getCustomerType"),);server.registerTool(@@ -832,24 +761,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getCustomerTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getCustomerTypes")+ }, "Failed: sales_getCustomerTypes"),);server.registerTool(@@ -857,12 +780,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get customer types list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerTypesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getCustomerTypesList")+ }, "Failed: sales_getCustomerTypesList"),);server.registerTool(@@ -870,23 +793,19 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get external sales order lines",inputSchema: {- customerId: z.string(),- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ customerId: z.string(),+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getExternalSalesOrderLines(- ctx.client,- params.customerId,- params.args- );+ const result = await getExternalSalesOrderLines(ctx.client, params.customerId, params.args);return toMcpResult(result);- }, "Failed: sales_getExternalSalesOrderLines")+ }, "Failed: sales_getExternalSalesOrderLines"),);server.registerTool(@@ -894,17 +813,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get model by quote line id",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getModelByQuoteLineId(- ctx.client,- params.quoteLineId- );+ const result = await getModelByQuoteLineId(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getModelByQuoteLineId")+ }, "Failed: sales_getModelByQuoteLineId"),);server.registerTool(@@ -912,12 +828,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get no quote reasons list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getNoQuoteReasonsList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getNoQuoteReasonsList")+ }, "Failed: sales_getNoQuoteReasonsList"),);server.registerTool(@@ -925,14 +841,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get no quote reason",inputSchema: {- noQuoteReasonId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ noQuoteReasonId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getNoQuoteReason(ctx.client, params.noQuoteReasonId);return toMcpResult(result);- }, "Failed: sales_getNoQuoteReason")+ }, "Failed: sales_getNoQuoteReason"),);server.registerTool(@@ -940,24 +856,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get no quote reasons",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getNoQuoteReasons(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getNoQuoteReasons(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getNoQuoteReasons")+ }, "Failed: sales_getNoQuoteReasons"),);server.registerTool(@@ -965,14 +875,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get opportunity",inputSchema: {- opportunityId: z.string().nullable()- },- annotations: READ_ONLY_ANNOTATIONS+ opportunityId: z.string().nullable(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getOpportunity(ctx.client, params.opportunityId);return toMcpResult(result);- }, "Failed: sales_getOpportunity")+ }, "Failed: sales_getOpportunity"),);server.registerTool(@@ -980,18 +890,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get opportunity documents",inputSchema: {- opportunityId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ opportunityId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpportunityDocuments(- ctx.client,- ctx.companyId,- params.opportunityId- );+ const result = await getOpportunityDocuments(ctx.client, ctx.companyId, params.opportunityId);return toMcpResult(result);- }, "Failed: sales_getOpportunityDocuments")+ }, "Failed: sales_getOpportunityDocuments"),);server.registerTool(@@ -999,20 +905,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get opportunity line documents",inputSchema: {- lineId: z.string(),- itemId: z.string().nullable().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ lineId: z.string(),+ itemId: z.string().nullable().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getOpportunityLineDocuments(- ctx.client,- ctx.companyId,- params.lineId,- params.itemId- );+ const result = await getOpportunityLineDocuments(ctx.client, ctx.companyId, params.lineId, params.itemId);return toMcpResult(result);- }, "Failed: sales_getOpportunityLineDocuments")+ }, "Failed: sales_getOpportunityLineDocuments"),);server.registerTool(@@ -1020,14 +921,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuote(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuote")+ }, "Failed: sales_getQuote"),);server.registerTool(@@ -1035,16 +936,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote favorites",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteFavorites(- ctx.client,- ctx.companyId,- ctx.userId- );+ const result = await getQuoteFavorites(ctx.client, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_getQuoteFavorites")+ }, "Failed: sales_getQuoteFavorites"),);server.registerTool(@@ -1052,18 +949,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quotes",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuotes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getQuotes")+ }, "Failed: sales_getQuotes"),);server.registerTool(@@ -1071,12 +968,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quotes list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuotesList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getQuotesList")+ }, "Failed: sales_getQuotesList"),);server.registerTool(@@ -1084,17 +981,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote assemblies by line",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteAssembliesByLine(- ctx.client,- params.quoteLineId- );+ const result = await getQuoteAssembliesByLine(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getQuoteAssembliesByLine")+ }, "Failed: sales_getQuoteAssembliesByLine"),);server.registerTool(@@ -1102,14 +996,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote assemblies",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteAssemblies(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteAssemblies")+ }, "Failed: sales_getQuoteAssemblies"),);server.registerTool(@@ -1117,14 +1011,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote customer details",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteCustomerDetails(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteCustomerDetails")+ }, "Failed: sales_getQuoteCustomerDetails"),);server.registerTool(@@ -1132,14 +1026,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote line",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteLine(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getQuoteLine")+ }, "Failed: sales_getQuoteLine"),);server.registerTool(@@ -1147,14 +1041,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote lines list",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteLinesList(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteLinesList")+ }, "Failed: sales_getQuoteLinesList"),);server.registerTool(@@ -1162,17 +1056,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote make method",inputSchema: {- quoteMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteMakeMethod(- ctx.client,- params.quoteMakeMethodId- );+ const result = await getQuoteMakeMethod(ctx.client, params.quoteMakeMethodId);return toMcpResult(result);- }, "Failed: sales_getQuoteMakeMethod")+ }, "Failed: sales_getQuoteMakeMethod"),);server.registerTool(@@ -1180,17 +1071,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get root quote make method",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getRootQuoteMakeMethod(- ctx.client,- params.quoteLineId- );+ const result = await getRootQuoteMakeMethod(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getRootQuoteMakeMethod")+ }, "Failed: sales_getRootQuoteMakeMethod"),);server.registerTool(@@ -1198,14 +1086,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote method trees",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteMethodTrees(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteMethodTrees")+ }, "Failed: sales_getQuoteMethodTrees"),);server.registerTool(@@ -1213,14 +1101,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote method tree array",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteMethodTreeArray(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteMethodTreeArray")+ }, "Failed: sales_getQuoteMethodTreeArray"),);server.registerTool(@@ -1228,14 +1116,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote lines",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteLines(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteLines")+ }, "Failed: sales_getQuoteLines"),);server.registerTool(@@ -1243,14 +1131,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote by external id",inputSchema: {- externalId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ externalId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteByExternalId(ctx.client, params.externalId);return toMcpResult(result);- }, "Failed: sales_getQuoteByExternalId")+ }, "Failed: sales_getQuoteByExternalId"),);server.registerTool(@@ -1258,14 +1146,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote line prices",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteLinePrices(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getQuoteLinePrices")+ }, "Failed: sales_getQuoteLinePrices"),);server.registerTool(@@ -1273,17 +1161,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote line prices by quote id",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteLinePricesByQuoteId(- ctx.client,- params.quoteId- );+ const result = await getQuoteLinePricesByQuoteId(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteLinePricesByQuoteId")+ }, "Failed: sales_getQuoteLinePricesByQuoteId"),);server.registerTool(@@ -1291,19 +1176,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote line prices by item id",inputSchema: {- itemId: z.string(),- currentQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ currentQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteLinePricesByItemId(- ctx.client,- params.itemId,- params.currentQuoteId- );+ const result = await getQuoteLinePricesByItemId(ctx.client, params.itemId, params.currentQuoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteLinePricesByItemId")+ }, "Failed: sales_getQuoteLinePricesByItemId"),);server.registerTool(@@ -1311,19 +1192,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote line prices by item ids",inputSchema: {- itemIds: z.array(z.string()),- currentQuoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemIds: z.array(z.string()),+ currentQuoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteLinePricesByItemIds(- ctx.client,- params.itemIds,- params.currentQuoteId- );+ const result = await getQuoteLinePricesByItemIds(ctx.client, params.itemIds, params.currentQuoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteLinePricesByItemIds")+ }, "Failed: sales_getQuoteLinePricesByItemIds"),);server.registerTool(@@ -1331,14 +1208,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote materials",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteMaterials(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteMaterials")+ }, "Failed: sales_getQuoteMaterials"),);server.registerTool(@@ -1346,14 +1223,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote material",inputSchema: {- materialId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ materialId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteMaterial(ctx.client, params.materialId);return toMcpResult(result);- }, "Failed: sales_getQuoteMaterial")+ }, "Failed: sales_getQuoteMaterial"),);server.registerTool(@@ -1361,17 +1238,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote materials by line",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteMaterialsByLine(- ctx.client,- params.quoteLineId- );+ const result = await getQuoteMaterialsByLine(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getQuoteMaterialsByLine")+ }, "Failed: sales_getQuoteMaterialsByLine"),);server.registerTool(@@ -1379,17 +1253,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote materials by method id",inputSchema: {- quoteMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteMaterialsByMethodId(- ctx.client,- params.quoteMakeMethodId- );+ const result = await getQuoteMaterialsByMethodId(ctx.client, params.quoteMakeMethodId);return toMcpResult(result);- }, "Failed: sales_getQuoteMaterialsByMethodId")+ }, "Failed: sales_getQuoteMaterialsByMethodId"),);server.registerTool(@@ -1397,17 +1268,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote materials by operation",inputSchema: {- quoteOperationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteOperationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteMaterialsByOperation(- ctx.client,- params.quoteOperationId- );+ const result = await getQuoteMaterialsByOperation(ctx.client, params.quoteOperationId);return toMcpResult(result);- }, "Failed: sales_getQuoteMaterialsByOperation")+ }, "Failed: sales_getQuoteMaterialsByOperation"),);server.registerTool(@@ -1415,17 +1283,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote operation",inputSchema: {- quoteOperationId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteOperationId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteOperation(- ctx.client,- params.quoteOperationId- );+ const result = await getQuoteOperation(ctx.client, params.quoteOperationId);return toMcpResult(result);- }, "Failed: sales_getQuoteOperation")+ }, "Failed: sales_getQuoteOperation"),);server.registerTool(@@ -1433,17 +1298,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote operations by line",inputSchema: {- quoteLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteOperationsByLine(- ctx.client,- params.quoteLineId- );+ const result = await getQuoteOperationsByLine(ctx.client, params.quoteLineId);return toMcpResult(result);- }, "Failed: sales_getQuoteOperationsByLine")+ }, "Failed: sales_getQuoteOperationsByLine"),);server.registerTool(@@ -1451,17 +1313,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote operations by method id",inputSchema: {- quoteMakeMethodId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteMakeMethodId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getQuoteOperationsByMethodId(- ctx.client,- params.quoteMakeMethodId- );+ const result = await getQuoteOperationsByMethodId(ctx.client, params.quoteMakeMethodId);return toMcpResult(result);- }, "Failed: sales_getQuoteOperationsByMethodId")+ }, "Failed: sales_getQuoteOperationsByMethodId"),);server.registerTool(@@ -1469,14 +1328,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote operations",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteOperations(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteOperations")+ }, "Failed: sales_getQuoteOperations"),);server.registerTool(@@ -1484,14 +1343,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote payment",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuotePayment(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuotePayment")+ }, "Failed: sales_getQuotePayment"),);server.registerTool(@@ -1499,14 +1358,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get quote shipment",inputSchema: {- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getQuoteShipment(ctx.client, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getQuoteShipment")+ }, "Failed: sales_getQuoteShipment"),);server.registerTool(@@ -1514,19 +1373,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get related prices for quote line",inputSchema: {- itemId: z.string(),- quoteId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ quoteId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getRelatedPricesForQuoteLine(- ctx.client,- params.itemId,- params.quoteId- );+ const result = await getRelatedPricesForQuoteLine(ctx.client, params.itemId, params.quoteId);return toMcpResult(result);- }, "Failed: sales_getRelatedPricesForQuoteLine")+ }, "Failed: sales_getRelatedPricesForQuoteLine"),);server.registerTool(@@ -1534,16 +1389,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales documents assigned to me",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesDocumentsAssignedToMe(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getSalesDocumentsAssignedToMe(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getSalesDocumentsAssignedToMe")+ }, "Failed: sales_getSalesDocumentsAssignedToMe"),);server.registerTool(@@ -1551,14 +1402,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesOrder(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrder")+ }, "Failed: sales_getSalesOrder"),);server.registerTool(@@ -1566,17 +1417,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order customer details",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderCustomerDetails(- ctx.client,- params.salesOrderId- );+ const result = await getSalesOrderCustomerDetails(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderCustomerDetails")+ }, "Failed: sales_getSalesOrderCustomerDetails"),);server.registerTool(@@ -1584,16 +1432,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order favorites",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderFavorites(- ctx.client,- ctx.companyId,- ctx.userId- );+ const result = await getSalesOrderFavorites(ctx.client, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderFavorites")+ }, "Failed: sales_getSalesOrderFavorites"),);server.registerTool(@@ -1601,19 +1445,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order related items",inputSchema: {- salesOrderId: z.string(),- opportunityId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ opportunityId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderRelatedItems(- ctx.client,- params.salesOrderId,- params.opportunityId- );+ const result = await getSalesOrderRelatedItems(ctx.client, params.salesOrderId, params.opportunityId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderRelatedItems")+ }, "Failed: sales_getSalesOrderRelatedItems"),);server.registerTool(@@ -1621,24 +1461,20 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales orders",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- status: z.string().nullable(),- customerId: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ status: z.string().nullable(),+ customerId: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrders(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getSalesOrders(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getSalesOrders")+ }, "Failed: sales_getSalesOrders"),);server.registerTool(@@ -1646,12 +1482,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales orders list",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesOrdersList(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getSalesOrdersList")+ }, "Failed: sales_getSalesOrdersList"),);server.registerTool(@@ -1659,17 +1495,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order payment",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderPayment(- ctx.client,- params.salesOrderId- );+ const result = await getSalesOrderPayment(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderPayment")+ }, "Failed: sales_getSalesOrderPayment"),);server.registerTool(@@ -1677,12 +1510,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales terms",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesTerms(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: sales_getSalesTerms")+ }, "Failed: sales_getSalesTerms"),);server.registerTool(@@ -1690,17 +1523,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order shipment",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderShipment(- ctx.client,- params.salesOrderId- );+ const result = await getSalesOrderShipment(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderShipment")+ }, "Failed: sales_getSalesOrderShipment"),);server.registerTool(@@ -1708,12 +1538,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order customers",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesOrderCustomers(ctx.client);return toMcpResult(result);- }, "Failed: sales_getSalesOrderCustomers")+ }, "Failed: sales_getSalesOrderCustomers"),);server.registerTool(@@ -1721,14 +1551,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order lines",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesOrderLines(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderLines")+ }, "Failed: sales_getSalesOrderLines"),);server.registerTool(@@ -1736,17 +1566,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order invoice lines",inputSchema: {- salesOrderId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderInvoiceLines(- ctx.client,- params.salesOrderId- );+ const result = await getSalesOrderInvoiceLines(ctx.client, params.salesOrderId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderInvoiceLines")+ }, "Failed: sales_getSalesOrderInvoiceLines"),);server.registerTool(@@ -1754,17 +1581,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order invoices by ids",inputSchema: {- invoiceIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ invoiceIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderInvoicesByIds(- ctx.client,- params.invoiceIds- );+ const result = await getSalesOrderInvoicesByIds(ctx.client, params.invoiceIds);return toMcpResult(result);- }, "Failed: sales_getSalesOrderInvoicesByIds")+ }, "Failed: sales_getSalesOrderInvoicesByIds"),);server.registerTool(@@ -1772,17 +1596,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order lines by item id",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderLinesByItemId(- ctx.client,- params.itemId- );+ const result = await getSalesOrderLinesByItemId(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderLinesByItemId")+ }, "Failed: sales_getSalesOrderLinesByItemId"),);server.registerTool(@@ -1790,17 +1611,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order lines by item ids",inputSchema: {- itemIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ itemIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderLinesByItemIds(- ctx.client,- params.itemIds- );+ const result = await getSalesOrderLinesByItemIds(ctx.client, params.itemIds);return toMcpResult(result);- }, "Failed: sales_getSalesOrderLinesByItemIds")+ }, "Failed: sales_getSalesOrderLinesByItemIds"),);server.registerTool(@@ -1808,17 +1626,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order line",inputSchema: {- salesOrderLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderLine(- ctx.client,- params.salesOrderLineId- );+ const result = await getSalesOrderLine(ctx.client, params.salesOrderLineId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderLine")+ }, "Failed: sales_getSalesOrderLine"),);server.registerTool(@@ -1826,17 +1641,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales order line shipments",inputSchema: {- salesOrderLineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesOrderLineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesOrderLineShipments(- ctx.client,- params.salesOrderLineId- );+ const result = await getSalesOrderLineShipments(ctx.client, params.salesOrderLineId);return toMcpResult(result);- }, "Failed: sales_getSalesOrderLineShipments")+ }, "Failed: sales_getSalesOrderLineShipments"),);server.registerTool(@@ -1844,14 +1656,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales r f q",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesRFQ(ctx.client, params.id);return toMcpResult(result);- }, "Failed: sales_getSalesRFQ")+ }, "Failed: sales_getSalesRFQ"),);server.registerTool(@@ -1859,16 +1671,12 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales r f q favorites",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSalesRFQFavorites(- ctx.client,- ctx.companyId,- ctx.userId- );+ const result = await getSalesRFQFavorites(ctx.client, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_getSalesRFQFavorites")+ }, "Failed: sales_getSalesRFQFavorites"),);server.registerTool(@@ -1876,18 +1684,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales r f qs",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesRFQs(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: sales_getSalesRFQs")+ }, "Failed: sales_getSalesRFQs"),);server.registerTool(@@ -1895,14 +1703,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales r f q line",inputSchema: {- lineId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ lineId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesRFQLine(ctx.client, params.lineId);return toMcpResult(result);- }, "Failed: sales_getSalesRFQLine")+ }, "Failed: sales_getSalesRFQLine"),);server.registerTool(@@ -1910,14 +1718,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "get sales r f q lines",inputSchema: {- salesRfqId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ salesRfqId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSalesRFQLines(ctx.client, params.salesRfqId);return toMcpResult(result);- }, "Failed: sales_getSalesRFQLines")+ }, "Failed: sales_getSalesRFQLines"),);server.registerTool(@@ -1925,17 +1733,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "insert customer contact",inputSchema: {- customerContact: customerContactValidator- },- annotations: WRITE_ANNOTATIONS+ customerContact: customerContactValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertCustomerContact(ctx.client, {- ...params.customerContact,- companyId: ctx.companyId- });+ const result = await insertCustomerContact(ctx.client, { ...params.customerContact, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: sales_insertCustomerContact")+ }, "Failed: sales_insertCustomerContact"),);server.registerTool(@@ -1943,28 +1748,25 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "insert customer location",inputSchema: {- customerLocation: z.object({- customerId: z.string(),- name: z.string(),- address: z.any(),- addressLine1: z.string().optional(),- addressLine2: z.string().optional(),- city: z.string().optional(),- stateProvince: z.string().optional(),- countryCode: z.string().optional(),- postalCode: z.string().optional(),- customFields: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ customerLocation: z.object({+ customerId: z.string(),+ name: z.string(),+ address: z.any(),+ addressLine1: z.string().optional(),+ addressLine2: z.string().optional(),+ city: z.string().optional(),+ stateProvince: z.string().optional(),+ countryCode: z.string().optional(),+ postalCode: z.string().optional(),+ customFields: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertCustomerLocation(ctx.client, {- ...params.customerLocation,- companyId: ctx.companyId- });+ const result = await insertCustomerLocation(ctx.client, { ...params.customerLocation, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: sales_insertCustomerLocation")+ }, "Failed: sales_insertCustomerLocation"),);server.registerTool(@@ -1972,18 +1774,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "insert sales order lines",inputSchema: {- salesOrderLines: salesOrderLineValidator- },- annotations: WRITE_ANNOTATIONS+ salesOrderLines: salesOrderLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertSalesOrderLines(ctx.client, {- ...params.salesOrderLines,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertSalesOrderLines(ctx.client, { ...params.salesOrderLines, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_insertSalesOrderLines")+ }, "Failed: sales_insertSalesOrderLines"),);server.registerTool(@@ -1991,18 +1789,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "finalize quote",inputSchema: {- quoteId: z.string()- },- annotations: WRITE_ANNOTATIONS+ quoteId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await finalizeQuote(- ctx.client,- params.quoteId,- ctx.userId- );+ const result = await finalizeQuote(ctx.client, params.quoteId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_finalizeQuote")+ }, "Failed: sales_finalizeQuote"),);server.registerTool(@@ -2010,18 +1804,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "release sales order",inputSchema: {- salesOrderId: z.string()- },- annotations: WRITE_ANNOTATIONS+ salesOrderId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await releaseSalesOrder(- ctx.client,- params.salesOrderId,- ctx.userId- );+ const result = await releaseSalesOrder(ctx.client, params.salesOrderId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_releaseSalesOrder")+ }, "Failed: sales_releaseSalesOrder"),);server.registerTool(@@ -2029,19 +1819,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert customer",inputSchema: {- customer: customerValidator- },- annotations: WRITE_ANNOTATIONS+ customer: customerValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertCustomer(ctx.client, {- ...params.customer,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertCustomer(ctx.client, { ...params.customer, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertCustomer")+ }, "Failed: sales_upsertCustomer"),);server.registerTool(@@ -2049,17 +1834,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update customer accounting",inputSchema: {- customerAccounting: customerAccountingValidator- },- annotations: WRITE_ANNOTATIONS+ customerAccounting: customerAccountingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCustomerAccounting(ctx.client, {- ...params.customerAccounting,- updatedBy: ctx.userId- });+ const result = await updateCustomerAccounting(ctx.client, { ...params.customerAccounting, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateCustomerAccounting")+ }, "Failed: sales_updateCustomerAccounting"),);server.registerTool(@@ -2067,17 +1849,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update customer contact",inputSchema: {- customerContact: customerContactValidator- },- annotations: WRITE_ANNOTATIONS+ customerContact: customerContactValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCustomerContact(- ctx.client,- params.customerContact- );+ const result = await updateCustomerContact(ctx.client, params.customerContact);return toMcpResult(result);- }, "Failed: sales_updateCustomerContact")+ }, "Failed: sales_updateCustomerContact"),);server.registerTool(@@ -2085,28 +1864,25 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update customer location",inputSchema: {- customerLocation: z.object({- addressId: z.string(),- name: z.string(),- address: z.any(),- addressLine1: z.string().optional(),- addressLine2: z.string().optional(),- city: z.string().optional(),- stateProvince: z.string().optional(),- countryCode: z.string().optional(),- postalCode: z.string().optional(),- customFields: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ customerLocation: z.object({+ addressId: z.string(),+ name: z.string(),+ address: z.any(),+ addressLine1: z.string().optional(),+ addressLine2: z.string().optional(),+ city: z.string().optional(),+ stateProvince: z.string().optional(),+ countryCode: z.string().optional(),+ postalCode: z.string().optional(),+ customFields: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCustomerLocation(- ctx.client,- params.customerLocation- );+ const result = await updateCustomerLocation(ctx.client, params.customerLocation);return toMcpResult(result);- }, "Failed: sales_updateCustomerLocation")+ }, "Failed: sales_updateCustomerLocation"),);server.registerTool(@@ -2114,17 +1890,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update customer payment",inputSchema: {- customerPayment: customerPaymentValidator- },- annotations: WRITE_ANNOTATIONS+ customerPayment: customerPaymentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCustomerPayment(ctx.client, {- ...params.customerPayment,- updatedBy: ctx.userId- });+ const result = await updateCustomerPayment(ctx.client, { ...params.customerPayment, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateCustomerPayment")+ }, "Failed: sales_updateCustomerPayment"),);server.registerTool(@@ -2132,17 +1905,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update customer shipping",inputSchema: {- customerShipping: customerShippingValidator- },- annotations: WRITE_ANNOTATIONS+ customerShipping: customerShippingValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCustomerShipping(ctx.client, {- ...params.customerShipping,- updatedBy: ctx.userId- });+ const result = await updateCustomerShipping(ctx.client, { ...params.customerShipping, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateCustomerShipping")+ }, "Failed: sales_updateCustomerShipping"),);server.registerTool(@@ -2150,19 +1920,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert customer status",inputSchema: {- customerStatus: customerStatusValidator- },- annotations: WRITE_ANNOTATIONS+ customerStatus: customerStatusValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertCustomerStatus(ctx.client, {- ...params.customerStatus,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertCustomerStatus(ctx.client, { ...params.customerStatus, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertCustomerStatus")+ }, "Failed: sales_upsertCustomerStatus"),);server.registerTool(@@ -2170,19 +1935,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert customer type",inputSchema: {- customerType: customerTypeValidator- },- annotations: WRITE_ANNOTATIONS+ customerType: customerTypeValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertCustomerType(ctx.client, {- ...params.customerType,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertCustomerType(ctx.client, { ...params.customerType, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertCustomerType")+ }, "Failed: sales_upsertCustomerType"),);server.registerTool(@@ -2190,19 +1950,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert no quote reason",inputSchema: {- noQuoteReason: noQuoteReasonValidator- },- annotations: WRITE_ANNOTATIONS+ noQuoteReason: noQuoteReasonValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertNoQuoteReason(ctx.client, {- ...params.noQuoteReason,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertNoQuoteReason(ctx.client, { ...params.noQuoteReason, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertNoQuoteReason")+ }, "Failed: sales_upsertNoQuoteReason"),);server.registerTool(@@ -2210,20 +1965,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales r f q favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesRFQFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateSalesRFQFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateSalesRFQFavorite")+ }, "Failed: sales_updateSalesRFQFavorite"),);server.registerTool(@@ -2231,20 +1983,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales r f q line order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesRFQLineOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateSalesRFQLineOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateSalesRFQLineOrder")+ }, "Failed: sales_updateSalesRFQLineOrder"),);server.registerTool(@@ -2252,17 +2001,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await updateQuoteExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: sales_updateQuoteExchangeRate")+ }, "Failed: sales_updateQuoteExchangeRate"),);server.registerTool(@@ -2270,19 +2019,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote line precision",inputSchema: {- quoteLineId: z.string(),- precision: z.number()- },- annotations: WRITE_ANNOTATIONS+ quoteLineId: z.string(),+ precision: z.number(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteLinePrecision(- ctx.client,- params.quoteLineId,- params.precision- );+ const result = await updateQuoteLinePrecision(ctx.client, params.quoteLineId, params.precision);return toMcpResult(result);- }, "Failed: sales_updateQuoteLinePrecision")+ }, "Failed: sales_updateQuoteLinePrecision"),);server.registerTool(@@ -2290,20 +2035,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales order exchange rate",inputSchema: {- data: z.object({- id: z.string(),- exchangeRate: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ id: z.string(),+ exchangeRate: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesOrderExchangeRate(- ctx.client,- params.data- );+ const result = await updateSalesOrderExchangeRate(ctx.client, params.data);return toMcpResult(result);- }, "Failed: sales_updateSalesOrderExchangeRate")+ }, "Failed: sales_updateSalesOrderExchangeRate"),);server.registerTool(@@ -2311,20 +2053,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateQuoteFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateQuoteFavorite")+ }, "Failed: sales_updateQuoteFavorite"),);server.registerTool(@@ -2332,22 +2071,19 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales r f q status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- noQuoteReasonId: z.string().nullable(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ noQuoteReasonId: z.string().nullable(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesRFQStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateSalesRFQStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateSalesRFQStatus")+ }, "Failed: sales_updateSalesRFQStatus"),);server.registerTool(@@ -2355,20 +2091,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote material order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteMaterialOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateQuoteMaterialOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateQuoteMaterialOrder")+ }, "Failed: sales_updateQuoteMaterialOrder"),);server.registerTool(@@ -2376,20 +2109,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote operation order",inputSchema: {- updates: z.object({- id: z.string(),- order: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ order: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteOperationOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateQuoteOperationOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateQuoteOperationOrder")+ }, "Failed: sales_updateQuoteOperationOrder"),);server.registerTool(@@ -2397,21 +2127,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update quote status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateQuoteStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateQuoteStatus")+ }, "Failed: sales_updateQuoteStatus"),);server.registerTool(@@ -2419,29 +2146,25 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert make method from quote line",inputSchema: {- lineMethod: z.object({- itemId: z.string(),- quoteId: z.string(),- quoteLineId: z.string(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ lineMethod: z.object({+ itemId: z.string(),+ quoteId: z.string(),+ quoteLineId: z.string(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMakeMethodFromQuoteLine(ctx.client, {- ...params.lineMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertMakeMethodFromQuoteLine(ctx.client, { ...params.lineMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertMakeMethodFromQuoteLine")+ }, "Failed: sales_upsertMakeMethodFromQuoteLine"),);server.registerTool(@@ -2449,28 +2172,24 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert make method from quote method",inputSchema: {- quoteMethod: z.object({- sourceId: z.string(),- targetId: z.string(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ quoteMethod: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertMakeMethodFromQuoteMethod(ctx.client, {- ...params.quoteMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertMakeMethodFromQuoteMethod(ctx.client, { ...params.quoteMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertMakeMethodFromQuoteMethod")+ }, "Failed: sales_upsertMakeMethodFromQuoteMethod"),);server.registerTool(@@ -2478,19 +2197,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote",inputSchema: {- quote: quoteValidator- },- annotations: WRITE_ANNOTATIONS+ quote: quoteValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuote(ctx.client, {- ...params.quote,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuote(ctx.client, { ...params.quote, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuote")+ }, "Failed: sales_upsertQuote"),);server.registerTool(@@ -2498,19 +2212,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote line",inputSchema: {- quotationLine: quoteLineValidator- },- annotations: WRITE_ANNOTATIONS+ quotationLine: quoteLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteLine(ctx.client, {- ...params.quotationLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteLine(ctx.client, { ...params.quotationLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteLine")+ }, "Failed: sales_upsertQuoteLine"),);server.registerTool(@@ -2518,19 +2227,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote line additional charges",inputSchema: {- lineId: z.string(),- update: quoteLineAdditionalChargesValidator- },- annotations: WRITE_ANNOTATIONS+ lineId: z.string(),+ update: quoteLineAdditionalChargesValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteLineAdditionalCharges(- ctx.client,- params.lineId,- { ...params.update, updatedBy: ctx.userId }- );+ const result = await upsertQuoteLineAdditionalCharges(ctx.client, params.lineId, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteLineAdditionalCharges")+ }, "Failed: sales_upsertQuoteLineAdditionalCharges"),);server.registerTool(@@ -2538,28 +2243,23 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote line prices",inputSchema: {- quoteId: z.string(),- lineId: z.string(),- quoteLinePrices: z.object({- quoteLineId: z.string(),- unitPrice: z.number(),- leadTime: z.number(),- discountPercent: z.number(),- quantity: z.number(),- categoryMarkups: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ quoteId: z.string(),+ lineId: z.string(),+ quoteLinePrices: z.object({+ quoteLineId: z.string(),+ unitPrice: z.number(),+ leadTime: z.number(),+ discountPercent: z.number(),+ quantity: z.number(),+ categoryMarkups: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteLinePrices(- ctx.client,- params.quoteId,- params.lineId,- { ...params.quoteLinePrices, createdBy: ctx.userId }- );+ const result = await upsertQuoteLinePrices(ctx.client, params.quoteId, params.lineId, { ...params.quoteLinePrices, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteLinePrices")+ }, "Failed: sales_upsertQuoteLinePrices"),);server.registerTool(@@ -2567,22 +2267,16 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "calculate prices for quantities",inputSchema: {- quoteId: z.string(),- quoteLineId: z.string(),- quantities: z.array(z.number())- },- annotations: WRITE_ANNOTATIONS+ quoteId: z.string(),+ quoteLineId: z.string(),+ quantities: z.array(z.number()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await calculatePricesForQuantities(- ctx.client,- params.quoteId,- params.quoteLineId,- params.quantities,- ctx.userId- );+ const result = await calculatePricesForQuantities(ctx.client, params.quoteId, params.quoteLineId, params.quantities, ctx.userId);return toMcpResult(result);- }, "Failed: sales_calculatePricesForQuantities")+ }, "Failed: sales_calculatePricesForQuantities"),);server.registerTool(@@ -2590,20 +2284,15 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "recalculate quote line prices",inputSchema: {- quoteId: z.string(),- quoteLineId: z.string()- },- annotations: WRITE_ANNOTATIONS+ quoteId: z.string(),+ quoteLineId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await recalculateQuoteLinePrices(- ctx.client,- params.quoteId,- params.quoteLineId,- ctx.userId- );+ const result = await recalculateQuoteLinePrices(ctx.client, params.quoteId, params.quoteLineId, ctx.userId);return toMcpResult(result);- }, "Failed: sales_recalculateQuoteLinePrices")+ }, "Failed: sales_recalculateQuoteLinePrices"),);server.registerTool(@@ -2611,30 +2300,26 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote line method",inputSchema: {- lineMethod: z.object({- itemId: z.string(),- quoteId: z.string(),- quoteLineId: z.string(),- configuration: z.any().optional(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ lineMethod: z.object({+ itemId: z.string(),+ quoteId: z.string(),+ quoteLineId: z.string(),+ configuration: z.any().optional(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteLineMethod(ctx.client, {- ...params.lineMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertQuoteLineMethod(ctx.client, { ...params.lineMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteLineMethod")+ }, "Failed: sales_upsertQuoteLineMethod"),);server.registerTool(@@ -2642,19 +2327,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote material",inputSchema: {- quoteMaterial: quoteMaterialValidator- },- annotations: WRITE_ANNOTATIONS+ quoteMaterial: quoteMaterialValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteMaterial(ctx.client, {- ...params.quoteMaterial,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteMaterial(ctx.client, { ...params.quoteMaterial, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteMaterial")+ }, "Failed: sales_upsertQuoteMaterial"),);server.registerTool(@@ -2662,29 +2342,25 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote material make method",inputSchema: {- quoteMethod: z.object({- sourceId: z.string(),- targetId: z.string(),- configuration: z.any().optional(),- parts: z.any().optional(),- billOfMaterial: z.boolean(),- billOfProcess: z.boolean(),- parameters: z.boolean(),- tools: z.boolean(),- steps: z.boolean(),- workInstructions: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ quoteMethod: z.object({+ sourceId: z.string(),+ targetId: z.string(),+ configuration: z.any().optional(),+ parts: z.any().optional(),+ billOfMaterial: z.boolean(),+ billOfProcess: z.boolean(),+ parameters: z.boolean(),+ tools: z.boolean(),+ steps: z.boolean(),+ workInstructions: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteMaterialMakeMethod(ctx.client, {- ...params.quoteMethod,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertQuoteMaterialMakeMethod(ctx.client, { ...params.quoteMethod, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteMaterialMakeMethod")+ }, "Failed: sales_upsertQuoteMaterialMakeMethod"),);server.registerTool(@@ -2692,19 +2368,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote operation",inputSchema: {- operation: quoteOperationValidator- },- annotations: WRITE_ANNOTATIONS+ operation: quoteOperationValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteOperation(ctx.client, {- ...params.operation,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteOperation(ctx.client, { ...params.operation, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteOperation")+ }, "Failed: sales_upsertQuoteOperation"),);server.registerTool(@@ -2712,19 +2383,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote operation step",inputSchema: {- quoteOperationStep: operationStepValidator- },- annotations: WRITE_ANNOTATIONS+ quoteOperationStep: operationStepValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteOperationStep(ctx.client, {- ...params.quoteOperationStep,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteOperationStep(ctx.client, { ...params.quoteOperationStep, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteOperationStep")+ }, "Failed: sales_upsertQuoteOperationStep"),);server.registerTool(@@ -2732,19 +2398,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote operation parameter",inputSchema: {- quoteOperationParameter: operationParameterValidator- },- annotations: WRITE_ANNOTATIONS+ quoteOperationParameter: operationParameterValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteOperationParameter(ctx.client, {- ...params.quoteOperationParameter,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteOperationParameter(ctx.client, { ...params.quoteOperationParameter, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteOperationParameter")+ }, "Failed: sales_upsertQuoteOperationParameter"),);server.registerTool(@@ -2752,19 +2413,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote operation tool",inputSchema: {- quoteOperationTool: operationToolValidator- },- annotations: WRITE_ANNOTATIONS+ quoteOperationTool: operationToolValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteOperationTool(ctx.client, {- ...params.quoteOperationTool,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteOperationTool(ctx.client, { ...params.quoteOperationTool, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteOperationTool")+ }, "Failed: sales_upsertQuoteOperationTool"),);server.registerTool(@@ -2772,18 +2428,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote payment",inputSchema: {- quotePayment: quotePaymentValidator- },- annotations: WRITE_ANNOTATIONS+ quotePayment: quotePaymentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuotePayment(ctx.client, {- ...params.quotePayment,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuotePayment(ctx.client, { ...params.quotePayment, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuotePayment")+ }, "Failed: sales_upsertQuotePayment"),);server.registerTool(@@ -2791,18 +2443,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert quote shipment",inputSchema: {- quoteShipment: quoteShipmentValidator- },- annotations: WRITE_ANNOTATIONS+ quoteShipment: quoteShipmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertQuoteShipment(ctx.client, {- ...params.quoteShipment,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertQuoteShipment(ctx.client, { ...params.quoteShipment, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertQuoteShipment")+ }, "Failed: sales_upsertQuoteShipment"),);server.registerTool(@@ -2810,20 +2458,17 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales order favorite",inputSchema: {- args: z.object({- id: z.string(),- favorite: z.boolean()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ id: z.string(),+ favorite: z.boolean()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesOrderFavorite(ctx.client, {- ...params.args,- userId: ctx.userId- });+ const result = await updateSalesOrderFavorite(ctx.client, { ...params.args, userId: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateSalesOrderFavorite")+ }, "Failed: sales_updateSalesOrderFavorite"),);server.registerTool(@@ -2831,21 +2476,18 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "update sales order status",inputSchema: {- update: z.object({- id: z.string(),- status: z.any(),- assignee: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ update: z.object({+ id: z.string(),+ status: z.any(),+ assignee: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesOrderStatus(ctx.client, {- ...params.update,- updatedBy: ctx.userId- });+ const result = await updateSalesOrderStatus(ctx.client, { ...params.update, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_updateSalesOrderStatus")+ }, "Failed: sales_updateSalesOrderStatus"),);server.registerTool(@@ -2853,19 +2495,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales order",inputSchema: {- salesOrder: salesOrderValidator- },- annotations: WRITE_ANNOTATIONS+ salesOrder: salesOrderValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesOrder(ctx.client, {- ...params.salesOrder,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesOrder(ctx.client, { ...params.salesOrder, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesOrder")+ }, "Failed: sales_upsertSalesOrder"),);server.registerTool(@@ -2873,18 +2510,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales order shipment",inputSchema: {- salesOrderShipment: salesOrderShipmentValidator- },- annotations: WRITE_ANNOTATIONS+ salesOrderShipment: salesOrderShipmentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesOrderShipment(ctx.client, {- ...params.salesOrderShipment,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesOrderShipment(ctx.client, { ...params.salesOrderShipment, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesOrderShipment")+ }, "Failed: sales_upsertSalesOrderShipment"),);server.registerTool(@@ -2892,19 +2525,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales order line",inputSchema: {- salesOrderLine: salesOrderLineValidator- },- annotations: WRITE_ANNOTATIONS+ salesOrderLine: salesOrderLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesOrderLine(ctx.client, {- ...params.salesOrderLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesOrderLine(ctx.client, { ...params.salesOrderLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesOrderLine")+ }, "Failed: sales_upsertSalesOrderLine"),);server.registerTool(@@ -2912,18 +2540,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales order payment",inputSchema: {- salesOrderPayment: salesOrderPaymentValidator- },- annotations: WRITE_ANNOTATIONS+ salesOrderPayment: salesOrderPaymentValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesOrderPayment(ctx.client, {- ...params.salesOrderPayment,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesOrderPayment(ctx.client, { ...params.salesOrderPayment, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesOrderPayment")+ }, "Failed: sales_upsertSalesOrderPayment"),);server.registerTool(@@ -2931,19 +2555,14 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales r f q",inputSchema: {- rfq: salesRfqValidator- },- annotations: WRITE_ANNOTATIONS+ rfq: salesRfqValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesRFQ(ctx.client, {- ...params.rfq,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesRFQ(ctx.client, { ...params.rfq, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesRFQ")+ }, "Failed: sales_upsertSalesRFQ"),);server.registerTool(@@ -2951,18 +2570,13 @@ export const registerSalesTools: RegisterTools = (server, ctx) => {{description: "upsert sales r f q line",inputSchema: {- salesRfqLine: salesRfqLineValidator- },- annotations: WRITE_ANNOTATIONS+ salesRfqLine: salesRfqLineValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSalesRFQLine(ctx.client, {- ...params.salesRfqLine,- companyId: ctx.companyId,- createdBy: ctx.userId,- updatedBy: ctx.userId- });+ const result = await upsertSalesRFQLine(ctx.client, { ...params.salesRfqLine, companyId: ctx.companyId, createdBy: ctx.userId, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: sales_upsertSalesRFQLine")+ }, "Failed: sales_upsertSalesRFQLine"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/settings.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/settings.tsindex d97edcdf5a..fab8faa99f 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/settings.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/settings.ts@@ -1,26 +1,28 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";import {- accountsPayableBillingAddressValidator,- accountsReceivableBillingAddressValidator,- apiKeyValidator,- companyValidator,- sequenceValidator,- webhookValidator-} from "~/modules/settings/settings.models";+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {- deactivateWebhooks,- deleteApiKey,- deleteWebhook,getAccountsPayableBillingAddress,getAccountsReceivableBillingAddress,+ updateAccountsPayableBillingAddress,+ updateAccountsReceivableBillingAddress,+ deleteApiKey,+ deleteWebhook,+ deactivateWebhooks,getApiKeys,getCompanies,getCompany,- getCompanyIntegrations,getCompanyPlan,getCompanySettings,+ getCompanyIntegrations,getConfig,getCurrentSequence,getCustomField,@@ -29,64 +31,62 @@ import {getIntegration,getIntegrations,getKanbanOutputSetting,- getNextSequence,getPlanById,getPlans,+ getNextSequence,getSequence,getSequences,getSequencesList,getTerms,getWebhook,- getWebhooks,getWebhookTables,+ getWebhooks,insertCompany,+ updateCompanyPlan,seedCompany,- updateAccountsPayableAddressSetting,- updateAccountsPayableBillingAddress,- updateAccountsPayableEmail,- updateAccountsReceivableAddressSetting,- updateAccountsReceivableBillingAddress,- updateAccountsReceivableEmail,updateCompany,- updateCompanyPlan,- updateConsoleSetting,- updateDefaultCustomerCc,- updateDefaultSupplierCc,- updateDigitalQuoteSetting,- updateIntegrationMetadata,- updateJobTravelerWorkInstructions,updateKanbanOutputSetting,- updateLeadTimesOnReceiptSetting,+ updateMetricSettings,+ upsertApiKey,+ updateDigitalQuoteSetting,updateLogoDark,- updateLogoDarkIcon,updateLogoLight,+ updateLogoDarkIcon,updateLogoLightIcon,- updateMaintenanceDispatchNotificationSettings,updateMaterialGeneratedIdsSetting,updateMaterialUnitsSetting,- updateMetricSettings,updateProductLabelSize,- updatePurchasePriceUpdateTimingSetting,updatePurchasingPdfThumbnails,- updateQuoteLineCategoryMarkups,- updateRfqReadySetting,updateSalesPdfThumbnails,- updateSequence,+ updateJobTravelerWorkInstructions,+ updateTimeCardSetting,+ updateConsoleSetting,+ updateRfqReadySetting,updateSuggestionNotificationSetting,- updateSupplierApprovalSetting,+ updateMaintenanceDispatchNotificationSettings,updateSupplierQuoteNotificationSetting,- updateTimeCardSetting,- upsertApiKey,- upsertWebhook+ updatePurchasePriceUpdateTimingSetting,+ updateLeadTimesOnReceiptSetting,+ updateSupplierApprovalSetting,+ updateAccountsPayableAddressSetting,+ updateAccountsReceivableAddressSetting,+ updateAccountsPayableEmail,+ updateAccountsReceivableEmail,+ updateDefaultSupplierCc,+ updateDefaultCustomerCc,+ updateQuoteLineCategoryMarkups,+ updateSequence,+ updateIntegrationMetadata,+ upsertWebhook,} from "~/modules/settings/settings.service";-import type { RegisterTools } from "../types";import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";+ accountsPayableBillingAddressValidator,+ accountsReceivableBillingAddressValidator,+ companyValidator,+ apiKeyValidator,+ sequenceValidator,+ webhookValidator,+} from "~/modules/settings/settings.models";export const registerSettingsTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -94,15 +94,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get accounts payable billing address",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountsPayableBillingAddress(- ctx.client,- ctx.companyId- );+ const result = await getAccountsPayableBillingAddress(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getAccountsPayableBillingAddress")+ }, "Failed: settings_getAccountsPayableBillingAddress"),);server.registerTool(@@ -110,15 +107,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get accounts receivable billing address",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getAccountsReceivableBillingAddress(- ctx.client,- ctx.companyId- );+ const result = await getAccountsReceivableBillingAddress(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getAccountsReceivableBillingAddress")+ }, "Failed: settings_getAccountsReceivableBillingAddress"),);server.registerTool(@@ -126,19 +120,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts payable billing address",inputSchema: {- data: accountsPayableBillingAddressValidator- },- annotations: WRITE_ANNOTATIONS+ data: accountsPayableBillingAddressValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsPayableBillingAddress(- ctx.client,- ctx.companyId,- params.data,- ctx.userId- );+ const result = await updateAccountsPayableBillingAddress(ctx.client, ctx.companyId, params.data, ctx.userId);return toMcpResult(result);- }, "Failed: settings_updateAccountsPayableBillingAddress")+ }, "Failed: settings_updateAccountsPayableBillingAddress"),);server.registerTool(@@ -146,19 +135,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts receivable billing address",inputSchema: {- data: accountsReceivableBillingAddressValidator- },- annotations: WRITE_ANNOTATIONS+ data: accountsReceivableBillingAddressValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsReceivableBillingAddress(- ctx.client,- ctx.companyId,- params.data,- ctx.userId- );+ const result = await updateAccountsReceivableBillingAddress(ctx.client, ctx.companyId, params.data, ctx.userId);return toMcpResult(result);- }, "Failed: settings_updateAccountsReceivableBillingAddress")+ }, "Failed: settings_updateAccountsReceivableBillingAddress"),);server.registerTool(@@ -166,14 +150,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "delete api key",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteApiKey(ctx.client, params.id);return toMcpResult(result);- }, "Failed: settings_deleteApiKey")+ }, "Failed: settings_deleteApiKey"),);server.registerTool(@@ -181,14 +165,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "delete webhook",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteWebhook(ctx.client, params.id);return toMcpResult(result);- }, "Failed: settings_deleteWebhook")+ }, "Failed: settings_deleteWebhook"),);server.registerTool(@@ -196,12 +180,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "deactivate webhooks",inputSchema: {},- annotations: WRITE_ANNOTATIONS+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deactivateWebhooks(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_deactivateWebhooks")+ }, "Failed: settings_deactivateWebhooks"),);server.registerTool(@@ -209,20 +193,18 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get api keys",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getApiKeys(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: settings_getApiKeys")+ }, "Failed: settings_getApiKeys"),);server.registerTool(@@ -230,12 +212,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get companies",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompanies(ctx.client, ctx.userId);return toMcpResult(result);- }, "Failed: settings_getCompanies")+ }, "Failed: settings_getCompanies"),);server.registerTool(@@ -243,12 +225,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get company",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompany(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCompany")+ }, "Failed: settings_getCompany"),);server.registerTool(@@ -256,12 +238,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get company plan",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompanyPlan(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCompanyPlan")+ }, "Failed: settings_getCompanyPlan"),);server.registerTool(@@ -269,12 +251,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get company settings",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompanySettings(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCompanySettings")+ }, "Failed: settings_getCompanySettings"),);server.registerTool(@@ -282,12 +264,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get company integrations",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompanyIntegrations(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCompanyIntegrations")+ }, "Failed: settings_getCompanyIntegrations"),);server.registerTool(@@ -295,12 +277,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get config",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getConfig(ctx.client);return toMcpResult(result);- }, "Failed: settings_getConfig")+ }, "Failed: settings_getConfig"),);server.registerTool(@@ -308,18 +290,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get current sequence",inputSchema: {- table: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCurrentSequence(- ctx.client,- params.table,- ctx.companyId- );+ const result = await getCurrentSequence(ctx.client, params.table, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCurrentSequence")+ }, "Failed: settings_getCurrentSequence"),);server.registerTool(@@ -327,14 +305,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get custom field",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomField(ctx.client, params.id);return toMcpResult(result);- }, "Failed: settings_getCustomField")+ }, "Failed: settings_getCustomField"),);server.registerTool(@@ -342,18 +320,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get custom fields",inputSchema: {- table: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomFields(- ctx.client,- params.table,- ctx.companyId- );+ const result = await getCustomFields(ctx.client, params.table, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getCustomFields")+ }, "Failed: settings_getCustomFields"),);server.registerTool(@@ -361,22 +335,18 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get custom fields tables",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomFieldsTables(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getCustomFieldsTables(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: settings_getCustomFieldsTables")+ }, "Failed: settings_getCustomFieldsTables"),);server.registerTool(@@ -384,14 +354,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get integration",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIntegration(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getIntegration")+ }, "Failed: settings_getIntegration"),);server.registerTool(@@ -399,12 +369,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get integrations",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getIntegrations(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getIntegrations")+ }, "Failed: settings_getIntegrations"),);server.registerTool(@@ -412,12 +382,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get kanban output setting",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getKanbanOutputSetting(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getKanbanOutputSetting")+ }, "Failed: settings_getKanbanOutputSetting"),);server.registerTool(@@ -425,14 +395,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get plan by id",inputSchema: {- planId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ planId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPlanById(ctx.client, params.planId);return toMcpResult(result);- }, "Failed: settings_getPlanById")+ }, "Failed: settings_getPlanById"),);server.registerTool(@@ -440,12 +410,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get plans",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPlans(ctx.client);return toMcpResult(result);- }, "Failed: settings_getPlans")+ }, "Failed: settings_getPlans"),);server.registerTool(@@ -453,18 +423,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get next sequence",inputSchema: {- table: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getNextSequence(- ctx.client,- params.table,- ctx.companyId- );+ const result = await getNextSequence(ctx.client, params.table, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getNextSequence")+ }, "Failed: settings_getNextSequence"),);server.registerTool(@@ -472,14 +438,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get sequence",inputSchema: {- table: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSequence(ctx.client, params.table, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getSequence")+ }, "Failed: settings_getSequence"),);server.registerTool(@@ -487,18 +453,18 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get sequences",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSequences(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: settings_getSequences")+ }, "Failed: settings_getSequences"),);server.registerTool(@@ -506,18 +472,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get sequences list",inputSchema: {- table: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getSequencesList(- ctx.client,- params.table,- ctx.companyId- );+ const result = await getSequencesList(ctx.client, params.table, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getSequencesList")+ }, "Failed: settings_getSequencesList"),);server.registerTool(@@ -525,12 +487,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get terms",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTerms(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: settings_getTerms")+ }, "Failed: settings_getTerms"),);server.registerTool(@@ -538,14 +500,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get webhook",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWebhook(ctx.client, params.id);return toMcpResult(result);- }, "Failed: settings_getWebhook")+ }, "Failed: settings_getWebhook"),);server.registerTool(@@ -553,12 +515,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get webhook tables",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWebhookTables(ctx.client);return toMcpResult(result);- }, "Failed: settings_getWebhookTables")+ }, "Failed: settings_getWebhookTables"),);server.registerTool(@@ -566,20 +528,18 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "get webhooks",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getWebhooks(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: settings_getWebhooks")+ }, "Failed: settings_getWebhooks"),);server.registerTool(@@ -587,19 +547,15 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "insert company",inputSchema: {- company: companyValidator,- ownerId: z.string().optional()- },- annotations: WRITE_ANNOTATIONS+ company: companyValidator,+ ownerId: z.string().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertCompany(- ctx.client,- params.company,- params.ownerId- );+ const result = await insertCompany(ctx.client, params.company, params.ownerId);return toMcpResult(result);- }, "Failed: settings_insertCompany")+ }, "Failed: settings_insertCompany"),);server.registerTool(@@ -607,22 +563,19 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update company plan",inputSchema: {- data: z.object({- stripeCustomerId: z.string(),- stripeSubscriptionId: z.string(),- stripeSubscriptionStatus: z.string(),- subscriptionStartDate: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ data: z.object({+ stripeCustomerId: z.string(),+ stripeSubscriptionId: z.string(),+ stripeSubscriptionStatus: z.string(),+ subscriptionStartDate: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCompanyPlan(ctx.client, {- ...params.data,- companyId: ctx.companyId- });+ const result = await updateCompanyPlan(ctx.client, { ...params.data, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: settings_updateCompanyPlan")+ }, "Failed: settings_updateCompanyPlan"),);server.registerTool(@@ -630,12 +583,12 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "seed company",inputSchema: {},- annotations: WRITE_ANNOTATIONS+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await seedCompany(ctx.client, ctx.companyId, ctx.userId);return toMcpResult(result);- }, "Failed: settings_seedCompany")+ }, "Failed: settings_seedCompany"),);server.registerTool(@@ -643,18 +596,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update company",inputSchema: {- company: companyValidator- },- annotations: WRITE_ANNOTATIONS+ company: companyValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateCompany(ctx.client, ctx.companyId, {- ...params.company,- updatedBy: ctx.userId,- companyId: ctx.companyId- });+ const result = await updateCompany(ctx.client, ctx.companyId, { ...params.company, updatedBy: ctx.userId, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: settings_updateCompany")+ }, "Failed: settings_updateCompany"),);server.registerTool(@@ -662,18 +611,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update kanban output setting",inputSchema: {- kanbanOutput: z.any()- },- annotations: WRITE_ANNOTATIONS+ kanbanOutput: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateKanbanOutputSetting(- ctx.client,- ctx.companyId,- params.kanbanOutput- );+ const result = await updateKanbanOutputSetting(ctx.client, ctx.companyId, params.kanbanOutput);return toMcpResult(result);- }, "Failed: settings_updateKanbanOutputSetting")+ }, "Failed: settings_updateKanbanOutputSetting"),);server.registerTool(@@ -681,18 +626,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update metric settings",inputSchema: {- useMetric: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ useMetric: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMetricSettings(- ctx.client,- ctx.companyId,- params.useMetric- );+ const result = await updateMetricSettings(ctx.client, ctx.companyId, params.useMetric);return toMcpResult(result);- }, "Failed: settings_updateMetricSettings")+ }, "Failed: settings_updateMetricSettings"),);server.registerTool(@@ -700,18 +641,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "upsert api key",inputSchema: {- apiKey: apiKeyValidator- },- annotations: WRITE_ANNOTATIONS+ apiKey: apiKeyValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertApiKey(ctx.client, {- ...params.apiKey,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await upsertApiKey(ctx.client, { ...params.apiKey, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: settings_upsertApiKey")+ }, "Failed: settings_upsertApiKey"),);server.registerTool(@@ -719,22 +656,16 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update digital quote setting",inputSchema: {- digitalQuoteEnabled: z.boolean(),- digitalQuoteNotificationGroup: z.array(z.string()),- digitalQuoteIncludesPurchaseOrders: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ digitalQuoteEnabled: z.boolean(),+ digitalQuoteNotificationGroup: z.array(z.string()),+ digitalQuoteIncludesPurchaseOrders: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDigitalQuoteSetting(- ctx.client,- ctx.companyId,- params.digitalQuoteEnabled,- params.digitalQuoteNotificationGroup,- params.digitalQuoteIncludesPurchaseOrders- );+ const result = await updateDigitalQuoteSetting(ctx.client, ctx.companyId, params.digitalQuoteEnabled, params.digitalQuoteNotificationGroup, params.digitalQuoteIncludesPurchaseOrders);return toMcpResult(result);- }, "Failed: settings_updateDigitalQuoteSetting")+ }, "Failed: settings_updateDigitalQuoteSetting"),);server.registerTool(@@ -742,18 +673,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update logo dark",inputSchema: {- logoDark: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ logoDark: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateLogoDark(- ctx.client,- ctx.companyId,- params.logoDark- );+ const result = await updateLogoDark(ctx.client, ctx.companyId, params.logoDark);return toMcpResult(result);- }, "Failed: settings_updateLogoDark")+ }, "Failed: settings_updateLogoDark"),);server.registerTool(@@ -761,18 +688,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update logo light",inputSchema: {- logoLight: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ logoLight: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateLogoLight(- ctx.client,- ctx.companyId,- params.logoLight- );+ const result = await updateLogoLight(ctx.client, ctx.companyId, params.logoLight);return toMcpResult(result);- }, "Failed: settings_updateLogoLight")+ }, "Failed: settings_updateLogoLight"),);server.registerTool(@@ -780,18 +703,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update logo dark icon",inputSchema: {- logoDarkIcon: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ logoDarkIcon: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateLogoDarkIcon(- ctx.client,- ctx.companyId,- params.logoDarkIcon- );+ const result = await updateLogoDarkIcon(ctx.client, ctx.companyId, params.logoDarkIcon);return toMcpResult(result);- }, "Failed: settings_updateLogoDarkIcon")+ }, "Failed: settings_updateLogoDarkIcon"),);server.registerTool(@@ -799,18 +718,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update logo light icon",inputSchema: {- logoLightIcon: z.string().nullable()- },- annotations: WRITE_ANNOTATIONS+ logoLightIcon: z.string().nullable(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateLogoLightIcon(- ctx.client,- ctx.companyId,- params.logoLightIcon- );+ const result = await updateLogoLightIcon(ctx.client, ctx.companyId, params.logoLightIcon);return toMcpResult(result);- }, "Failed: settings_updateLogoLightIcon")+ }, "Failed: settings_updateLogoLightIcon"),);server.registerTool(@@ -818,18 +733,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update material generated ids setting",inputSchema: {- materialGeneratedIds: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ materialGeneratedIds: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMaterialGeneratedIdsSetting(- ctx.client,- ctx.companyId,- params.materialGeneratedIds- );+ const result = await updateMaterialGeneratedIdsSetting(ctx.client, ctx.companyId, params.materialGeneratedIds);return toMcpResult(result);- }, "Failed: settings_updateMaterialGeneratedIdsSetting")+ }, "Failed: settings_updateMaterialGeneratedIdsSetting"),);server.registerTool(@@ -837,18 +748,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update material units setting",inputSchema: {- useMetric: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ useMetric: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMaterialUnitsSetting(- ctx.client,- ctx.companyId,- params.useMetric- );+ const result = await updateMaterialUnitsSetting(ctx.client, ctx.companyId, params.useMetric);return toMcpResult(result);- }, "Failed: settings_updateMaterialUnitsSetting")+ }, "Failed: settings_updateMaterialUnitsSetting"),);server.registerTool(@@ -856,18 +763,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update product label size",inputSchema: {- productLabelSize: z.string()- },- annotations: WRITE_ANNOTATIONS+ productLabelSize: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateProductLabelSize(- ctx.client,- ctx.companyId,- params.productLabelSize- );+ const result = await updateProductLabelSize(ctx.client, ctx.companyId, params.productLabelSize);return toMcpResult(result);- }, "Failed: settings_updateProductLabelSize")+ }, "Failed: settings_updateProductLabelSize"),);server.registerTool(@@ -875,18 +778,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update purchasing pdf thumbnails",inputSchema: {- includeThumbnailsOnPurchasingPdfs: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ includeThumbnailsOnPurchasingPdfs: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchasingPdfThumbnails(- ctx.client,- ctx.companyId,- params.includeThumbnailsOnPurchasingPdfs- );+ const result = await updatePurchasingPdfThumbnails(ctx.client, ctx.companyId, params.includeThumbnailsOnPurchasingPdfs);return toMcpResult(result);- }, "Failed: settings_updatePurchasingPdfThumbnails")+ }, "Failed: settings_updatePurchasingPdfThumbnails"),);server.registerTool(@@ -894,18 +793,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update sales pdf thumbnails",inputSchema: {- includeThumbnailsOnSalesPdfs: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ includeThumbnailsOnSalesPdfs: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSalesPdfThumbnails(- ctx.client,- ctx.companyId,- params.includeThumbnailsOnSalesPdfs- );+ const result = await updateSalesPdfThumbnails(ctx.client, ctx.companyId, params.includeThumbnailsOnSalesPdfs);return toMcpResult(result);- }, "Failed: settings_updateSalesPdfThumbnails")+ }, "Failed: settings_updateSalesPdfThumbnails"),);server.registerTool(@@ -913,18 +808,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update job traveler work instructions",inputSchema: {- jobTravelerIncludeWorkInstructions: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ jobTravelerIncludeWorkInstructions: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateJobTravelerWorkInstructions(- ctx.client,- ctx.companyId,- params.jobTravelerIncludeWorkInstructions- );+ const result = await updateJobTravelerWorkInstructions(ctx.client, ctx.companyId, params.jobTravelerIncludeWorkInstructions);return toMcpResult(result);- }, "Failed: settings_updateJobTravelerWorkInstructions")+ }, "Failed: settings_updateJobTravelerWorkInstructions"),);server.registerTool(@@ -932,18 +823,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update time card setting",inputSchema: {- timeCardEnabled: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ timeCardEnabled: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateTimeCardSetting(- ctx.client,- ctx.companyId,- params.timeCardEnabled- );+ const result = await updateTimeCardSetting(ctx.client, ctx.companyId, params.timeCardEnabled);return toMcpResult(result);- }, "Failed: settings_updateTimeCardSetting")+ }, "Failed: settings_updateTimeCardSetting"),);server.registerTool(@@ -951,19 +838,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update console setting",inputSchema: {- consoleEnabled: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ consoleEnabled: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateConsoleSetting(- ctx.client,- ctx.companyId,- params.consoleEnabled,- ctx.userId- );+ const result = await updateConsoleSetting(ctx.client, ctx.companyId, params.consoleEnabled, ctx.userId);return toMcpResult(result);- }, "Failed: settings_updateConsoleSetting")+ }, "Failed: settings_updateConsoleSetting"),);server.registerTool(@@ -971,18 +853,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update rfq ready setting",inputSchema: {- rfqReadyNotificationGroup: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ rfqReadyNotificationGroup: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateRfqReadySetting(- ctx.client,- ctx.companyId,- params.rfqReadyNotificationGroup- );+ const result = await updateRfqReadySetting(ctx.client, ctx.companyId, params.rfqReadyNotificationGroup);return toMcpResult(result);- }, "Failed: settings_updateRfqReadySetting")+ }, "Failed: settings_updateRfqReadySetting"),);server.registerTool(@@ -990,18 +868,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update suggestion notification setting",inputSchema: {- suggestionNotificationGroup: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ suggestionNotificationGroup: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSuggestionNotificationSetting(- ctx.client,- ctx.companyId,- params.suggestionNotificationGroup- );+ const result = await updateSuggestionNotificationSetting(ctx.client, ctx.companyId, params.suggestionNotificationGroup);return toMcpResult(result);- }, "Failed: settings_updateSuggestionNotificationSetting")+ }, "Failed: settings_updateSuggestionNotificationSetting"),);server.registerTool(@@ -1009,23 +883,19 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update maintenance dispatch notification settings",inputSchema: {- settings: z.object({- maintenanceDispatchNotificationGroup: z.array(z.string()).optional(),- qualityDispatchNotificationGroup: z.array(z.string()).optional(),- operationsDispatchNotificationGroup: z.array(z.string()).optional(),- otherDispatchNotificationGroup: z.array(z.string()).optional()- })- },- annotations: WRITE_ANNOTATIONS+ settings: z.object({+ maintenanceDispatchNotificationGroup: z.array(z.string()).optional(),+ qualityDispatchNotificationGroup: z.array(z.string()).optional(),+ operationsDispatchNotificationGroup: z.array(z.string()).optional(),+ otherDispatchNotificationGroup: z.array(z.string()).optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateMaintenanceDispatchNotificationSettings(- ctx.client,- ctx.companyId,- params.settings- );+ const result = await updateMaintenanceDispatchNotificationSettings(ctx.client, ctx.companyId, params.settings);return toMcpResult(result);- }, "Failed: settings_updateMaintenanceDispatchNotificationSettings")+ }, "Failed: settings_updateMaintenanceDispatchNotificationSettings"),);server.registerTool(@@ -1033,18 +903,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update supplier quote notification setting",inputSchema: {- supplierQuoteNotificationGroup: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ supplierQuoteNotificationGroup: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierQuoteNotificationSetting(- ctx.client,- ctx.companyId,- params.supplierQuoteNotificationGroup- );+ const result = await updateSupplierQuoteNotificationSetting(ctx.client, ctx.companyId, params.supplierQuoteNotificationGroup);return toMcpResult(result);- }, "Failed: settings_updateSupplierQuoteNotificationSetting")+ }, "Failed: settings_updateSupplierQuoteNotificationSetting"),);server.registerTool(@@ -1052,18 +918,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update purchase price update timing setting",inputSchema: {- purchasePriceUpdateTiming: z.any()- },- annotations: WRITE_ANNOTATIONS+ purchasePriceUpdateTiming: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updatePurchasePriceUpdateTimingSetting(- ctx.client,- ctx.companyId,- params.purchasePriceUpdateTiming- );+ const result = await updatePurchasePriceUpdateTimingSetting(ctx.client, ctx.companyId, params.purchasePriceUpdateTiming);return toMcpResult(result);- }, "Failed: settings_updatePurchasePriceUpdateTimingSetting")+ }, "Failed: settings_updatePurchasePriceUpdateTimingSetting"),);server.registerTool(@@ -1071,18 +933,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update lead times on receipt setting",inputSchema: {- updateLeadTimesOnReceipt: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ updateLeadTimesOnReceipt: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateLeadTimesOnReceiptSetting(- ctx.client,- ctx.companyId,- params.updateLeadTimesOnReceipt- );+ const result = await updateLeadTimesOnReceiptSetting(ctx.client, ctx.companyId, params.updateLeadTimesOnReceipt);return toMcpResult(result);- }, "Failed: settings_updateLeadTimesOnReceiptSetting")+ }, "Failed: settings_updateLeadTimesOnReceiptSetting"),);server.registerTool(@@ -1090,18 +948,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update supplier approval setting",inputSchema: {- supplierApproval: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ supplierApproval: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSupplierApprovalSetting(- ctx.client,- ctx.companyId,- params.supplierApproval- );+ const result = await updateSupplierApprovalSetting(ctx.client, ctx.companyId, params.supplierApproval);return toMcpResult(result);- }, "Failed: settings_updateSupplierApprovalSetting")+ }, "Failed: settings_updateSupplierApprovalSetting"),);server.registerTool(@@ -1109,18 +963,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts payable address setting",inputSchema: {- accountsPayableAddress: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ accountsPayableAddress: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsPayableAddressSetting(- ctx.client,- ctx.companyId,- params.accountsPayableAddress- );+ const result = await updateAccountsPayableAddressSetting(ctx.client, ctx.companyId, params.accountsPayableAddress);return toMcpResult(result);- }, "Failed: settings_updateAccountsPayableAddressSetting")+ }, "Failed: settings_updateAccountsPayableAddressSetting"),);server.registerTool(@@ -1128,18 +978,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts receivable address setting",inputSchema: {- accountsReceivableAddress: z.boolean()- },- annotations: WRITE_ANNOTATIONS+ accountsReceivableAddress: z.boolean(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsReceivableAddressSetting(- ctx.client,- ctx.companyId,- params.accountsReceivableAddress- );+ const result = await updateAccountsReceivableAddressSetting(ctx.client, ctx.companyId, params.accountsReceivableAddress);return toMcpResult(result);- }, "Failed: settings_updateAccountsReceivableAddressSetting")+ }, "Failed: settings_updateAccountsReceivableAddressSetting"),);server.registerTool(@@ -1147,18 +993,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts payable email",inputSchema: {- accountsPayableEmail: z.any()- },- annotations: WRITE_ANNOTATIONS+ accountsPayableEmail: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsPayableEmail(- ctx.client,- ctx.companyId,- params.accountsPayableEmail- );+ const result = await updateAccountsPayableEmail(ctx.client, ctx.companyId, params.accountsPayableEmail);return toMcpResult(result);- }, "Failed: settings_updateAccountsPayableEmail")+ }, "Failed: settings_updateAccountsPayableEmail"),);server.registerTool(@@ -1166,18 +1008,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update accounts receivable email",inputSchema: {- accountsReceivableEmail: z.any()- },- annotations: WRITE_ANNOTATIONS+ accountsReceivableEmail: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateAccountsReceivableEmail(- ctx.client,- ctx.companyId,- params.accountsReceivableEmail- );+ const result = await updateAccountsReceivableEmail(ctx.client, ctx.companyId, params.accountsReceivableEmail);return toMcpResult(result);- }, "Failed: settings_updateAccountsReceivableEmail")+ }, "Failed: settings_updateAccountsReceivableEmail"),);server.registerTool(@@ -1185,18 +1023,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update default supplier cc",inputSchema: {- defaultSupplierCc: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ defaultSupplierCc: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDefaultSupplierCc(- ctx.client,- ctx.companyId,- params.defaultSupplierCc- );+ const result = await updateDefaultSupplierCc(ctx.client, ctx.companyId, params.defaultSupplierCc);return toMcpResult(result);- }, "Failed: settings_updateDefaultSupplierCc")+ }, "Failed: settings_updateDefaultSupplierCc"),);server.registerTool(@@ -1204,18 +1038,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update default customer cc",inputSchema: {- defaultCustomerCc: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ defaultCustomerCc: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateDefaultCustomerCc(- ctx.client,- ctx.companyId,- params.defaultCustomerCc- );+ const result = await updateDefaultCustomerCc(ctx.client, ctx.companyId, params.defaultCustomerCc);return toMcpResult(result);- }, "Failed: settings_updateDefaultCustomerCc")+ }, "Failed: settings_updateDefaultCustomerCc"),);server.registerTool(@@ -1223,18 +1053,14 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update quote line category markups",inputSchema: {- quoteLineCategoryMarkups: z.any()- },- annotations: WRITE_ANNOTATIONS+ quoteLineCategoryMarkups: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateQuoteLineCategoryMarkups(- ctx.client,- ctx.companyId,- params.quoteLineCategoryMarkups- );+ const result = await updateQuoteLineCategoryMarkups(ctx.client, ctx.companyId, params.quoteLineCategoryMarkups);return toMcpResult(result);- }, "Failed: settings_updateQuoteLineCategoryMarkups")+ }, "Failed: settings_updateQuoteLineCategoryMarkups"),);server.registerTool(@@ -1242,20 +1068,15 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update sequence",inputSchema: {- table: z.string(),- sequence: sequenceValidator- },- annotations: WRITE_ANNOTATIONS+ table: z.string(),+ sequence: sequenceValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSequence(- ctx.client,- params.table,- ctx.companyId,- { ...params.sequence, updatedBy: ctx.userId, companyId: ctx.companyId }- );+ const result = await updateSequence(ctx.client, params.table, ctx.companyId, { ...params.sequence, updatedBy: ctx.userId, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: settings_updateSequence")+ }, "Failed: settings_updateSequence"),);server.registerTool(@@ -1263,21 +1084,15 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "update integration metadata",inputSchema: {- integrationId: z.string(),- metadata: z.any()- },- annotations: WRITE_ANNOTATIONS+ integrationId: z.string(),+ metadata: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateIntegrationMetadata(- ctx.client,- ctx.companyId,- params.integrationId,- params.metadata,- ctx.userId- );+ const result = await updateIntegrationMetadata(ctx.client, ctx.companyId, params.integrationId, params.metadata, ctx.userId);return toMcpResult(result);- }, "Failed: settings_updateIntegrationMetadata")+ }, "Failed: settings_updateIntegrationMetadata"),);server.registerTool(@@ -1285,17 +1100,13 @@ export const registerSettingsTools: RegisterTools = (server, ctx) => {{description: "upsert webhook",inputSchema: {- webhook: webhookValidator- },- annotations: WRITE_ANNOTATIONS+ webhook: webhookValidator,+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertWebhook(ctx.client, {- ...params.webhook,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await upsertWebhook(ctx.client, { ...params.webhook, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: settings_upsertWebhook")+ }, "Failed: settings_upsertWebhook"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/shared.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/shared.tsindex a18e3008f8..155a0a920a 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/shared.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/shared.ts@@ -1,6 +1,14 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";+import {+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {approveRequest,canApproveRequest,@@ -9,23 +17,19 @@ import {canViewApprovalRequest,createApprovalRequest,deleteApprovalRule,- deleteCustomerPortal,deleteNote,deleteSavedView,generateEmbedding,getApprovalById,getApprovalRequestsByDocument,getApprovalRuleByAmount,+ getApproverUserIdsForRule,getApprovalRuleById,getApprovalRules,getApprovalRulesForApprover,getApprovalsForUser,- getApproverUserIdsForRule,getBase64ImageFromSupabase,getCountries,- getCustomerPortal,- getCustomerPortals,- getExternalLink,getLatestApprovalRequestForDocument,getModelByItemId,getNotes,@@ -38,23 +42,19 @@ import {insertNote,insertTag,isApprovalRequired,- rejectRequest,+ getExternalLink,+ upsertExternalLink,+ getCustomerPortals,+ getCustomerPortal,+ deleteCustomerPortal,updateModelThumbnail,+ upsertModelUpload,updateNote,- updateSavedViewOrder,+ rejectRequest,upsertApprovalRule,- upsertExternalLink,- upsertModelUpload,- upsertSavedView+ upsertSavedView,+ updateSavedViewOrder,} from "~/modules/shared/shared.service";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerSharedTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -62,22 +62,16 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "approve request",inputSchema: {- db: z.any(),- id: z.string(),- notes: z.string().optional()- },- annotations: WRITE_ANNOTATIONS+ db: z.any(),+ id: z.string(),+ notes: z.string().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await approveRequest(- ctx.client,- params.db,- params.id,- ctx.userId,- params.notes- );+ const result = await approveRequest(ctx.client, params.db, params.id, ctx.userId, params.notes);return toMcpResult(result);- }, "Failed: shared_approveRequest")+ }, "Failed: shared_approveRequest"),);server.registerTool(@@ -85,18 +79,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "can approve request",inputSchema: {- approvalRequest: z.any()- },- annotations: WRITE_ANNOTATIONS+ approvalRequest: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await canApproveRequest(- ctx.client,- params.approvalRequest,- ctx.userId- );+ const result = await canApproveRequest(ctx.client, params.approvalRequest, ctx.userId);return toMcpResult(result);- }, "Failed: shared_canApproveRequest")+ }, "Failed: shared_canApproveRequest"),);server.registerTool(@@ -104,18 +94,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "can approve request in window",inputSchema: {- approvalRequest: z.any()- },- annotations: WRITE_ANNOTATIONS+ approvalRequest: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await canApproveRequestInWindow(- ctx.client,- params.approvalRequest,- ctx.userId- );+ const result = await canApproveRequestInWindow(ctx.client, params.approvalRequest, ctx.userId);return toMcpResult(result);- }, "Failed: shared_canApproveRequestInWindow")+ }, "Failed: shared_canApproveRequestInWindow"),);server.registerTool(@@ -123,18 +109,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "cancel approval request",inputSchema: {- id: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await cancelApprovalRequest(- ctx.client,- params.id,- ctx.userId- );+ const result = await cancelApprovalRequest(ctx.client, params.id, ctx.userId);return toMcpResult(result);- }, "Failed: shared_cancelApprovalRequest")+ }, "Failed: shared_cancelApprovalRequest"),);server.registerTool(@@ -142,18 +124,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "can view approval request",inputSchema: {- approvalRequest: z.any()- },- annotations: WRITE_ANNOTATIONS+ approvalRequest: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await canViewApprovalRequest(- ctx.client,- params.approvalRequest,- ctx.userId- );+ const result = await canViewApprovalRequest(ctx.client, params.approvalRequest, ctx.userId);return toMcpResult(result);- }, "Failed: shared_canViewApprovalRequest")+ }, "Failed: shared_canViewApprovalRequest"),);server.registerTool(@@ -161,14 +139,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "create approval request",inputSchema: {- request: z.any()- },- annotations: WRITE_ANNOTATIONS+ request: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await createApprovalRequest(ctx.client, params.request);return toMcpResult(result);- }, "Failed: shared_createApprovalRequest")+ }, "Failed: shared_createApprovalRequest"),);server.registerTool(@@ -176,18 +154,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "delete approval rule",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteApprovalRule(- ctx.client,- params.id,- ctx.companyId- );+ const result = await deleteApprovalRule(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_deleteApprovalRule")+ }, "Failed: shared_deleteApprovalRule"),);server.registerTool(@@ -195,14 +169,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "delete note",inputSchema: {- noteId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ noteId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteNote(ctx.client, params.noteId);return toMcpResult(result);- }, "Failed: shared_deleteNote")+ }, "Failed: shared_deleteNote"),);server.registerTool(@@ -210,14 +184,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "delete saved view",inputSchema: {- viewId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ viewId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteSavedView(ctx.client, params.viewId);return toMcpResult(result);- }, "Failed: shared_deleteSavedView")+ }, "Failed: shared_deleteSavedView"),);server.registerTool(@@ -225,14 +199,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "generate embedding",inputSchema: {- text: z.string()- },- annotations: WRITE_ANNOTATIONS+ text: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await generateEmbedding(ctx.client, params.text);return toMcpResult(result);- }, "Failed: shared_generateEmbedding")+ }, "Failed: shared_generateEmbedding"),);server.registerTool(@@ -240,14 +214,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval by id",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getApprovalById(ctx.client, params.id);return toMcpResult(result);- }, "Failed: shared_getApprovalById")+ }, "Failed: shared_getApprovalById"),);server.registerTool(@@ -255,19 +229,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval requests by document",inputSchema: {- documentType: z.any(),- documentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ documentType: z.any(),+ documentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getApprovalRequestsByDocument(- ctx.client,- params.documentType,- params.documentId- );+ const result = await getApprovalRequestsByDocument(ctx.client, params.documentType, params.documentId);return toMcpResult(result);- }, "Failed: shared_getApprovalRequestsByDocument")+ }, "Failed: shared_getApprovalRequestsByDocument"),);server.registerTool(@@ -275,20 +245,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval rule by amount",inputSchema: {- documentType: z.any(),- amount: z.number().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ documentType: z.any(),+ amount: z.number().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getApprovalRuleByAmount(- ctx.client,- params.documentType,- ctx.companyId,- params.amount- );+ const result = await getApprovalRuleByAmount(ctx.client, params.documentType, ctx.companyId, params.amount);return toMcpResult(result);- }, "Failed: shared_getApprovalRuleByAmount")+ }, "Failed: shared_getApprovalRuleByAmount"),);server.registerTool(@@ -296,14 +261,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approver user ids for rule",inputSchema: {- rule: z.any()- },- annotations: READ_ONLY_ANNOTATIONS+ rule: z.any(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getApproverUserIdsForRule(ctx.client, params.rule);return toMcpResult(result);- }, "Failed: shared_getApproverUserIdsForRule")+ }, "Failed: shared_getApproverUserIdsForRule"),);server.registerTool(@@ -311,18 +276,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval rule by id",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getApprovalRuleById(- ctx.client,- params.id,- ctx.companyId- );+ const result = await getApprovalRuleById(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_getApprovalRuleById")+ }, "Failed: shared_getApprovalRuleById"),);server.registerTool(@@ -330,12 +291,12 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval rules",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getApprovalRules(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_getApprovalRules")+ }, "Failed: shared_getApprovalRules"),);server.registerTool(@@ -343,18 +304,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approval rules for approver",inputSchema: {- documentType: z.any()- },- annotations: READ_ONLY_ANNOTATIONS+ documentType: z.any(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getApprovalRulesForApprover(- ctx.client,- params.documentType,- ctx.companyId- );+ const result = await getApprovalRulesForApprover(ctx.client, params.documentType, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_getApprovalRulesForApprover")+ }, "Failed: shared_getApprovalRulesForApprover"),);server.registerTool(@@ -362,24 +319,17 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get approvals for user",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0)- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0)+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getApprovalsForUser(- ctx.client,- ctx.userId,- ctx.companyId,- params.args- );+ const result = await getApprovalsForUser(ctx.client, ctx.userId, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: shared_getApprovalsForUser")+ }, "Failed: shared_getApprovalsForUser"),);server.registerTool(@@ -387,14 +337,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get base64 image from supabase",inputSchema: {- path: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ path: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getBase64ImageFromSupabase(ctx.client, params.path);return toMcpResult(result);- }, "Failed: shared_getBase64ImageFromSupabase")+ }, "Failed: shared_getBase64ImageFromSupabase"),);server.registerTool(@@ -402,12 +352,12 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get countries",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCountries(ctx.client);return toMcpResult(result);- }, "Failed: shared_getCountries")+ }, "Failed: shared_getCountries"),);server.registerTool(@@ -415,19 +365,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get latest approval request for document",inputSchema: {- documentType: z.any(),- documentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ documentType: z.any(),+ documentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getLatestApprovalRequestForDocument(- ctx.client,- params.documentType,- params.documentId- );+ const result = await getLatestApprovalRequestForDocument(ctx.client, params.documentType, params.documentId);return toMcpResult(result);- }, "Failed: shared_getLatestApprovalRequestForDocument")+ }, "Failed: shared_getLatestApprovalRequestForDocument"),);server.registerTool(@@ -435,14 +381,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get model by item id",inputSchema: {- itemId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ itemId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getModelByItemId(ctx.client, params.itemId);return toMcpResult(result);- }, "Failed: shared_getModelByItemId")+ }, "Failed: shared_getModelByItemId"),);server.registerTool(@@ -450,14 +396,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get notes",inputSchema: {- documentId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ documentId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getNotes(ctx.client, params.documentId);return toMcpResult(result);- }, "Failed: shared_getNotes")+ }, "Failed: shared_getNotes"),);server.registerTool(@@ -465,16 +411,12 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get pending approvals for approver",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPendingApprovalsForApprover(- ctx.client,- ctx.userId,- ctx.companyId- );+ const result = await getPendingApprovalsForApprover(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_getPendingApprovalsForApprover")+ }, "Failed: shared_getPendingApprovalsForApprover"),);server.registerTool(@@ -482,17 +424,17 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get periods",inputSchema: {- arg1: z.object({- startDate: z.string(),- endDate: z.string()- })- },- annotations: READ_ONLY_ANNOTATIONS+ arg1: z.object({+ startDate: z.string(),+ endDate: z.string()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getPeriods(ctx.client, params.arg1);return toMcpResult(result);- }, "Failed: shared_getPeriods")+ }, "Failed: shared_getPeriods"),);server.registerTool(@@ -500,12 +442,12 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get saved views",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSavedViews(ctx.client, ctx.userId, ctx.companyId);return toMcpResult(result);- }, "Failed: shared_getSavedViews")+ }, "Failed: shared_getSavedViews"),);server.registerTool(@@ -513,14 +455,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get tags list",inputSchema: {- table: z.string().nullable().optional()- },- annotations: READ_ONLY_ANNOTATIONS+ table: z.string().nullable().optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getTagsList(ctx.client, ctx.companyId, params.table);return toMcpResult(result);- }, "Failed: shared_getTagsList")+ }, "Failed: shared_getTagsList"),);server.registerTool(@@ -528,19 +470,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "has pending approval",inputSchema: {- documentType: z.any(),- documentId: z.string()- },- annotations: WRITE_ANNOTATIONS+ documentType: z.any(),+ documentId: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await hasPendingApproval(- ctx.client,- params.documentType,- params.documentId- );+ const result = await hasPendingApproval(ctx.client, params.documentType, params.documentId);return toMcpResult(result);- }, "Failed: shared_hasPendingApproval")+ }, "Failed: shared_hasPendingApproval"),);server.registerTool(@@ -548,23 +486,19 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "import csv",inputSchema: {- args: z.object({- table: z.string(),- filePath: z.string(),- columnMappings: z.any(),- enumMappings: z.any().optional()- })- },- annotations: WRITE_ANNOTATIONS+ args: z.object({+ table: z.string(),+ filePath: z.string(),+ columnMappings: z.any(),+ enumMappings: z.any().optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await importCsv(ctx.client, {- ...params.args,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await importCsv(ctx.client, { ...params.args, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: shared_importCsv")+ }, "Failed: shared_importCsv"),);server.registerTool(@@ -572,21 +506,17 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "insert note",inputSchema: {- note: z.object({- note: z.string(),- documentId: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ note: z.object({+ note: z.string(),+ documentId: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertNote(ctx.client, {- ...params.note,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await insertNote(ctx.client, { ...params.note, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: shared_insertNote")+ }, "Failed: shared_insertNote"),);server.registerTool(@@ -594,14 +524,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "insert tag",inputSchema: {- tag: z.any()- },- annotations: WRITE_ANNOTATIONS+ tag: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await insertTag(ctx.client, params.tag);return toMcpResult(result);- }, "Failed: shared_insertTag")+ }, "Failed: shared_insertTag"),);server.registerTool(@@ -609,20 +539,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "is approval required",inputSchema: {- documentType: z.any(),- amount: z.number().optional()- },- annotations: WRITE_ANNOTATIONS+ documentType: z.any(),+ amount: z.number().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await isApprovalRequired(- ctx.client,- params.documentType,- ctx.companyId,- params.amount- );+ const result = await isApprovalRequired(ctx.client, params.documentType, ctx.companyId, params.amount);return toMcpResult(result);- }, "Failed: shared_isApprovalRequired")+ }, "Failed: shared_isApprovalRequired"),);server.registerTool(@@ -630,14 +555,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get external link",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getExternalLink(ctx.client, params.id);return toMcpResult(result);- }, "Failed: shared_getExternalLink")+ }, "Failed: shared_getExternalLink"),);server.registerTool(@@ -645,14 +570,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "upsert external link",inputSchema: {- externalLink: z.any()- },- annotations: WRITE_ANNOTATIONS+ externalLink: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await upsertExternalLink(ctx.client, params.externalLink);return toMcpResult(result);- }, "Failed: shared_upsertExternalLink")+ }, "Failed: shared_upsertExternalLink"),);server.registerTool(@@ -660,24 +585,18 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get customer portals",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getCustomerPortals(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getCustomerPortals(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: shared_getCustomerPortals")+ }, "Failed: shared_getCustomerPortals"),);server.registerTool(@@ -685,14 +604,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "get customer portal",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomerPortal(ctx.client, params.id);return toMcpResult(result);- }, "Failed: shared_getCustomerPortal")+ }, "Failed: shared_getCustomerPortal"),);server.registerTool(@@ -700,14 +619,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "delete customer portal",inputSchema: {- id: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ id: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteCustomerPortal(ctx.client, params.id);return toMcpResult(result);- }, "Failed: shared_deleteCustomerPortal")+ }, "Failed: shared_deleteCustomerPortal"),);server.registerTool(@@ -715,19 +634,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "update model thumbnail",inputSchema: {- modelId: z.string(),- thumbnailPath: z.string()- },- annotations: WRITE_ANNOTATIONS+ modelId: z.string(),+ thumbnailPath: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateModelThumbnail(- ctx.client,- params.modelId,- params.thumbnailPath- );+ const result = await updateModelThumbnail(ctx.client, params.modelId, params.thumbnailPath);return toMcpResult(result);- }, "Failed: shared_updateModelThumbnail")+ }, "Failed: shared_updateModelThumbnail"),);server.registerTool(@@ -735,18 +650,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "upsert model upload",inputSchema: {- upload: z.any()- },- annotations: WRITE_ANNOTATIONS+ upload: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertModelUpload(ctx.client, {- ...params.upload,- companyId: ctx.companyId,- createdBy: ctx.userId- });+ const result = await upsertModelUpload(ctx.client, { ...params.upload, companyId: ctx.companyId, createdBy: ctx.userId });return toMcpResult(result);- }, "Failed: shared_upsertModelUpload")+ }, "Failed: shared_upsertModelUpload"),);server.registerTool(@@ -754,15 +665,15 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "update note",inputSchema: {- id: z.string(),- note: z.string()- },- annotations: WRITE_ANNOTATIONS+ id: z.string(),+ note: z.string(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await updateNote(ctx.client, params.id, params.note);return toMcpResult(result);- }, "Failed: shared_updateNote")+ }, "Failed: shared_updateNote"),);server.registerTool(@@ -770,22 +681,16 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "reject request",inputSchema: {- db: z.any(),- id: z.string(),- notes: z.string().optional()- },- annotations: WRITE_ANNOTATIONS+ db: z.any(),+ id: z.string(),+ notes: z.string().optional(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await rejectRequest(- ctx.client,- params.db,- params.id,- ctx.userId,- params.notes- );+ const result = await rejectRequest(ctx.client, params.db, params.id, ctx.userId, params.notes);return toMcpResult(result);- }, "Failed: shared_rejectRequest")+ }, "Failed: shared_rejectRequest"),);server.registerTool(@@ -793,14 +698,14 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "upsert approval rule",inputSchema: {- rule: z.any()- },- annotations: WRITE_ANNOTATIONS+ rule: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await upsertApprovalRule(ctx.client, params.rule);return toMcpResult(result);- }, "Failed: shared_upsertApprovalRule")+ }, "Failed: shared_upsertApprovalRule"),);server.registerTool(@@ -808,29 +713,25 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "upsert saved view",inputSchema: {- view: z.object({- id: z.string().optional(),- name: z.string(),- description: z.string().optional(),- table: z.string(),- type: z.enum(["Public", "Private"]),- filters: z.array(z.string()).optional(),- sorts: z.array(z.string()).optional(),- columnPinning: z.any().optional(),- columnVisibility: z.any().optional(),- columnOrder: z.array(z.string()).optional()- })- },- annotations: WRITE_ANNOTATIONS+ view: z.object({+ id: z.string().optional(),+ name: z.string(),+ description: z.string().optional(),+ table: z.string(),+ type: z.enum(["Public", "Private"]),+ filters: z.array(z.string()).optional(),+ sorts: z.array(z.string()).optional(),+ columnPinning: z.any().optional(),+ columnVisibility: z.any().optional(),+ columnOrder: z.array(z.string()).optional()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertSavedView(ctx.client, {- ...params.view,- companyId: ctx.companyId,- userId: ctx.userId- });+ const result = await upsertSavedView(ctx.client, { ...params.view, companyId: ctx.companyId, userId: ctx.userId });return toMcpResult(result);- }, "Failed: shared_upsertSavedView")+ }, "Failed: shared_upsertSavedView"),);server.registerTool(@@ -838,19 +739,16 @@ export const registerSharedTools: RegisterTools = (server, ctx) => {{description: "update saved view order",inputSchema: {- updates: z.object({- id: z.string(),- sortOrder: z.number()- })- },- annotations: WRITE_ANNOTATIONS+ updates: z.object({+ id: z.string(),+ sortOrder: z.number()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await updateSavedViewOrder(ctx.client, {- ...params.updates,- updatedBy: ctx.userId- });+ const result = await updateSavedViewOrder(ctx.client, { ...params.updates, updatedBy: ctx.userId });return toMcpResult(result);- }, "Failed: shared_updateSavedViewOrder")+ }, "Failed: shared_updateSavedViewOrder"),);};diff --git a/apps/erp/app/routes/api+/mcp+/lib/tools/users.ts b/apps/erp/app/routes/api+/mcp+/lib/tools/users.tsindex aebf31245c..9b5ed0e9cd 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tools/users.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/tools/users.ts@@ -1,41 +1,41 @@// @ts-nocheck// AUTO-GENERATED by scripts/generate-mcp.ts — do not edit manuallyimport { z } from "zod";+import type { RegisterTools } from "../types";+import {+ READ_ONLY_ANNOTATIONS,+ WRITE_ANNOTATIONS,+ DESTRUCTIVE_ANNOTATIONS,+ toMcpResult,+ withErrorHandling,+} from "../types";import {deleteEmployeeType,deleteGroup,getCompaniesForUser,- getConsoleOperators,getCustomers,getEmployee,getEmployees,+ getConsoleOperators,getEmployeeType,getEmployeeTypes,+ getInvitable,+ getModules,getGroup,- getGroupEmails,getGroupMembers,getGroups,- getInvitable,- getModules,+ getGroupEmails,getPermissionsByEmployeeType,getSuppliers,- getUserEmails,getUsers,+ getUserEmails,insertEmployeeType,insertGroup,upsertEmployeeType,upsertEmployeeTypePermissions,upsertGroup,- upsertGroupMembers+ upsertGroupMembers,} from "~/modules/users/users.service";-import type { RegisterTools } from "../types";-import {- DESTRUCTIVE_ANNOTATIONS,- READ_ONLY_ANNOTATIONS,- toMcpResult,- WRITE_ANNOTATIONS,- withErrorHandling-} from "../types";export const registerUsersTools: RegisterTools = (server, ctx) => {server.registerTool(@@ -43,17 +43,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "delete employee type",inputSchema: {- employeeTypeId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ employeeTypeId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await deleteEmployeeType(- ctx.client,- params.employeeTypeId- );+ const result = await deleteEmployeeType(ctx.client, params.employeeTypeId);return toMcpResult(result);- }, "Failed: users_deleteEmployeeType")+ }, "Failed: users_deleteEmployeeType"),);server.registerTool(@@ -61,14 +58,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "delete group",inputSchema: {- groupId: z.string()- },- annotations: DESTRUCTIVE_ANNOTATIONS+ groupId: z.string(),+ },+ annotations: DESTRUCTIVE_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await deleteGroup(ctx.client, params.groupId);return toMcpResult(result);- }, "Failed: users_deleteGroup")+ }, "Failed: users_deleteGroup"),);server.registerTool(@@ -76,12 +73,12 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get companies for user",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCompaniesForUser(ctx.client, ctx.userId);return toMcpResult(result);- }, "Failed: users_getCompaniesForUser")+ }, "Failed: users_getCompaniesForUser"),);server.registerTool(@@ -89,18 +86,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get customers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getCustomers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getCustomers")+ }, "Failed: users_getCustomers"),);server.registerTool(@@ -108,14 +105,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get employee",inputSchema: {- id: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ id: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getEmployee(ctx.client, params.id, ctx.companyId);return toMcpResult(result);- }, "Failed: users_getEmployee")+ }, "Failed: users_getEmployee"),);server.registerTool(@@ -123,18 +120,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get employees",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getEmployees(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getEmployees")+ }, "Failed: users_getEmployees"),);server.registerTool(@@ -142,22 +139,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get console operators",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getConsoleOperators(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getConsoleOperators(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getConsoleOperators")+ }, "Failed: users_getConsoleOperators"),);server.registerTool(@@ -165,14 +158,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get employee type",inputSchema: {- employeeTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getEmployeeType(ctx.client, params.employeeTypeId);return toMcpResult(result);- }, "Failed: users_getEmployeeType")+ }, "Failed: users_getEmployeeType"),);server.registerTool(@@ -180,24 +173,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get employee types",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getEmployeeTypes(- ctx.client,- ctx.companyId,- params.args- );+ const result = await getEmployeeTypes(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getEmployeeTypes")+ }, "Failed: users_getEmployeeTypes"),);server.registerTool(@@ -205,12 +192,12 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get invitable",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getInvitable(ctx.client, ctx.companyId);return toMcpResult(result);- }, "Failed: users_getInvitable")+ }, "Failed: users_getInvitable"),);server.registerTool(@@ -218,12 +205,12 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get modules",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getModules(ctx.client);return toMcpResult(result);- }, "Failed: users_getModules")+ }, "Failed: users_getModules"),);server.registerTool(@@ -231,14 +218,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get group",inputSchema: {- groupId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ groupId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGroup(ctx.client, params.groupId);return toMcpResult(result);- }, "Failed: users_getGroup")+ }, "Failed: users_getGroup"),);server.registerTool(@@ -246,14 +233,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get group members",inputSchema: {- groupId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ groupId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGroupMembers(ctx.client, params.groupId);return toMcpResult(result);- }, "Failed: users_getGroupMembers")+ }, "Failed: users_getGroupMembers"),);server.registerTool(@@ -261,21 +248,19 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get groups",inputSchema: {- args: z- .object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable(),- uid: z.string().nullable()- })- .optional()- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable(),+ uid: z.string().nullable()+ }).optional(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGroups(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getGroups")+ }, "Failed: users_getGroups"),);server.registerTool(@@ -283,14 +268,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get group emails",inputSchema: {- groupIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ groupIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getGroupEmails(ctx.client, params.groupIds);return toMcpResult(result);- }, "Failed: users_getGroupEmails")+ }, "Failed: users_getGroupEmails"),);server.registerTool(@@ -298,17 +283,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get permissions by employee type",inputSchema: {- employeeTypeId: z.string()- },- annotations: READ_ONLY_ANNOTATIONS+ employeeTypeId: z.string(),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await getPermissionsByEmployeeType(- ctx.client,- params.employeeTypeId- );+ const result = await getPermissionsByEmployeeType(ctx.client, params.employeeTypeId);return toMcpResult(result);- }, "Failed: users_getPermissionsByEmployeeType")+ }, "Failed: users_getPermissionsByEmployeeType"),);server.registerTool(@@ -316,18 +298,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get suppliers",inputSchema: {- args: z.object({- limit: z.number().int().default(100),- offset: z.number().int().default(0),- search: z.string().nullable()- })- },- annotations: READ_ONLY_ANNOTATIONS+ args: z.object({+ limit: z.number().int().default(100),+ offset: z.number().int().default(0),+ search: z.string().nullable()+ }),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getSuppliers(ctx.client, ctx.companyId, params.args);return toMcpResult(result);- }, "Failed: users_getSuppliers")+ }, "Failed: users_getSuppliers"),);server.registerTool(@@ -335,12 +317,12 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get users",inputSchema: {},- annotations: READ_ONLY_ANNOTATIONS+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getUsers(ctx.client);return toMcpResult(result);- }, "Failed: users_getUsers")+ }, "Failed: users_getUsers"),);server.registerTool(@@ -348,14 +330,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "get user emails",inputSchema: {- userIds: z.array(z.string())- },- annotations: READ_ONLY_ANNOTATIONS+ userIds: z.array(z.string()),+ },+ annotations: READ_ONLY_ANNOTATIONS,},withErrorHandling(async (params) => {const result = await getUserEmails(ctx.client, params.userIds);return toMcpResult(result);- }, "Failed: users_getUserEmails")+ }, "Failed: users_getUserEmails"),);server.registerTool(@@ -363,19 +345,16 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "insert employee type",inputSchema: {- employeeType: z.object({- name: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ employeeType: z.object({+ name: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertEmployeeType(ctx.client, {- ...params.employeeType,- companyId: ctx.companyId- });+ const result = await insertEmployeeType(ctx.client, { ...params.employeeType, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: users_insertEmployeeType")+ }, "Failed: users_insertEmployeeType"),);server.registerTool(@@ -383,19 +362,16 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "insert group",inputSchema: {- group: z.object({- name: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ group: z.object({+ name: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await insertGroup(ctx.client, {- ...params.group,- companyId: ctx.companyId- });+ const result = await insertGroup(ctx.client, { ...params.group, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: users_insertGroup")+ }, "Failed: users_insertGroup"),);server.registerTool(@@ -403,17 +379,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "upsert employee type",inputSchema: {- employeeType: z.any()- },- annotations: WRITE_ANNOTATIONS+ employeeType: z.any(),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertEmployeeType(ctx.client, {- ...params.employeeType,- companyId: ctx.companyId- });+ const result = await upsertEmployeeType(ctx.client, { ...params.employeeType, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: users_upsertEmployeeType")+ }, "Failed: users_upsertEmployeeType"),);server.registerTool(@@ -421,23 +394,18 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "upsert employee type permissions",inputSchema: {- employeeTypeId: z.string(),- permissions: z.object({- name: z.string(),- permission: z.any()- })- },- annotations: WRITE_ANNOTATIONS+ employeeTypeId: z.string(),+ permissions: z.object({+ name: z.string(),+ permission: z.any()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertEmployeeTypePermissions(- ctx.client,- params.employeeTypeId,- ctx.companyId,- params.permissions- );+ const result = await upsertEmployeeTypePermissions(ctx.client, params.employeeTypeId, ctx.companyId, params.permissions);return toMcpResult(result);- }, "Failed: users_upsertEmployeeTypePermissions")+ }, "Failed: users_upsertEmployeeTypePermissions"),);server.registerTool(@@ -445,20 +413,17 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "upsert group",inputSchema: {- arg1: z.object({- id: z.string(),- name: z.string()- })- },- annotations: WRITE_ANNOTATIONS+ arg1: z.object({+ id: z.string(),+ name: z.string()+ }),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertGroup(ctx.client, {- ...params.arg1,- companyId: ctx.companyId- });+ const result = await upsertGroup(ctx.client, { ...params.arg1, companyId: ctx.companyId });return toMcpResult(result);- }, "Failed: users_upsertGroup")+ }, "Failed: users_upsertGroup"),);server.registerTool(@@ -466,18 +431,14 @@ export const registerUsersTools: RegisterTools = (server, ctx) => {{description: "upsert group members",inputSchema: {- groupId: z.string(),- selections: z.array(z.string())- },- annotations: WRITE_ANNOTATIONS+ groupId: z.string(),+ selections: z.array(z.string()),+ },+ annotations: WRITE_ANNOTATIONS,},withErrorHandling(async (params) => {- const result = await upsertGroupMembers(- ctx.client,- params.groupId,- params.selections- );+ const result = await upsertGroupMembers(ctx.client, params.groupId, params.selections);return toMcpResult(result);- }, "Failed: users_upsertGroupMembers")+ }, "Failed: users_upsertGroupMembers"),);};diff --git a/apps/erp/app/routes/api+/production.methods.$id.bom.tsx b/apps/erp/app/routes/api+/production.methods.$id.bom.tsxindex 4d46c8463e..62f8760a8d 100644--- a/apps/erp/app/routes/api+/production.methods.$id.bom.tsx+++ b/apps/erp/app/routes/api+/production.methods.$id.bom.tsx@@ -38,13 +38,27 @@ export async function loader({ request, params }: LoaderFunctionArgs) {...new Set(methods.map((method) => method.data.jobMakeMethodId))];- const methodOperations = await client- .from("jobOperation")- .select(- "*, ...process(processName:name), ...workCenter(workCenterName:name)"- )- .in("jobMakeMethodId", makeMethodIds)- .eq("companyId", companyId);+ // Get the job quantity for batch size calculation+ const rootNode = methods[0];+ const jobId = rootNode?.data.jobId;++ const [methodOperations, jobResult] = await Promise.all([+ client+ .from("jobOperation")+ .select(+ "*, ...process(processName:name), ...workCenter(workCenterName:name)"+ )+ .in("jobMakeMethodId", makeMethodIds)+ .eq("companyId", companyId),+ jobId+ ? client.from("job").select("quantity").eq("id", jobId).single()+ : null+ ]);++ const batchSizesByItemId = new Map<string, number>();+ if (rootNode && jobResult?.data?.quantity) {+ batchSizesByItemId.set(rootNode.data.itemId, jobResult.data.quantity);+ }let operationsByMakeMethodId: Record<string,@@ -91,7 +105,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) {const computedCosts = calculateMadePartCosts(methods,bomOperationsByKey,- (node) => node.data.jobMaterialMakeMethodId+ (node) => node.data.jobMaterialMakeMethodId,+ batchSizesByItemId);const bomIds = generateBomIds(methods);diff --git a/apps/erp/app/routes/api+/production.methods.$id.bom[.]csv.tsx b/apps/erp/app/routes/api+/production.methods.$id.bom[.]csv.tsxindex 24f66268e6..2f82d19e63 100644--- a/apps/erp/app/routes/api+/production.methods.$id.bom[.]csv.tsx+++ b/apps/erp/app/routes/api+/production.methods.$id.bom[.]csv.tsx@@ -83,13 +83,27 @@ export async function loader({ request, params }: LoaderFunctionArgs) {...new Set(methods.map((method) => method.data.jobMakeMethodId))];- const methodOperations = await client- .from("jobOperation")- .select(- "*, ...process(processName:name), ...workCenter(workCenterName:name), ...jobMakeMethod(parentMaterialId, item(readableIdWithRevision))"- )- .in("jobMakeMethodId", makeMethodIds)- .eq("companyId", companyId);+ // Get the job quantity for batch size calculation+ const rootNode = methods[0];+ const jobId = rootNode?.data.jobId;++ const [methodOperations, jobResult] = await Promise.all([+ client+ .from("jobOperation")+ .select(+ "*, ...process(processName:name), ...workCenter(workCenterName:name), ...jobMakeMethod(parentMaterialId, item(readableIdWithRevision))"+ )+ .in("jobMakeMethodId", makeMethodIds)+ .eq("companyId", companyId),+ jobId+ ? client.from("job").select("quantity").eq("id", jobId).single()+ : null+ ]);++ const batchSizesByItemId = new Map<string, number>();+ if (rootNode && jobResult?.data?.quantity) {+ batchSizesByItemId.set(rootNode.data.itemId, jobResult.data.quantity);+ }let operationsByMakeMethodId: Record<string,@@ -146,7 +160,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) {const computedCosts = calculateMadePartCosts(methods,bomOperationsByKey,- (node) => node.data.jobMaterialMakeMethodId+ (node) => node.data.jobMaterialMakeMethodId,+ batchSizesByItemId);const bomIds = generateBomIds(methods);diff --git a/apps/erp/app/routes/api+/sales.quote.line.$id.bom.tsx b/apps/erp/app/routes/api+/sales.quote.line.$id.bom.tsxindex 6f3d710e40..837395c9bd 100644--- a/apps/erp/app/routes/api+/sales.quote.line.$id.bom.tsx+++ b/apps/erp/app/routes/api+/sales.quote.line.$id.bom.tsx@@ -95,10 +95,19 @@ export async function loader({ request, params }: LoaderFunctionArgs) {}));}+ // Use the first quote quantity as the batch size for the root item+ const batchSizesByItemId = new Map<string, number>();+ const rootQuoteNode = flattenedMethods[0];+ const firstQuantity = quote.data?.quantity?.[0];+ if (rootQuoteNode && firstQuantity && firstQuantity > 1) {+ batchSizesByItemId.set(rootQuoteNode.data.itemId, firstQuantity);+ }+const computedCosts = calculateMadePartCosts(flattenedMethods,bomOperationsByKey,- (node) => node.data.quoteMaterialMakeMethodId+ (node) => node.data.quoteMaterialMakeMethodId,+ batchSizesByItemId);const bomIds = generateBomIds(flattenedMethods);diff --git a/apps/erp/app/routes/api+/sales.quote.line.$id.bom[.]csv.tsx b/apps/erp/app/routes/api+/sales.quote.line.$id.bom[.]csv.tsxindex 2bc5ef1822..998aaff517 100644--- a/apps/erp/app/routes/api+/sales.quote.line.$id.bom[.]csv.tsx+++ b/apps/erp/app/routes/api+/sales.quote.line.$id.bom[.]csv.tsx@@ -141,10 +141,19 @@ export async function loader({ request, params }: LoaderFunctionArgs) {}));}+ // Use the first quote quantity as the batch size for the root item+ const batchSizesByItemId = new Map<string, number>();+ const rootQuoteNode = flattenedMethods[0];+ const firstQuantity = quote.data?.quantity?.[0];+ if (rootQuoteNode && firstQuantity && firstQuantity > 1) {+ batchSizesByItemId.set(rootQuoteNode.data.itemId, firstQuantity);+ }+const computedCosts = calculateMadePartCosts(flattenedMethods,bomOperationsByKey,- (node) => node.data.quoteMaterialMakeMethodId+ (node) => node.data.quoteMaterialMakeMethodId,+ batchSizesByItemId);const bomIds = generateBomIds(flattenedMethods);diff --git a/apps/erp/app/utils/bom.ts b/apps/erp/app/utils/bom.tsindex cff18b30fc..0facab1e63 100644--- a/apps/erp/app/utils/bom.ts+++ b/apps/erp/app/utils/bom.ts@@ -3,6 +3,63 @@ import type { Method } from "~/modules/items";import type { JobMethod } from "~/modules/production/types";import type { QuoteMethod } from "~/modules/sales/types";+export interface WorkCenterRate {+ id: string;+ active: boolean;+ laborRate: number | null;+ machineRate: number | null;+ overheadRate: number | null;+ processes: string[] | null;+}++export function resolveOperationRates(+ workCenterId: string | null,+ processId: string,+ laborRate: number | null,+ machineRate: number | null,+ overheadRate: number | null,+ workCenters: WorkCenterRate[]+): { laborRate: number; machineRate: number; overheadRate: number } {+ // If a work center is explicitly set and has rates, use them+ if (workCenterId) {+ const wc = workCenters.find((w) => w.id === workCenterId && w.active);+ if (wc) {+ return {+ laborRate: wc.laborRate ?? 0,+ machineRate: wc.machineRate ?? 0,+ overheadRate: wc.overheadRate ?? 0+ };+ }+ // Fall back to the joined rates from the operation+ return {+ laborRate: laborRate ?? 0,+ machineRate: machineRate ?? 0,+ overheadRate: overheadRate ?? 0+ };+ }++ // No work center selected — average rates from active work centers for this process+ const related = workCenters.filter(+ (wc) => wc.active && (wc.processes ?? []).some((p) => p === processId)+ );++ if (related.length > 0) {+ return {+ laborRate:+ related.reduce((sum, wc) => sum + (wc.laborRate ?? 0), 0) /+ related.length,+ machineRate:+ related.reduce((sum, wc) => sum + (wc.machineRate ?? 0), 0) /+ related.length,+ overheadRate:+ related.reduce((sum, wc) => sum + (wc.overheadRate ?? 0), 0) /+ related.length+ };+ }++ return { laborRate: 0, machineRate: 0, overheadRate: 0 };+}+export interface BomOperation {operationType: string;setupTime: number | null;@@ -62,11 +119,15 @@ export function normalizeTime(return { fixedHours, hoursPerUnit };}-function calculateOperationUnitCost(op: BomOperation): number {+function calculateOperationUnitCost(+ op: BomOperation,+ batchSize: number+): number {if (op.operationType === "Outside") {return Math.max(op.operationMinimumCost, op.operationUnitCost);}+ const batch = batchSize > 1 ? batchSize : 1;let cost = 0;if (op.setupTime) {@@ -74,21 +135,21 @@ function calculateOperationUnitCost(op: BomOperation): number {op.setupTime,op.setupUnit);- const totalHours = fixedHours + hoursPerUnit;- cost += totalHours * (op.laborRate ?? 0);- cost += totalHours * (op.overheadRate ?? 0);+ const hoursPerPart = fixedHours / batch + hoursPerUnit;+ cost += hoursPerPart * (op.laborRate ?? 0);+ cost += hoursPerPart * (op.overheadRate ?? 0);}- let laborTotalHours = 0;- let machineTotalHours = 0;+ let laborHoursPerPart = 0;+ let machineHoursPerPart = 0;if (op.laborTime) {const { fixedHours, hoursPerUnit } = normalizeTime(op.laborTime,op.laborUnit);- laborTotalHours = fixedHours + hoursPerUnit;- cost += laborTotalHours * (op.laborRate ?? 0);+ laborHoursPerPart = fixedHours / batch + hoursPerUnit;+ cost += laborHoursPerPart * (op.laborRate ?? 0);}if (op.machineTime) {@@ -96,21 +157,28 @@ function calculateOperationUnitCost(op: BomOperation): number {op.machineTime,op.machineUnit);- machineTotalHours = fixedHours + hoursPerUnit;- cost += machineTotalHours * (op.machineRate ?? 0);+ machineHoursPerPart = fixedHours / batch + hoursPerUnit;+ cost += machineHoursPerPart * (op.machineRate ?? 0);}- cost += Math.max(laborTotalHours, machineTotalHours) * (op.overheadRate ?? 0);+ cost +=+ Math.max(laborHoursPerPart, machineHoursPerPart) * (op.overheadRate ?? 0);return cost;}export function calculateMadePartCosts<- TData extends { methodType: string; unitCost: number; quantity: number }+ TData extends {+ methodType: string;+ unitCost: number;+ quantity: number;+ itemId: string;+ }>(nodes: FlatTreeItem<TData>[],operationsByKey: Record<string, BomOperation[]>,- getOperationKey: (node: FlatTreeItem<TData>) => string+ getOperationKey: (node: FlatTreeItem<TData>) => string,+ lotSizesByItemId?: Map<string, number>): Map<string, number> {const costMap = new Map<string, number>();const nodeMap = new Map(nodes.map((n) => [n.id, n]));@@ -133,12 +201,13 @@ export function calculateMadePartCosts<materialCost += childUnitCost * (child.data.quantity ?? 0);}- // Sum operation costs+ // Sum operation costs, amortizing fixed costs over the batch size+ const batchSize = lotSizesByItemId?.get(node.data.itemId) ?? 1;let operationCost = 0;const key = getOperationKey(node);const ops = operationsByKey[key] ?? [];for (const op of ops) {- operationCost += calculateOperationUnitCost(op);+ operationCost += calculateOperationUnitCost(op, batchSize);}costMap.set(node.id, materialCost + operationCost);diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.tsindex c80a057918..bbd4627537 100644--- a/apps/erp/app/utils/path.ts+++ b/apps/erp/app/utils/path.ts@@ -57,6 +57,8 @@ export const path = {groupsByType: (type?: string) =>generatePath(`${api}/users/groups?type=${type}`),item: (type: string) => generatePath(`${api}/item/${type}`),+ itemCostRecalculate: (itemId: string) =>+ generatePath(`${api}/items/${itemId}/recalculate-cost`),itemConfigurable: `${api}/items/configurable`,itemForecast: (itemId: string, locationId: string) =>generatePath(`${api}/items/${itemId}/${locationId}/forecast`),diff --git a/package.json b/package.jsonindex 7c8e5019f4..d673c6ff62 100755--- a/package.json+++ b/package.json@@ -59,6 +59,7 @@"dev:starter": "turbo run dev --filter=./apps/starter --filter=./packages/","dev:stripe": "npm run -w @carbon/stripe dev:stripe","format": "biome format --write",+ "generate:mcp": "tsx scripts/generate-mcp-docs.ts","generate:swagger": "tsx scripts/generate-swagger-docs.ts && npx prettier --write ./packages/database/src/swagger-docs-schema.ts ","generate:types": "tsx scripts/generate-db-types.ts","lint": "turbo run lint",diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.tsindex 01e5cda017..b8905f0cb7 100644--- a/packages/database/src/swagger-docs-schema.ts+++ b/packages/database/src/swagger-docs-schema.ts@@ -35283,6 +35283,9 @@ export default {{$ref: "#/parameters/rowFilter.riskRegister.type",},+ {+ $ref: "#/parameters/rowFilter.riskRegister.updatedBy",+ },{$ref: "#/parameters/select",},@@ -35390,6 +35393,9 @@ export default {{$ref: "#/parameters/rowFilter.riskRegister.type",},+ {+ $ref: "#/parameters/rowFilter.riskRegister.updatedBy",+ },{$ref: "#/parameters/preferReturn",},@@ -35451,6 +35457,9 @@ export default {{$ref: "#/parameters/rowFilter.riskRegister.type",},+ {+ $ref: "#/parameters/rowFilter.riskRegister.updatedBy",+ },{$ref: "#/parameters/body.riskRegister",},@@ -63051,6 +63060,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.timeCardEnabled",},+ {+ $ref: "#/parameters/rowFilter.companySettings.updateLeadTimesOnReceipt",+ },{$ref: "#/parameters/select",},@@ -63215,6 +63227,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.timeCardEnabled",},+ {+ $ref: "#/parameters/rowFilter.companySettings.updateLeadTimesOnReceipt",+ },{$ref: "#/parameters/preferReturn",},@@ -63333,6 +63348,9 @@ export default {{$ref: "#/parameters/rowFilter.companySettings.timeCardEnabled",},+ {+ $ref: "#/parameters/rowFilter.companySettings.updateLeadTimesOnReceipt",+ },{$ref: "#/parameters/body.companySettings",},@@ -86709,6 +86727,12 @@ export default {format: 'public."riskRegisterType"',type: "string",},+ updatedBy: {+ description:+ "Note:\nThis is a Foreign Key to `user.id`.<fk table='user' column='id'/>",+ format: "text",+ type: "string",+ },},type: "object",},@@ -99983,6 +100007,7 @@ export default {"qualityIssueTarget","consoleEnabled","timeCardEnabled",+ "updateLeadTimesOnReceipt",],properties: {id: {@@ -100183,6 +100208,11 @@ export default {format: "boolean",type: "boolean",},+ updateLeadTimesOnReceipt: {+ default: false,+ format: "boolean",+ type: "boolean",+ },},type: "object",},@@ -119659,6 +119689,12 @@ export default {in: "query",type: "string",},+ "rowFilter.riskRegister.updatedBy": {+ name: "updatedBy",+ required: false,+ in: "query",+ type: "string",+ },"body.shipment": {name: "shipment",description: "shipment",@@ -134770,6 +134806,12 @@ export default {in: "query",type: "string",},+ "rowFilter.companySettings.updateLeadTimesOnReceipt": {+ name: "updateLeadTimesOnReceipt",+ required: false,+ in: "query",+ type: "string",+ },"body.part": {name: "part",description: "part",diff --git a/packages/database/src/types.ts b/packages/database/src/types.tsindex a4bd475596..3067ba2a06 100644--- a/packages/database/src/types.ts+++ b/packages/database/src/types.ts@@ -2953,6 +2953,7 @@ export type Database = {supplierApproval: booleansupplierQuoteNotificationGroup: string[]timeCardEnabled: boolean+ updateLeadTimesOnReceipt: booleanuseMetric: boolean}Insert: {@@ -2990,6 +2991,7 @@ export type Database = {supplierApproval?: booleansupplierQuoteNotificationGroup?: string[]timeCardEnabled?: boolean+ updateLeadTimesOnReceipt?: booleanuseMetric?: boolean}Update: {@@ -3027,6 +3029,7 @@ export type Database = {supplierApproval?: booleansupplierQuoteNotificationGroup?: string[]timeCardEnabled?: boolean+ updateLeadTimesOnReceipt?: booleanuseMetric?: boolean}Relationships: [@@ -30343,6 +30346,7 @@ export type Database = {title: stringtype: Database["public"]["Enums"]["riskRegisterType"]updatedAt: string | null+ updatedBy: string | null}Insert: {assignee?: string | null@@ -30361,6 +30365,7 @@ export type Database = {title: stringtype?: Database["public"]["Enums"]["riskRegisterType"]updatedAt?: string | null+ updatedBy?: string | null}Update: {assignee?: string | null@@ -30379,6 +30384,7 @@ export type Database = {title?: stringtype?: Database["public"]["Enums"]["riskRegisterType"]updatedAt?: string | null+ updatedBy?: string | null}Relationships: [{@@ -30521,6 +30527,41 @@ export type Database = {referencedRelation: "tools"referencedColumns: ["id"]},+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employees"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employeesAcrossCompanies"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employeeSummary"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "user"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "userDefaults"+ referencedColumns: ["userId"]+ },]}salesInvoice: {@@ -33359,6 +33400,48 @@ export type Database = {},]}+ searchIndex_MG9Ks1bZ4Udn5xBu8k7Rv7: {+ Row: {+ createdAt: string+ description: string | null+ entityId: string+ entityType: string+ id: number+ link: string+ metadata: Json | null+ searchVector: unknown+ tags: string[] | null+ title: string+ updatedAt: string | null+ }+ Insert: {+ createdAt?: string+ description?: string | null+ entityId: string+ entityType: string+ id?: number+ link: string+ metadata?: Json | null+ searchVector?: unknown+ tags?: string[] | null+ title: string+ updatedAt?: string | null+ }+ Update: {+ createdAt?: string+ description?: string | null+ entityId?: string+ entityType?: string+ id?: number+ link?: string+ metadata?: Json | null+ searchVector?: unknown+ tags?: string[] | null+ title?: string+ updatedAt?: string | null+ }+ Relationships: []+ }searchIndexRegistry: {Row: {companyId: string@@ -57159,6 +57242,7 @@ export type Database = {order: numberparentMaterialId: stringquantity: number+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]revision: stringshelfIds: JsonunitCost: numberdiff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.tsindex a4bd475596..3067ba2a06 100644--- a/packages/database/supabase/functions/lib/types.ts+++ b/packages/database/supabase/functions/lib/types.ts@@ -2953,6 +2953,7 @@ export type Database = {supplierApproval: booleansupplierQuoteNotificationGroup: string[]timeCardEnabled: boolean+ updateLeadTimesOnReceipt: booleanuseMetric: boolean}Insert: {@@ -2990,6 +2991,7 @@ export type Database = {supplierApproval?: booleansupplierQuoteNotificationGroup?: string[]timeCardEnabled?: boolean+ updateLeadTimesOnReceipt?: booleanuseMetric?: boolean}Update: {@@ -3027,6 +3029,7 @@ export type Database = {supplierApproval?: booleansupplierQuoteNotificationGroup?: string[]timeCardEnabled?: boolean+ updateLeadTimesOnReceipt?: booleanuseMetric?: boolean}Relationships: [@@ -30343,6 +30346,7 @@ export type Database = {title: stringtype: Database["public"]["Enums"]["riskRegisterType"]updatedAt: string | null+ updatedBy: string | null}Insert: {assignee?: string | null@@ -30361,6 +30365,7 @@ export type Database = {title: stringtype?: Database["public"]["Enums"]["riskRegisterType"]updatedAt?: string | null+ updatedBy?: string | null}Update: {assignee?: string | null@@ -30379,6 +30384,7 @@ export type Database = {title?: stringtype?: Database["public"]["Enums"]["riskRegisterType"]updatedAt?: string | null+ updatedBy?: string | null}Relationships: [{@@ -30521,6 +30527,41 @@ export type Database = {referencedRelation: "tools"referencedColumns: ["id"]},+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employees"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employeesAcrossCompanies"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "employeeSummary"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "user"+ referencedColumns: ["id"]+ },+ {+ foreignKeyName: "riskRegister_updatedBy_fkey"+ columns: ["updatedBy"]+ isOneToOne: false+ referencedRelation: "userDefaults"+ referencedColumns: ["userId"]+ },]}salesInvoice: {@@ -33359,6 +33400,48 @@ export type Database = {},]}+ searchIndex_MG9Ks1bZ4Udn5xBu8k7Rv7: {+ Row: {+ createdAt: string+ description: string | null+ entityId: string+ entityType: string+ id: number+ link: string+ metadata: Json | null+ searchVector: unknown+ tags: string[] | null+ title: string+ updatedAt: string | null+ }+ Insert: {+ createdAt?: string+ description?: string | null+ entityId: string+ entityType: string+ id?: number+ link: string+ metadata?: Json | null+ searchVector?: unknown+ tags?: string[] | null+ title: string+ updatedAt?: string | null+ }+ Update: {+ createdAt?: string+ description?: string | null+ entityId?: string+ entityType?: string+ id?: number+ link?: string+ metadata?: Json | null+ searchVector?: unknown+ tags?: string[] | null+ title?: string+ updatedAt?: string | null+ }+ Relationships: []+ }searchIndexRegistry: {Row: {companyId: string@@ -57159,6 +57242,7 @@ export type Database = {order: numberparentMaterialId: stringquantity: number+ replenishmentSystem: Database["public"]["Enums"]["itemReplenishmentSystem"]revision: stringshelfIds: JsonunitCost: numberdiff --git a/packages/database/supabase/migrations/20260408000000_method-tree-replenishment.sql b/packages/database/supabase/migrations/20260408000000_method-tree-replenishment.sqlnew file mode 100644index 0000000000..883dd6638f--- /dev/null+++ b/packages/database/supabase/migrations/20260408000000_method-tree-replenishment.sql@@ -0,0 +1,167 @@+DROP FUNCTION IF EXISTS get_method_tree;+CREATE OR REPLACE FUNCTION get_method_tree(uid TEXT)+RETURNS TABLE (+ "methodMaterialId" TEXT,+ "makeMethodId" TEXT,+ "materialMakeMethodId" TEXT,+ "itemId" TEXT,+ "itemReadableId" TEXT,+ "itemType" TEXT,+ "description" TEXT,+ "unitOfMeasureCode" TEXT,+ "unitCost" NUMERIC,+ "quantity" NUMERIC,+ "methodType" "methodType",+ "itemTrackingType" TEXT,+ "parentMaterialId" TEXT,+ "order" DOUBLE PRECISION,+ "operationId" TEXT,+ "isRoot" BOOLEAN,+ "kit" BOOLEAN,+ "revision" TEXT,+ "externalId" JSONB,+ "version" NUMERIC(10,2),+ "shelfIds" JSONB,+ "isPickDescendant" BOOLEAN,+ "replenishmentSystem" "itemReplenishmentSystem"+) AS $$+WITH RECURSIVE material AS (+ SELECT+ "id",+ "makeMethodId",+ "methodType",+ COALESCE(+ "materialMakeMethodId",+ CASE WHEN "methodType" = 'Pull from Inventory' THEN (+ SELECT amm.id FROM "activeMakeMethods" amm WHERE amm."itemId" = "methodMaterial"."itemId" LIMIT 1+ ) END+ ) AS "materialMakeMethodId",+ "itemId",+ "itemType",+ "quantity",+ "makeMethodId" AS "parentMaterialId",+ NULL AS "operationId",+ COALESCE("order", 1) AS "order",+ "kit",+ "shelfIds",+ false AS "isPickDescendant"+ FROM+ "methodMaterial"+ WHERE+ "makeMethodId" = uid+ UNION+ SELECT+ child."id",+ child."makeMethodId",+ child."methodType",+ COALESCE(+ child."materialMakeMethodId",+ CASE WHEN child."methodType" = 'Pull from Inventory' THEN (+ SELECT amm.id FROM "activeMakeMethods" amm WHERE amm."itemId" = child."itemId" LIMIT 1+ ) END+ ) AS "materialMakeMethodId",+ child."itemId",+ child."itemType",+ child."quantity",+ parent."id" AS "parentMaterialId",+ child."methodOperationId" AS "operationId",+ child."order",+ child."kit",+ child."shelfIds",+ (parent."methodType" = 'Pull from Inventory' OR parent."isPickDescendant") AS "isPickDescendant"+ FROM+ "methodMaterial" child+ INNER JOIN material parent ON parent."materialMakeMethodId" = child."makeMethodId"+)+SELECT+ material.id as "methodMaterialId",+ material."makeMethodId",+ material."materialMakeMethodId",+ material."itemId",+ item."readableIdWithRevision" AS "itemReadableId",+ material."itemType",+ item."name" AS "description",+ item."unitOfMeasureCode",+ cost."unitCost",+ material."quantity",+ material."methodType",+ item."itemTrackingType",+ material."parentMaterialId",+ material."order",+ material."operationId",+ false AS "isRoot",+ material."kit",+ item."revision",+ (+ SELECT COALESCE(+ jsonb_object_agg(+ eim."integration",+ CASE+ WHEN eim."metadata" IS NOT NULL THEN eim."metadata"+ ELSE to_jsonb(eim."externalId")+ END+ ) FILTER (WHERE eim."externalId" IS NOT NULL),+ '{}'::jsonb+ )+ FROM "externalIntegrationMapping" eim+ WHERE eim."entityType" = 'item' AND eim."entityId" = item.id+ ) AS "externalId",+ mm2."version",+ material."shelfIds",+ material."isPickDescendant",+ item."replenishmentSystem"+FROM material+INNER JOIN item+ ON material."itemId" = item.id+INNER JOIN "itemCost" cost+ ON item.id = cost."itemId"+INNER JOIN "makeMethod" mm+ ON material."makeMethodId" = mm.id+LEFT JOIN "makeMethod" mm2+ ON material."materialMakeMethodId" = mm2.id+UNION+SELECT+ mm."id" AS "methodMaterialId",+ NULL AS "makeMethodId",+ mm.id AS "materialMakeMethodId",+ mm."itemId",+ item."readableIdWithRevision" AS "itemReadableId",+ item."type"::text,+ item."name" AS "description",+ item."unitOfMeasureCode",+ cost."unitCost",+ 1 AS "quantity",+ 'Make to Order' AS "methodType",+ item."itemTrackingType",+ NULL AS "parentMaterialId",+ CAST(1 AS DOUBLE PRECISION) AS "order",+ NULL AS "operationId",+ true AS "isRoot",+ false AS "kit",+ item."revision",+ (+ SELECT COALESCE(+ jsonb_object_agg(+ eim."integration",+ CASE+ WHEN eim."metadata" IS NOT NULL THEN eim."metadata"+ ELSE to_jsonb(eim."externalId")+ END+ ) FILTER (WHERE eim."externalId" IS NOT NULL),+ '{}'::jsonb+ )+ FROM "externalIntegrationMapping" eim+ WHERE eim."entityType" = 'item' AND eim."entityId" = item.id+ ) AS "externalId",+ mm."version",+ '{}'::JSONB AS "shelfIds",+ false AS "isPickDescendant",+ item."replenishmentSystem"+FROM "makeMethod" mm+INNER JOIN item+ ON mm."itemId" = item.id+INNER JOIN "itemCost" cost+ ON item.id = cost."itemId"+WHERE mm.id = uid+ORDER BY "order"+$$ LANGUAGE sql STABLE;