@kynver-app/mcp-estimator 0.2.4 → 0.2.5
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/package.json +1 -1
- package/src/server.ts +2 -0
- package/src/tools/email-pdf-tools.ts +27 -0
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -11,6 +11,7 @@ import * as templateTools from "./tools/template-tools.js";
|
|
|
11
11
|
import * as versionTools from "./tools/version-tools.js";
|
|
12
12
|
import * as photoTools from "./tools/photo-tools.js";
|
|
13
13
|
import * as statsPdfTools from "./tools/stats-pdf-tools.js";
|
|
14
|
+
import * as emailPdfTools from "./tools/email-pdf-tools.js";
|
|
14
15
|
import * as visionTools from "./tools/vision-tools.js";
|
|
15
16
|
import * as companyTools from "./tools/company-tools.js";
|
|
16
17
|
import * as clientTools from "./tools/client-tools.js";
|
|
@@ -92,6 +93,7 @@ export function createEstimatorServer(): McpServer {
|
|
|
92
93
|
register(statsPdfTools.getStats.name, { description: statsPdfTools.getStats.description, inputSchema: statsPdfTools.getStats.inputSchemaZod }, (args) => statsPdfTools.getStats.execute(args as any));
|
|
93
94
|
register(statsPdfTools.exportPdf.name, { description: statsPdfTools.exportPdf.description, inputSchema: statsPdfTools.exportPdf.inputSchemaZod }, (args) => statsPdfTools.exportPdf.execute(args as any));
|
|
94
95
|
register(statsPdfTools.updateOutputConfig.name, { description: statsPdfTools.updateOutputConfig.description, inputSchema: statsPdfTools.updateOutputConfig.inputSchemaZod }, (args) => statsPdfTools.updateOutputConfig.execute(args as any));
|
|
96
|
+
register(emailPdfTools.emailPdf.name, { description: emailPdfTools.emailPdf.description, inputSchema: emailPdfTools.emailPdf.inputSchemaZod }, (args) => emailPdfTools.emailPdf.execute(args as any));
|
|
95
97
|
|
|
96
98
|
// --- Vision tools (2) ---
|
|
97
99
|
register(visionTools.analyzePhotos.name, { description: visionTools.analyzePhotos.description, inputSchema: visionTools.analyzePhotos.inputSchemaZod }, (args) => visionTools.analyzePhotos.execute(args as any));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as client from "../lib/kynver-client.js";
|
|
3
|
+
|
|
4
|
+
const emailPdfSchema = z.object({
|
|
5
|
+
estimateId: z.string(),
|
|
6
|
+
recipient: z.string().email().optional(),
|
|
7
|
+
subject: z.string().min(1).max(200).optional(),
|
|
8
|
+
message: z.string().min(1).max(10_000).optional(),
|
|
9
|
+
confirmExternalRecipient: z.boolean().optional().default(false),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const emailPdf = {
|
|
13
|
+
name: "estimator_email_pdf",
|
|
14
|
+
description:
|
|
15
|
+
"Email an estimate PDF to a recipient. Fetches and attaches the PDF server-side (no secrets exposed). Defaults to the account owner's email when recipient is omitted. Estimate client emails and linked client records are trusted without extra confirmation; any other address requires confirmExternalRecipient=true after explicit user confirmation. Respects the estimate approval gate before customer send. Returns send status and audit metadata.",
|
|
16
|
+
inputSchemaZod: emailPdfSchema,
|
|
17
|
+
execute: async (args: z.infer<typeof emailPdfSchema>): Promise<string> => {
|
|
18
|
+
if (!client.hasApiKey()) return client.noApiKeyMessage();
|
|
19
|
+
|
|
20
|
+
const { estimateId, ...body } = args;
|
|
21
|
+
const data = await client.post<unknown>(
|
|
22
|
+
`/estimator/estimates/${estimateId}/email-pdf`,
|
|
23
|
+
body,
|
|
24
|
+
);
|
|
25
|
+
return JSON.stringify(data);
|
|
26
|
+
},
|
|
27
|
+
};
|