@kynver-app/mcp-estimator 0.2.16 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -14
- package/dist/sse.js +1 -9
- package/package.json +8 -5
- package/dist/index.d.ts +0 -7
- package/dist/lib/kynver-client.d.ts +0 -20
- package/dist/lib/kynver-client.js +0 -115
- package/dist/lib/mcp-sse-server.d.ts +0 -44
- package/dist/lib/mcp-sse-server.js +0 -441
- package/dist/lib/package-version.d.ts +0 -7
- package/dist/lib/package-version.js +0 -44
- package/dist/server.d.ts +0 -6
- package/dist/server.js +0 -119
- package/dist/sse.d.ts +0 -1
- package/dist/tools/catalog-tools.d.ts +0 -381
- package/dist/tools/catalog-tools.js +0 -192
- package/dist/tools/client-tools.d.ts +0 -193
- package/dist/tools/client-tools.js +0 -105
- package/dist/tools/company-tools.d.ts +0 -163
- package/dist/tools/company-tools.js +0 -98
- package/dist/tools/email-pdf-tools.d.ts +0 -51
- package/dist/tools/email-pdf-tools.js +0 -22
- package/dist/tools/estimate-tools.d.ts +0 -531
- package/dist/tools/estimate-tools.js +0 -259
- package/dist/tools/intake-tools.d.ts +0 -463
- package/dist/tools/intake-tools.js +0 -82
- package/dist/tools/photo-tools.d.ts +0 -77
- package/dist/tools/photo-tools.js +0 -51
- package/dist/tools/price-catalog-tools.d.ts +0 -96
- package/dist/tools/price-catalog-tools.js +0 -72
- package/dist/tools/remodel-deliverable-tools.d.ts +0 -1868
- package/dist/tools/remodel-deliverable-tools.js +0 -138
- package/dist/tools/remodel-estimate-tools.d.ts +0 -525
- package/dist/tools/remodel-estimate-tools.js +0 -71
- package/dist/tools/signing-tools.d.ts +0 -89
- package/dist/tools/signing-tools.js +0 -51
- package/dist/tools/stats-pdf-tools.d.ts +0 -113
- package/dist/tools/stats-pdf-tools.js +0 -73
- package/dist/tools/takeoff-tools.d.ts +0 -730
- package/dist/tools/takeoff-tools.js +0 -297
- package/dist/tools/template-tools.d.ts +0 -96
- package/dist/tools/template-tools.js +0 -70
- package/dist/tools/version-tools.d.ts +0 -46
- package/dist/tools/version-tools.js +0 -33
- package/dist/tools/vision-tools.d.ts +0 -52
- package/dist/tools/vision-tools.js +0 -42
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as client from "../lib/kynver-client.js";
|
|
3
|
-
// --- estimator_create_replacement ---
|
|
4
|
-
const createReplacementSchema = z.object({
|
|
5
|
-
projectName: z.string(),
|
|
6
|
-
roofMaterial: z.string(),
|
|
7
|
-
footprintSqFt: z.number().optional(),
|
|
8
|
-
roofAreaSqFt: z.number().optional(),
|
|
9
|
-
pitch: z.string().optional(),
|
|
10
|
-
layers: z.number().optional(),
|
|
11
|
-
ridgeLengthFt: z.number(),
|
|
12
|
-
hipLengthFt: z.number().optional(),
|
|
13
|
-
valleyLengthFt: z.number().optional(),
|
|
14
|
-
eavesFt: z.number(),
|
|
15
|
-
rakeFt: z.number().optional(),
|
|
16
|
-
wastePercent: z.number().optional(),
|
|
17
|
-
clientId: z.string().optional(),
|
|
18
|
-
companyId: z.string().optional(),
|
|
19
|
-
notes: z.string().optional(),
|
|
20
|
-
});
|
|
21
|
-
export const createReplacement = {
|
|
22
|
-
name: "estimator_create_replacement",
|
|
23
|
-
description: "Create a full roof replacement estimate from dimensions. The system calculates line items automatically from the roof measurements using catalog prices. Requires: projectName, roofMaterial (asphalt, metal, tpo, etc.), ridgeLengthFt, eavesFt. Optional: footprintSqFt, roofAreaSqFt, pitch, layers, hipLengthFt, valleyLengthFt, rakeFt, wastePercent. PREREQUISITE: The user must have catalog items set up for the specified roofMaterial — call estimator_get_catalog first to verify.",
|
|
24
|
-
inputSchemaZod: createReplacementSchema,
|
|
25
|
-
execute: async (args) => {
|
|
26
|
-
if (!client.hasApiKey())
|
|
27
|
-
return client.noApiKeyMessage();
|
|
28
|
-
const { projectName, clientId, companyId, notes, ...measurements } = args;
|
|
29
|
-
const data = await client.post("/estimator/estimates", {
|
|
30
|
-
type: "replacement",
|
|
31
|
-
projectName,
|
|
32
|
-
roofMaterial: measurements.roofMaterial,
|
|
33
|
-
inputs: measurements,
|
|
34
|
-
clientId,
|
|
35
|
-
companyId,
|
|
36
|
-
notes,
|
|
37
|
-
});
|
|
38
|
-
return JSON.stringify(data);
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
// --- estimator_create_repair ---
|
|
42
|
-
const repairLineSchema = z.object({
|
|
43
|
-
serviceCode: z.string(),
|
|
44
|
-
materialType: z.string().nullable().optional(),
|
|
45
|
-
quantity: z.number(),
|
|
46
|
-
notes: z.string().optional(),
|
|
47
|
-
});
|
|
48
|
-
const createRepairSchema = z.object({
|
|
49
|
-
projectName: z.string(),
|
|
50
|
-
roofMaterial: z.string().optional(),
|
|
51
|
-
lineItems: z.array(repairLineSchema),
|
|
52
|
-
clientId: z.string().optional(),
|
|
53
|
-
companyId: z.string().optional(),
|
|
54
|
-
notes: z.string().optional(),
|
|
55
|
-
});
|
|
56
|
-
export const createRepair = {
|
|
57
|
-
name: "estimator_create_repair",
|
|
58
|
-
description: "Create a repair/service estimate with specific line items. Each line item needs a serviceCode that exists in the user's catalog — ALWAYS call estimator_get_catalog first to get valid service codes. Do not guess or invent codes. Pass: projectName, lineItems array (each with serviceCode, quantity, optional materialType and notes). Optionally link to a client/company via clientId/companyId.",
|
|
59
|
-
inputSchemaZod: createRepairSchema,
|
|
60
|
-
execute: async (args) => {
|
|
61
|
-
if (!client.hasApiKey())
|
|
62
|
-
return client.noApiKeyMessage();
|
|
63
|
-
const data = await client.post("/estimator/estimates", {
|
|
64
|
-
type: "repair_service",
|
|
65
|
-
projectName: args.projectName,
|
|
66
|
-
roofMaterial: args.roofMaterial,
|
|
67
|
-
lineItems: args.lineItems,
|
|
68
|
-
clientId: args.clientId,
|
|
69
|
-
companyId: args.companyId,
|
|
70
|
-
notes: args.notes,
|
|
71
|
-
});
|
|
72
|
-
return JSON.stringify(data);
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
// --- estimator_get_estimate ---
|
|
76
|
-
const getEstimateSchema = z.object({
|
|
77
|
-
id: z.string(),
|
|
78
|
-
});
|
|
79
|
-
export const getEstimate = {
|
|
80
|
-
name: "estimator_get_estimate",
|
|
81
|
-
description: "Get a specific estimate with all line items, totals (material, labor, grand total), status, client/company info, and metadata. Returns the complete estimate detail needed for viewing, editing, or reporting.",
|
|
82
|
-
inputSchemaZod: getEstimateSchema,
|
|
83
|
-
execute: async (args) => {
|
|
84
|
-
if (!client.hasApiKey())
|
|
85
|
-
return client.noApiKeyMessage();
|
|
86
|
-
const data = await client.get(`/estimator/estimates/${args.id}`);
|
|
87
|
-
return JSON.stringify(data);
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
// --- estimator_list_estimates ---
|
|
91
|
-
const listEstimatesSchema = z.object({
|
|
92
|
-
status: z.string().optional(),
|
|
93
|
-
type: z.string().optional(),
|
|
94
|
-
clientId: z.string().optional(),
|
|
95
|
-
companyId: z.string().optional(),
|
|
96
|
-
from: z.string().optional(),
|
|
97
|
-
to: z.string().optional(),
|
|
98
|
-
limit: z.number().optional(),
|
|
99
|
-
cursor: z.string().optional(),
|
|
100
|
-
});
|
|
101
|
-
export const listEstimates = {
|
|
102
|
-
name: "estimator_list_estimates",
|
|
103
|
-
description: "List the user's estimates with optional filters. Filter by: status (draft, sent, accepted, declined), type (replacement, repair_service), clientId, companyId, or date range (from/to as ISO strings like 2026-01-01). Returns summary info — use estimator_get_estimate for full details on a specific one.",
|
|
104
|
-
inputSchemaZod: listEstimatesSchema,
|
|
105
|
-
execute: async (args) => {
|
|
106
|
-
if (!client.hasApiKey())
|
|
107
|
-
return client.noApiKeyMessage();
|
|
108
|
-
const params = new URLSearchParams();
|
|
109
|
-
if (args.status)
|
|
110
|
-
params.set("status", args.status);
|
|
111
|
-
if (args.type)
|
|
112
|
-
params.set("type", args.type);
|
|
113
|
-
if (args.clientId)
|
|
114
|
-
params.set("clientId", args.clientId);
|
|
115
|
-
if (args.companyId)
|
|
116
|
-
params.set("companyId", args.companyId);
|
|
117
|
-
if (args.from)
|
|
118
|
-
params.set("from", args.from);
|
|
119
|
-
if (args.to)
|
|
120
|
-
params.set("to", args.to);
|
|
121
|
-
if (args.limit != null)
|
|
122
|
-
params.set("limit", String(args.limit));
|
|
123
|
-
if (args.cursor)
|
|
124
|
-
params.set("cursor", args.cursor);
|
|
125
|
-
const q = params.toString();
|
|
126
|
-
const path = q ? `/estimator/estimates?${q}` : "/estimator/estimates";
|
|
127
|
-
const data = await client.get(path);
|
|
128
|
-
return JSON.stringify(data);
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
// --- estimator_add_line_item ---
|
|
132
|
-
const addLineItemSchema = z.object({
|
|
133
|
-
estimateId: z.string(),
|
|
134
|
-
serviceCode: z.string(),
|
|
135
|
-
materialType: z.string().nullable().optional(),
|
|
136
|
-
quantity: z.number(),
|
|
137
|
-
notes: z.string().optional(),
|
|
138
|
-
});
|
|
139
|
-
export const addLineItem = {
|
|
140
|
-
name: "estimator_add_line_item",
|
|
141
|
-
description: "Add a line item to an existing estimate. The serviceCode must exist in the user's catalog — call estimator_get_catalog to verify. Pass: estimateId, serviceCode, quantity. Optionally add notes. The estimate totals are automatically recalculated.",
|
|
142
|
-
inputSchemaZod: addLineItemSchema,
|
|
143
|
-
execute: async (args) => {
|
|
144
|
-
if (!client.hasApiKey())
|
|
145
|
-
return client.noApiKeyMessage();
|
|
146
|
-
const { estimateId, ...body } = args;
|
|
147
|
-
const data = await client.post(`/estimator/estimates/${estimateId}/line-items`, body);
|
|
148
|
-
return JSON.stringify(data);
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
// --- estimator_remove_line_item ---
|
|
152
|
-
const removeLineItemSchema = z.object({
|
|
153
|
-
estimateId: z.string(),
|
|
154
|
-
lineItemId: z.string(),
|
|
155
|
-
});
|
|
156
|
-
export const removeLineItem = {
|
|
157
|
-
name: "estimator_remove_line_item",
|
|
158
|
-
description: "Remove a line item from an estimate. Requires estimateId and lineItemId (get lineItemIds from estimator_get_estimate). The estimate totals are automatically recalculated.",
|
|
159
|
-
inputSchemaZod: removeLineItemSchema,
|
|
160
|
-
execute: async (args) => {
|
|
161
|
-
if (!client.hasApiKey())
|
|
162
|
-
return client.noApiKeyMessage();
|
|
163
|
-
const data = await client.del(`/estimator/estimates/${args.estimateId}/line-items/${args.lineItemId}`);
|
|
164
|
-
return JSON.stringify(data);
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
// --- estimator_update_line_item ---
|
|
168
|
-
const updateLineItemSchema = z.object({
|
|
169
|
-
estimateId: z.string(),
|
|
170
|
-
lineItemId: z.string(),
|
|
171
|
-
quantity: z.number().optional(),
|
|
172
|
-
materialCost: z.number().optional(),
|
|
173
|
-
laborCost: z.number().optional(),
|
|
174
|
-
notes: z.string().optional(),
|
|
175
|
-
});
|
|
176
|
-
export const updateLineItem = {
|
|
177
|
-
name: "estimator_update_line_item",
|
|
178
|
-
description: "Update a line item's quantity, materialCost, laborCost, or notes on an existing estimate. Requires estimateId and lineItemId. Totals are recalculated automatically after the update.",
|
|
179
|
-
inputSchemaZod: updateLineItemSchema,
|
|
180
|
-
execute: async (args) => {
|
|
181
|
-
if (!client.hasApiKey())
|
|
182
|
-
return client.noApiKeyMessage();
|
|
183
|
-
const { estimateId, lineItemId, ...body } = args;
|
|
184
|
-
const data = await client.patch(`/estimator/estimates/${estimateId}/line-items/${lineItemId}`, body);
|
|
185
|
-
return JSON.stringify(data);
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
// --- estimator_adjust_to_target ---
|
|
189
|
-
const adjustToTargetSchema = z.object({
|
|
190
|
-
estimateId: z.string(),
|
|
191
|
-
targetTotal: z.number(),
|
|
192
|
-
strategy: z.enum(["uniform", "labor_only", "material_only"]).optional(),
|
|
193
|
-
});
|
|
194
|
-
export const adjustToTarget = {
|
|
195
|
-
name: "estimator_adjust_to_target",
|
|
196
|
-
description: "Adjust all line items on an estimate to hit a specific target total price. Useful when a customer has a budget and you need to scale pricing to fit. Strategies: 'uniform' (default — scales all items proportionally), 'labor_only' (only adjusts labor costs), 'material_only' (only adjusts material costs). Requires estimateId and targetTotal.",
|
|
197
|
-
inputSchemaZod: adjustToTargetSchema,
|
|
198
|
-
execute: async (args) => {
|
|
199
|
-
if (!client.hasApiKey())
|
|
200
|
-
return client.noApiKeyMessage();
|
|
201
|
-
const { estimateId, ...body } = args;
|
|
202
|
-
const data = await client.post(`/estimator/estimates/${estimateId}/adjust`, body);
|
|
203
|
-
return JSON.stringify(data);
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
// --- estimator_update_estimate ---
|
|
207
|
-
const updateEstimateSchema = z.object({
|
|
208
|
-
estimateId: z.string(),
|
|
209
|
-
projectName: z.string().optional(),
|
|
210
|
-
status: z.string().optional(),
|
|
211
|
-
clientId: z.string().optional(),
|
|
212
|
-
companyId: z.string().optional(),
|
|
213
|
-
notes: z.string().optional(),
|
|
214
|
-
siteAddress: z.string().optional(),
|
|
215
|
-
});
|
|
216
|
-
export const updateEstimate = {
|
|
217
|
-
name: "estimator_update_estimate",
|
|
218
|
-
description: "Update an estimate's metadata — project name, status (draft/sent/accepted/declined), site address, client/company linking, or notes. Does NOT modify line items (use add/remove/update line item tools for that). Pass estimateId and any fields to change.",
|
|
219
|
-
inputSchemaZod: updateEstimateSchema,
|
|
220
|
-
execute: async (args) => {
|
|
221
|
-
if (!client.hasApiKey())
|
|
222
|
-
return client.noApiKeyMessage();
|
|
223
|
-
const { estimateId, ...body } = args;
|
|
224
|
-
const data = await client.patch(`/estimator/estimates/${estimateId}`, body);
|
|
225
|
-
return JSON.stringify(data);
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
// --- estimator_delete_estimate ---
|
|
229
|
-
const deleteEstimateSchema = z.object({
|
|
230
|
-
estimateId: z.string(),
|
|
231
|
-
});
|
|
232
|
-
export const deleteEstimate = {
|
|
233
|
-
name: "estimator_delete_estimate",
|
|
234
|
-
description: "Soft-delete an estimate. The estimate data is preserved but hidden from list views. This cannot be easily undone.",
|
|
235
|
-
inputSchemaZod: deleteEstimateSchema,
|
|
236
|
-
execute: async (args) => {
|
|
237
|
-
if (!client.hasApiKey())
|
|
238
|
-
return client.noApiKeyMessage();
|
|
239
|
-
const data = await client.del(`/estimator/estimates/${args.estimateId}`);
|
|
240
|
-
return JSON.stringify(data);
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
// --- estimator_duplicate_estimate ---
|
|
244
|
-
const duplicateEstimateSchema = z.object({
|
|
245
|
-
estimateId: z.string(),
|
|
246
|
-
projectName: z.string().optional(),
|
|
247
|
-
});
|
|
248
|
-
export const duplicateEstimate = {
|
|
249
|
-
name: "estimator_duplicate_estimate",
|
|
250
|
-
description: "Create a copy of an existing estimate with all its line items, pricing, and configuration. Optionally give the copy a new projectName. Useful for creating similar estimates for different clients or properties.",
|
|
251
|
-
inputSchemaZod: duplicateEstimateSchema,
|
|
252
|
-
execute: async (args) => {
|
|
253
|
-
if (!client.hasApiKey())
|
|
254
|
-
return client.noApiKeyMessage();
|
|
255
|
-
const { estimateId, ...body } = args;
|
|
256
|
-
const data = await client.post(`/estimator/estimates/${estimateId}/duplicate`, body);
|
|
257
|
-
return JSON.stringify(data);
|
|
258
|
-
},
|
|
259
|
-
};
|