verbo-mcp-server 0.2.0 → 0.2.1
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/client.d.ts +13 -0
- package/dist/client.js +39 -0
- package/dist/client.js.map +1 -1
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge-tools.d.ts +29 -0
- package/dist/knowledge-tools.js +58 -0
- package/dist/knowledge-tools.js.map +1 -0
- package/dist/tools.d.ts +11 -1
- package/dist/tools.js +26 -1
- package/dist/tools.js.map +1 -1
- package/dist/usage-tools.d.ts +9 -0
- package/dist/usage-tools.js +21 -0
- package/dist/usage-tools.js.map +1 -0
- package/dist/webhook-tools.d.ts +23 -0
- package/dist/webhook-tools.js +49 -0
- package/dist/webhook-tools.js.map +1 -0
- package/package.json +1 -1
- package/src/client.ts +52 -0
- package/src/index.ts +51 -0
- package/src/knowledge-tools.ts +69 -0
- package/src/tools.ts +26 -1
- package/src/usage-tools.ts +27 -0
- package/src/webhook-tools.ts +61 -0
package/dist/client.d.ts
CHANGED
|
@@ -14,9 +14,22 @@ export declare class VerboClient {
|
|
|
14
14
|
greetingMessage?: string;
|
|
15
15
|
faqData?: Record<string, string>[];
|
|
16
16
|
businessHours?: Record<string, unknown>;
|
|
17
|
+
agentName?: string;
|
|
18
|
+
systemInstructions?: string;
|
|
19
|
+
tone?: "professional" | "friendly" | "formal" | "casual";
|
|
20
|
+
language?: string;
|
|
21
|
+
rules?: string[];
|
|
17
22
|
}): Promise<unknown>;
|
|
18
23
|
setupCrawl(url: string): Promise<unknown>;
|
|
19
24
|
setupConnect(): Promise<unknown>;
|
|
20
25
|
setupStatus(): Promise<unknown>;
|
|
21
26
|
setupDisconnect(): Promise<unknown>;
|
|
27
|
+
knowledgeCrawl(url: string): Promise<unknown>;
|
|
28
|
+
knowledgeAdd(title: string, content: string): Promise<unknown>;
|
|
29
|
+
knowledgeList(): Promise<unknown>;
|
|
30
|
+
knowledgeDelete(id: string): Promise<unknown>;
|
|
31
|
+
webhookRegister(url: string, events: string[]): Promise<unknown>;
|
|
32
|
+
webhookList(): Promise<unknown>;
|
|
33
|
+
webhookDelete(id: string): Promise<unknown>;
|
|
34
|
+
getUsage(): Promise<unknown>;
|
|
22
35
|
}
|
package/dist/client.js
CHANGED
|
@@ -73,6 +73,45 @@ class VerboClient {
|
|
|
73
73
|
body: JSON.stringify({}),
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
async knowledgeCrawl(url) {
|
|
77
|
+
return this.request("/knowledge/crawl", {
|
|
78
|
+
method: "POST",
|
|
79
|
+
body: JSON.stringify({ url }),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async knowledgeAdd(title, content) {
|
|
83
|
+
return this.request("/knowledge", {
|
|
84
|
+
method: "POST",
|
|
85
|
+
body: JSON.stringify({ title, content }),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async knowledgeList() {
|
|
89
|
+
return this.request("/knowledge");
|
|
90
|
+
}
|
|
91
|
+
async knowledgeDelete(id) {
|
|
92
|
+
return this.request("/knowledge", {
|
|
93
|
+
method: "DELETE",
|
|
94
|
+
body: JSON.stringify({ id }),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async webhookRegister(url, events) {
|
|
98
|
+
return this.request("/webhooks", {
|
|
99
|
+
method: "POST",
|
|
100
|
+
body: JSON.stringify({ url, events }),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async webhookList() {
|
|
104
|
+
return this.request("/webhooks");
|
|
105
|
+
}
|
|
106
|
+
async webhookDelete(id) {
|
|
107
|
+
return this.request("/webhooks", {
|
|
108
|
+
method: "DELETE",
|
|
109
|
+
body: JSON.stringify({ id }),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
async getUsage() {
|
|
113
|
+
return this.request("/usage");
|
|
114
|
+
}
|
|
76
115
|
}
|
|
77
116
|
exports.VerboClient = VerboClient;
|
|
78
117
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;AAEpC,MAAa,WAAW;IACd,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,MAAc,EAAE,OAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,IAAI,qBAAqB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvE,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,UAAuB,EAAE;QAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,UAAU,IAAI,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;gBAClC,GAAG,OAAO,CAAC,OAAO;aACnB;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,oBAAoB,GAAG,CAAC,MAAM,MAAO,IAA2B,CAAC,KAAK,IAAI,eAAe,EAAE,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,QAAiB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAC/B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE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HANGED
|
@@ -7,6 +7,9 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
|
7
7
|
const client_js_1 = require("./client.js");
|
|
8
8
|
const tools_js_1 = require("./tools.js");
|
|
9
9
|
const setup_tools_js_1 = require("./setup-tools.js");
|
|
10
|
+
const knowledge_tools_js_1 = require("./knowledge-tools.js");
|
|
11
|
+
const webhook_tools_js_1 = require("./webhook-tools.js");
|
|
12
|
+
const usage_tools_js_1 = require("./usage-tools.js");
|
|
10
13
|
const apiKey = process.env.VERBO_API_KEY;
|
|
11
14
|
if (!apiKey) {
|
|
12
15
|
console.error("VERBO_API_KEY environment variable is required");
|
|
@@ -48,6 +51,51 @@ for (const [name, tool] of Object.entries(setup_tools_js_1.setupToolDefinitions)
|
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
53
|
}
|
|
54
|
+
for (const [name, tool] of Object.entries(knowledge_tools_js_1.knowledgeToolDefinitions)) {
|
|
55
|
+
server.tool(name, tool.description, tool.schema, async (args) => {
|
|
56
|
+
try {
|
|
57
|
+
const result = await (0, knowledge_tools_js_1.executeKnowledgeTool)(client, name, args);
|
|
58
|
+
return { content: [{ type: "text", text: result }] };
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
62
|
+
return {
|
|
63
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
64
|
+
isError: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
for (const [name, tool] of Object.entries(webhook_tools_js_1.webhookToolDefinitions)) {
|
|
70
|
+
server.tool(name, tool.description, tool.schema, async (args) => {
|
|
71
|
+
try {
|
|
72
|
+
const result = await (0, webhook_tools_js_1.executeWebhookTool)(client, name, args);
|
|
73
|
+
return { content: [{ type: "text", text: result }] };
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
77
|
+
return {
|
|
78
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
79
|
+
isError: true,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
for (const [name, tool] of Object.entries(usage_tools_js_1.usageToolDefinitions)) {
|
|
85
|
+
server.tool(name, tool.description, tool.schema, async (args) => {
|
|
86
|
+
try {
|
|
87
|
+
const result = await (0, usage_tools_js_1.executeUsageTool)(client, name, args);
|
|
88
|
+
return { content: [{ type: "text", text: result }] };
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
92
|
+
return {
|
|
93
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
94
|
+
isError: true,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
51
99
|
async function main() {
|
|
52
100
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
53
101
|
await server.connect(transport);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AACnC,oEAAoE;AACpE,wEAAiF;AACjF,2CAA0C;AAC1C,yCAAyE;AACzE,qDAA0E;AAE1E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AACzC,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC1C,MAAM,MAAM,GAAG,IAAI,uBAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEhD,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IAC3B,IAAI,EA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AAE,CAAC,EAAE,CAAC;QAChE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YACvD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type VerboClient } from "./client.js";
|
|
3
|
+
export declare const knowledgeToolDefinitions: {
|
|
4
|
+
readonly verbo_knowledge_crawl: {
|
|
5
|
+
readonly description: "Crawl a URL and add the extracted content to the agent's knowledge base. Use this to teach the agent about specific pages, documentation, or product details beyond the initial setup crawl. Rate limited to 3 calls per 10 minutes.";
|
|
6
|
+
readonly schema: {
|
|
7
|
+
readonly url: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
readonly verbo_knowledge_add: {
|
|
11
|
+
readonly description: "Manually add a knowledge entry to the agent's knowledge base. Use this to add custom FAQs, policies, product details, or any structured information the agent should know.";
|
|
12
|
+
readonly schema: {
|
|
13
|
+
readonly title: z.ZodString;
|
|
14
|
+
readonly content: z.ZodString;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly verbo_knowledge_list: {
|
|
18
|
+
readonly description: "List all entries in the agent's knowledge base. Shows titles and IDs of all stored knowledge.";
|
|
19
|
+
readonly schema: {};
|
|
20
|
+
};
|
|
21
|
+
readonly verbo_knowledge_delete: {
|
|
22
|
+
readonly description: "Delete a knowledge entry from the agent's knowledge base by its ID. Use verbo_knowledge_list to find the ID.";
|
|
23
|
+
readonly schema: {
|
|
24
|
+
readonly id: z.ZodString;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type KnowledgeToolName = keyof typeof knowledgeToolDefinitions;
|
|
29
|
+
export declare function executeKnowledgeTool(client: VerboClient, name: string, args: Record<string, unknown>): Promise<string>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.knowledgeToolDefinitions = void 0;
|
|
4
|
+
exports.executeKnowledgeTool = executeKnowledgeTool;
|
|
5
|
+
// packages/mcp-server/src/knowledge-tools.ts
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.knowledgeToolDefinitions = {
|
|
8
|
+
verbo_knowledge_crawl: {
|
|
9
|
+
description: "Crawl a URL and add the extracted content to the agent's knowledge base. Use this to teach the agent about specific pages, documentation, or product details beyond the initial setup crawl. Rate limited to 3 calls per 10 minutes.",
|
|
10
|
+
schema: {
|
|
11
|
+
url: zod_1.z.string().describe("URL to crawl and extract content from"),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
verbo_knowledge_add: {
|
|
15
|
+
description: "Manually add a knowledge entry to the agent's knowledge base. Use this to add custom FAQs, policies, product details, or any structured information the agent should know.",
|
|
16
|
+
schema: {
|
|
17
|
+
title: zod_1.z.string().describe("Title or topic of the knowledge entry"),
|
|
18
|
+
content: zod_1.z.string().describe("Full content of the knowledge entry"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
verbo_knowledge_list: {
|
|
22
|
+
description: "List all entries in the agent's knowledge base. Shows titles and IDs of all stored knowledge.",
|
|
23
|
+
schema: {},
|
|
24
|
+
},
|
|
25
|
+
verbo_knowledge_delete: {
|
|
26
|
+
description: "Delete a knowledge entry from the agent's knowledge base by its ID. Use verbo_knowledge_list to find the ID.",
|
|
27
|
+
schema: {
|
|
28
|
+
id: zod_1.z.string().describe("ID of the knowledge entry to delete"),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
async function executeKnowledgeTool(client, name, args) {
|
|
33
|
+
switch (name) {
|
|
34
|
+
case "verbo_knowledge_crawl": {
|
|
35
|
+
const result = await client.knowledgeCrawl(args.url);
|
|
36
|
+
return JSON.stringify(result, null, 2) +
|
|
37
|
+
"\n\n→ Content extracted and added to knowledge base. Use verbo_knowledge_list to see all entries.";
|
|
38
|
+
}
|
|
39
|
+
case "verbo_knowledge_add": {
|
|
40
|
+
const result = await client.knowledgeAdd(args.title, args.content);
|
|
41
|
+
return JSON.stringify(result, null, 2) +
|
|
42
|
+
"\n\n→ Knowledge entry added. Use verbo_knowledge_list to see all entries.";
|
|
43
|
+
}
|
|
44
|
+
case "verbo_knowledge_list": {
|
|
45
|
+
const result = await client.knowledgeList();
|
|
46
|
+
return JSON.stringify(result, null, 2) +
|
|
47
|
+
"\n\n→ Use verbo_knowledge_delete with an ID to remove an entry.";
|
|
48
|
+
}
|
|
49
|
+
case "verbo_knowledge_delete": {
|
|
50
|
+
const result = await client.knowledgeDelete(args.id);
|
|
51
|
+
return JSON.stringify(result, null, 2) +
|
|
52
|
+
"\n\n→ Knowledge entry deleted.";
|
|
53
|
+
}
|
|
54
|
+
default:
|
|
55
|
+
return JSON.stringify({ error: `Unknown knowledge tool: ${name}` });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=knowledge-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"know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AAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,2EAA2E,CAAC;QAChF,CAAC;QACD,KAAK,sBAAsB,CAAC,CAAC,CAAC;YAC5B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,iEAAiE,CAAC;QACtE,CAAC;QACD,KAAK,wBAAwB,CAAC,CAAC,CAAC;YAC9B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAY,CAAC,CAAC;YAC/D,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,gCAAgC,CAAC;QACrC,CAAC;QACD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,2BAA2B,IAAI,EAAE,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare const toolDefinitions: {
|
|
|
30
30
|
readonly schema: {};
|
|
31
31
|
};
|
|
32
32
|
readonly verbo_configure_agent: {
|
|
33
|
-
readonly description: "Configure the AI agent behavior. Set greeting message, FAQ, and
|
|
33
|
+
readonly description: "Configure the AI agent behavior. Set greeting message, FAQ, business hours, agent name, system instructions, tone, language, and custom rules.";
|
|
34
34
|
readonly schema: {
|
|
35
35
|
readonly greeting_message: z.ZodOptional<z.ZodString>;
|
|
36
36
|
readonly faq: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -38,6 +38,16 @@ export declare const toolDefinitions: {
|
|
|
38
38
|
answer: z.ZodString;
|
|
39
39
|
}, z.core.$strip>>>;
|
|
40
40
|
readonly business_hours: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
41
|
+
readonly agent_name: z.ZodOptional<z.ZodString>;
|
|
42
|
+
readonly system_instructions: z.ZodOptional<z.ZodString>;
|
|
43
|
+
readonly tone: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
professional: "professional";
|
|
45
|
+
friendly: "friendly";
|
|
46
|
+
formal: "formal";
|
|
47
|
+
casual: "casual";
|
|
48
|
+
}>>;
|
|
49
|
+
readonly language: z.ZodOptional<z.ZodString>;
|
|
50
|
+
readonly rules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
51
|
};
|
|
42
52
|
};
|
|
43
53
|
};
|
package/dist/tools.js
CHANGED
|
@@ -42,7 +42,7 @@ exports.toolDefinitions = {
|
|
|
42
42
|
schema: {},
|
|
43
43
|
},
|
|
44
44
|
verbo_configure_agent: {
|
|
45
|
-
description: "Configure the AI agent behavior. Set greeting message, FAQ, and
|
|
45
|
+
description: "Configure the AI agent behavior. Set greeting message, FAQ, business hours, agent name, system instructions, tone, language, and custom rules.",
|
|
46
46
|
schema: {
|
|
47
47
|
greeting_message: zod_1.z
|
|
48
48
|
.string()
|
|
@@ -59,6 +59,26 @@ exports.toolDefinitions = {
|
|
|
59
59
|
.record(zod_1.z.string(), zod_1.z.string())
|
|
60
60
|
.optional()
|
|
61
61
|
.describe("Business hours (e.g. { monday: '9:00-18:00' })"),
|
|
62
|
+
agent_name: zod_1.z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Display name for the AI agent (e.g. 'Sofia', 'Assistente Verbo')"),
|
|
66
|
+
system_instructions: zod_1.z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Custom system instructions that define how the agent behaves and responds"),
|
|
70
|
+
tone: zod_1.z
|
|
71
|
+
.enum(["professional", "friendly", "formal", "casual"])
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Tone of voice for the agent's responses"),
|
|
74
|
+
language: zod_1.z
|
|
75
|
+
.string()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Primary language for responses (e.g. 'pt-BR', 'en-US', 'es')"),
|
|
78
|
+
rules: zod_1.z
|
|
79
|
+
.array(zod_1.z.string())
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("List of custom rules the agent must follow (e.g. 'Never mention competitors')"),
|
|
62
82
|
},
|
|
63
83
|
},
|
|
64
84
|
};
|
|
@@ -88,6 +108,11 @@ async function executeTool(client, name, args) {
|
|
|
88
108
|
greetingMessage: args.greeting_message,
|
|
89
109
|
faqData: args.faq,
|
|
90
110
|
businessHours: args.business_hours,
|
|
111
|
+
agentName: args.agent_name,
|
|
112
|
+
systemInstructions: args.system_instructions,
|
|
113
|
+
tone: args.tone,
|
|
114
|
+
language: args.language,
|
|
115
|
+
rules: args.rules,
|
|
91
116
|
});
|
|
92
117
|
return JSON.stringify(result, null, 2);
|
|
93
118
|
}
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;;AA8FA,kCAiDC;AA/ID,mCAAmC;AACnC,6BAAwB;AAGX,QAAA,eAAe,GAAG;IAC7B,kBAAkB,EAAE;QAClB,WAAW,EACT,sEAAsE;QACxE,MAAM,EAAE;YACN,EAAE,EAAE,OAAC;iBACF,MAAM,EAAE;iBACR,QAAQ,CAAC,oCAAoC,CAAC;YACjD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC5C,SAAS,EAAE,OAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,sBAAsB,CAAC;SACpC;KACF;IACD,wBAAwB,EAAE;QACxB,WAAW,EACT,gEAAgE;QAClE,MAAM,EAAE;YACN,MAAM,EAAE,OAAC;iBACN,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;iBACxB,QAAQ,EAAE;iB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AAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,KAAK,uBAAuB,CAAC,CAAC,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC;gBACzC,eAAe,EAAE,IAAI,CAAC,gBAAsC;gBAC5D,OAAO,EAAE,IAAI,CAAC,GAA2C;gBACzD,aAAa,EAAE,IAAI,CAAC,cAEP;gBACb,SAAS,EAAE,IAAI,CAAC,UAAgC;gBAChD,kBAAkB,EAAE,IAAI,CAAC,mBAAyC;gBAClE,IAAI,EAAE,IAAI,CAAC,IAAqE;gBAChF,QAAQ,EAAE,IAAI,CAAC,QAA8B;gBAC7C,KAAK,EAAE,IAAI,CAAC,KAA6B;aAC1C,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC;QACD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VerboClient } from "./client.js";
|
|
2
|
+
export declare const usageToolDefinitions: {
|
|
3
|
+
readonly verbo_usage: {
|
|
4
|
+
readonly description: "Get usage statistics for the current billing period. Shows messages sent, conversations handled, AI calls made, and remaining quota.";
|
|
5
|
+
readonly schema: {};
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type UsageToolName = keyof typeof usageToolDefinitions;
|
|
9
|
+
export declare function executeUsageTool(client: VerboClient, name: string, _args: Record<string, unknown>): Promise<string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usageToolDefinitions = void 0;
|
|
4
|
+
exports.executeUsageTool = executeUsageTool;
|
|
5
|
+
exports.usageToolDefinitions = {
|
|
6
|
+
verbo_usage: {
|
|
7
|
+
description: "Get usage statistics for the current billing period. Shows messages sent, conversations handled, AI calls made, and remaining quota.",
|
|
8
|
+
schema: {},
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
async function executeUsageTool(client, name, _args) {
|
|
12
|
+
switch (name) {
|
|
13
|
+
case "verbo_usage": {
|
|
14
|
+
const result = await client.getUsage();
|
|
15
|
+
return JSON.stringify(result, null, 2);
|
|
16
|
+
}
|
|
17
|
+
default:
|
|
18
|
+
return JSON.stringify({ error: `Unknown usage tool: ${name}` });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=usage-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-tools.js","sourceRoot":"","sources":["../src/usage-tools.ts"],"names":[],"mappings":";;;AAaA,4CAaC;AAvBY,QAAA,oBAAoB,GAAG;IAClC,WAAW,EAAE;QACX,WAAW,EACT,sIAAsI;QACxI,MAAM,EAAE,EAAE;KACX;CACO,CAAC;AAIJ,KAAK,UAAU,gBAAgB,CACpC,MAAmB,EACnB,IAAY,EACZ,KAA8B;IAE9B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC;QACD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,uBAAuB,IAAI,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type VerboClient } from "./client.js";
|
|
3
|
+
export declare const webhookToolDefinitions: {
|
|
4
|
+
readonly verbo_webhook_register: {
|
|
5
|
+
readonly description: "Register a webhook URL to receive real-time events from Verbo. Supported events: message.received, message.sent, conversation.opened, escalation.created.";
|
|
6
|
+
readonly schema: {
|
|
7
|
+
readonly url: z.ZodString;
|
|
8
|
+
readonly events: z.ZodArray<z.ZodString>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
readonly verbo_webhook_list: {
|
|
12
|
+
readonly description: "List all registered webhooks. Shows URLs, subscribed events, and IDs.";
|
|
13
|
+
readonly schema: {};
|
|
14
|
+
};
|
|
15
|
+
readonly verbo_webhook_delete: {
|
|
16
|
+
readonly description: "Delete a registered webhook by its ID. Use verbo_webhook_list to find the ID.";
|
|
17
|
+
readonly schema: {
|
|
18
|
+
readonly id: z.ZodString;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type WebhookToolName = keyof typeof webhookToolDefinitions;
|
|
23
|
+
export declare function executeWebhookTool(client: VerboClient, name: string, args: Record<string, unknown>): Promise<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webhookToolDefinitions = void 0;
|
|
4
|
+
exports.executeWebhookTool = executeWebhookTool;
|
|
5
|
+
// packages/mcp-server/src/webhook-tools.ts
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.webhookToolDefinitions = {
|
|
8
|
+
verbo_webhook_register: {
|
|
9
|
+
description: "Register a webhook URL to receive real-time events from Verbo. Supported events: message.received, message.sent, conversation.opened, escalation.created.",
|
|
10
|
+
schema: {
|
|
11
|
+
url: zod_1.z.string().describe("HTTPS URL to receive webhook POST requests"),
|
|
12
|
+
events: zod_1.z
|
|
13
|
+
.array(zod_1.z.string())
|
|
14
|
+
.describe("List of events to subscribe to (e.g. ['message.received', 'conversation.opened'])"),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
verbo_webhook_list: {
|
|
18
|
+
description: "List all registered webhooks. Shows URLs, subscribed events, and IDs.",
|
|
19
|
+
schema: {},
|
|
20
|
+
},
|
|
21
|
+
verbo_webhook_delete: {
|
|
22
|
+
description: "Delete a registered webhook by its ID. Use verbo_webhook_list to find the ID.",
|
|
23
|
+
schema: {
|
|
24
|
+
id: zod_1.z.string().describe("ID of the webhook to delete"),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
async function executeWebhookTool(client, name, args) {
|
|
29
|
+
switch (name) {
|
|
30
|
+
case "verbo_webhook_register": {
|
|
31
|
+
const result = await client.webhookRegister(args.url, args.events);
|
|
32
|
+
return JSON.stringify(result, null, 2) +
|
|
33
|
+
"\n\n→ Webhook registered. Verbo will POST events to your URL. Use verbo_webhook_list to see all webhooks.";
|
|
34
|
+
}
|
|
35
|
+
case "verbo_webhook_list": {
|
|
36
|
+
const result = await client.webhookList();
|
|
37
|
+
return JSON.stringify(result, null, 2) +
|
|
38
|
+
"\n\n→ Use verbo_webhook_delete with an ID to remove a webhook.";
|
|
39
|
+
}
|
|
40
|
+
case "verbo_webhook_delete": {
|
|
41
|
+
const result = await client.webhookDelete(args.id);
|
|
42
|
+
return JSON.stringify(result, null, 2) +
|
|
43
|
+
"\n\n→ Webhook deleted. No more events will be sent to that URL.";
|
|
44
|
+
}
|
|
45
|
+
default:
|
|
46
|
+
return JSON.stringify({ error: `Unknown webhook tool: ${name}` });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=webhook-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-tools.js","sourceRoot":"","sources":["../src/webhook-tools.ts"],"names":[],"mappings":";;;AAiCA,gDA2BC;AA5DD,2CAA2C;AAC3C,6BAAwB;AAGX,QAAA,sBAAsB,GAAG;IACpC,sBAAsB,EAAE;QACtB,WAAW,EACT,2JAA2J;QAC7J,MAAM,EAAE;YACN,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4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,CAAC,CAAC;IACtE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -56,6 +56,11 @@ export class VerboClient {
|
|
|
56
56
|
greetingMessage?: string;
|
|
57
57
|
faqData?: Record<string, string>[];
|
|
58
58
|
businessHours?: Record<string, unknown>;
|
|
59
|
+
agentName?: string;
|
|
60
|
+
systemInstructions?: string;
|
|
61
|
+
tone?: "professional" | "friendly" | "formal" | "casual";
|
|
62
|
+
language?: string;
|
|
63
|
+
rules?: string[];
|
|
59
64
|
}) {
|
|
60
65
|
return this.request("/agent/configure", {
|
|
61
66
|
method: "POST",
|
|
@@ -87,4 +92,51 @@ export class VerboClient {
|
|
|
87
92
|
body: JSON.stringify({}),
|
|
88
93
|
});
|
|
89
94
|
}
|
|
95
|
+
|
|
96
|
+
async knowledgeCrawl(url: string) {
|
|
97
|
+
return this.request("/knowledge/crawl", {
|
|
98
|
+
method: "POST",
|
|
99
|
+
body: JSON.stringify({ url }),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async knowledgeAdd(title: string, content: string) {
|
|
104
|
+
return this.request("/knowledge", {
|
|
105
|
+
method: "POST",
|
|
106
|
+
body: JSON.stringify({ title, content }),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async knowledgeList() {
|
|
111
|
+
return this.request("/knowledge");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async knowledgeDelete(id: string) {
|
|
115
|
+
return this.request("/knowledge", {
|
|
116
|
+
method: "DELETE",
|
|
117
|
+
body: JSON.stringify({ id }),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async webhookRegister(url: string, events: string[]) {
|
|
122
|
+
return this.request("/webhooks", {
|
|
123
|
+
method: "POST",
|
|
124
|
+
body: JSON.stringify({ url, events }),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async webhookList() {
|
|
129
|
+
return this.request("/webhooks");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async webhookDelete(id: string) {
|
|
133
|
+
return this.request("/webhooks", {
|
|
134
|
+
method: "DELETE",
|
|
135
|
+
body: JSON.stringify({ id }),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async getUsage() {
|
|
140
|
+
return this.request("/usage");
|
|
141
|
+
}
|
|
90
142
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
5
5
|
import { VerboClient } from "./client.js";
|
|
6
6
|
import { toolDefinitions, executeTool, type ToolName } from "./tools.js";
|
|
7
7
|
import { setupToolDefinitions, executeSetupTool } from "./setup-tools.js";
|
|
8
|
+
import { knowledgeToolDefinitions, executeKnowledgeTool } from "./knowledge-tools.js";
|
|
9
|
+
import { webhookToolDefinitions, executeWebhookTool } from "./webhook-tools.js";
|
|
10
|
+
import { usageToolDefinitions, executeUsageTool } from "./usage-tools.js";
|
|
8
11
|
|
|
9
12
|
const apiKey = process.env.VERBO_API_KEY;
|
|
10
13
|
if (!apiKey) {
|
|
@@ -56,6 +59,54 @@ for (const [name, tool] of Object.entries(setupToolDefinitions)) {
|
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
61
|
|
|
62
|
+
for (const [name, tool] of Object.entries(knowledgeToolDefinitions)) {
|
|
63
|
+
server.tool(name, tool.description, tool.schema, async (args: Record<string, unknown>) => {
|
|
64
|
+
try {
|
|
65
|
+
const result = await executeKnowledgeTool(client, name, args);
|
|
66
|
+
return { content: [{ type: "text" as const, text: result }] };
|
|
67
|
+
} catch (err) {
|
|
68
|
+
const message =
|
|
69
|
+
err instanceof Error ? err.message : "Unknown error";
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: "text" as const, text: `Error: ${message}` }],
|
|
72
|
+
isError: true,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
for (const [name, tool] of Object.entries(webhookToolDefinitions)) {
|
|
79
|
+
server.tool(name, tool.description, tool.schema, async (args: Record<string, unknown>) => {
|
|
80
|
+
try {
|
|
81
|
+
const result = await executeWebhookTool(client, name, args);
|
|
82
|
+
return { content: [{ type: "text" as const, text: result }] };
|
|
83
|
+
} catch (err) {
|
|
84
|
+
const message =
|
|
85
|
+
err instanceof Error ? err.message : "Unknown error";
|
|
86
|
+
return {
|
|
87
|
+
content: [{ type: "text" as const, text: `Error: ${message}` }],
|
|
88
|
+
isError: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
for (const [name, tool] of Object.entries(usageToolDefinitions)) {
|
|
95
|
+
server.tool(name, tool.description, tool.schema, async (args: Record<string, unknown>) => {
|
|
96
|
+
try {
|
|
97
|
+
const result = await executeUsageTool(client, name, args);
|
|
98
|
+
return { content: [{ type: "text" as const, text: result }] };
|
|
99
|
+
} catch (err) {
|
|
100
|
+
const message =
|
|
101
|
+
err instanceof Error ? err.message : "Unknown error";
|
|
102
|
+
return {
|
|
103
|
+
content: [{ type: "text" as const, text: `Error: ${message}` }],
|
|
104
|
+
isError: true,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
59
110
|
async function main() {
|
|
60
111
|
const transport = new StdioServerTransport();
|
|
61
112
|
await server.connect(transport);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// packages/mcp-server/src/knowledge-tools.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type VerboClient } from "./client.js";
|
|
4
|
+
|
|
5
|
+
export const knowledgeToolDefinitions = {
|
|
6
|
+
verbo_knowledge_crawl: {
|
|
7
|
+
description:
|
|
8
|
+
"Crawl a URL and add the extracted content to the agent's knowledge base. Use this to teach the agent about specific pages, documentation, or product details beyond the initial setup crawl. Rate limited to 3 calls per 10 minutes.",
|
|
9
|
+
schema: {
|
|
10
|
+
url: z.string().describe("URL to crawl and extract content from"),
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
verbo_knowledge_add: {
|
|
14
|
+
description:
|
|
15
|
+
"Manually add a knowledge entry to the agent's knowledge base. Use this to add custom FAQs, policies, product details, or any structured information the agent should know.",
|
|
16
|
+
schema: {
|
|
17
|
+
title: z.string().describe("Title or topic of the knowledge entry"),
|
|
18
|
+
content: z.string().describe("Full content of the knowledge entry"),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
verbo_knowledge_list: {
|
|
22
|
+
description:
|
|
23
|
+
"List all entries in the agent's knowledge base. Shows titles and IDs of all stored knowledge.",
|
|
24
|
+
schema: {},
|
|
25
|
+
},
|
|
26
|
+
verbo_knowledge_delete: {
|
|
27
|
+
description:
|
|
28
|
+
"Delete a knowledge entry from the agent's knowledge base by its ID. Use verbo_knowledge_list to find the ID.",
|
|
29
|
+
schema: {
|
|
30
|
+
id: z.string().describe("ID of the knowledge entry to delete"),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
} as const;
|
|
34
|
+
|
|
35
|
+
export type KnowledgeToolName = keyof typeof knowledgeToolDefinitions;
|
|
36
|
+
|
|
37
|
+
export async function executeKnowledgeTool(
|
|
38
|
+
client: VerboClient,
|
|
39
|
+
name: string,
|
|
40
|
+
args: Record<string, unknown>,
|
|
41
|
+
): Promise<string> {
|
|
42
|
+
switch (name) {
|
|
43
|
+
case "verbo_knowledge_crawl": {
|
|
44
|
+
const result = await client.knowledgeCrawl(args.url as string);
|
|
45
|
+
return JSON.stringify(result, null, 2) +
|
|
46
|
+
"\n\n→ Content extracted and added to knowledge base. Use verbo_knowledge_list to see all entries.";
|
|
47
|
+
}
|
|
48
|
+
case "verbo_knowledge_add": {
|
|
49
|
+
const result = await client.knowledgeAdd(
|
|
50
|
+
args.title as string,
|
|
51
|
+
args.content as string,
|
|
52
|
+
);
|
|
53
|
+
return JSON.stringify(result, null, 2) +
|
|
54
|
+
"\n\n→ Knowledge entry added. Use verbo_knowledge_list to see all entries.";
|
|
55
|
+
}
|
|
56
|
+
case "verbo_knowledge_list": {
|
|
57
|
+
const result = await client.knowledgeList();
|
|
58
|
+
return JSON.stringify(result, null, 2) +
|
|
59
|
+
"\n\n→ Use verbo_knowledge_delete with an ID to remove an entry.";
|
|
60
|
+
}
|
|
61
|
+
case "verbo_knowledge_delete": {
|
|
62
|
+
const result = await client.knowledgeDelete(args.id as string);
|
|
63
|
+
return JSON.stringify(result, null, 2) +
|
|
64
|
+
"\n\n→ Knowledge entry deleted.";
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
return JSON.stringify({ error: `Unknown knowledge tool: ${name}` });
|
|
68
|
+
}
|
|
69
|
+
}
|
package/src/tools.ts
CHANGED
|
@@ -45,7 +45,7 @@ export const toolDefinitions = {
|
|
|
45
45
|
},
|
|
46
46
|
verbo_configure_agent: {
|
|
47
47
|
description:
|
|
48
|
-
"Configure the AI agent behavior. Set greeting message, FAQ, and
|
|
48
|
+
"Configure the AI agent behavior. Set greeting message, FAQ, business hours, agent name, system instructions, tone, language, and custom rules.",
|
|
49
49
|
schema: {
|
|
50
50
|
greeting_message: z
|
|
51
51
|
.string()
|
|
@@ -66,6 +66,26 @@ export const toolDefinitions = {
|
|
|
66
66
|
.describe(
|
|
67
67
|
"Business hours (e.g. { monday: '9:00-18:00' })",
|
|
68
68
|
),
|
|
69
|
+
agent_name: z
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Display name for the AI agent (e.g. 'Sofia', 'Assistente Verbo')"),
|
|
73
|
+
system_instructions: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Custom system instructions that define how the agent behaves and responds"),
|
|
77
|
+
tone: z
|
|
78
|
+
.enum(["professional", "friendly", "formal", "casual"])
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Tone of voice for the agent's responses"),
|
|
81
|
+
language: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe("Primary language for responses (e.g. 'pt-BR', 'en-US', 'es')"),
|
|
85
|
+
rules: z
|
|
86
|
+
.array(z.string())
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("List of custom rules the agent must follow (e.g. 'Never mention competitors')"),
|
|
69
89
|
},
|
|
70
90
|
},
|
|
71
91
|
} as const;
|
|
@@ -110,6 +130,11 @@ export async function executeTool(
|
|
|
110
130
|
businessHours: args.business_hours as
|
|
111
131
|
| Record<string, unknown>
|
|
112
132
|
| undefined,
|
|
133
|
+
agentName: args.agent_name as string | undefined,
|
|
134
|
+
systemInstructions: args.system_instructions as string | undefined,
|
|
135
|
+
tone: args.tone as "professional" | "friendly" | "formal" | "casual" | undefined,
|
|
136
|
+
language: args.language as string | undefined,
|
|
137
|
+
rules: args.rules as string[] | undefined,
|
|
113
138
|
});
|
|
114
139
|
return JSON.stringify(result, null, 2);
|
|
115
140
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// packages/mcp-server/src/usage-tools.ts
|
|
2
|
+
import { type VerboClient } from "./client.js";
|
|
3
|
+
|
|
4
|
+
export const usageToolDefinitions = {
|
|
5
|
+
verbo_usage: {
|
|
6
|
+
description:
|
|
7
|
+
"Get usage statistics for the current billing period. Shows messages sent, conversations handled, AI calls made, and remaining quota.",
|
|
8
|
+
schema: {},
|
|
9
|
+
},
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export type UsageToolName = keyof typeof usageToolDefinitions;
|
|
13
|
+
|
|
14
|
+
export async function executeUsageTool(
|
|
15
|
+
client: VerboClient,
|
|
16
|
+
name: string,
|
|
17
|
+
_args: Record<string, unknown>,
|
|
18
|
+
): Promise<string> {
|
|
19
|
+
switch (name) {
|
|
20
|
+
case "verbo_usage": {
|
|
21
|
+
const result = await client.getUsage();
|
|
22
|
+
return JSON.stringify(result, null, 2);
|
|
23
|
+
}
|
|
24
|
+
default:
|
|
25
|
+
return JSON.stringify({ error: `Unknown usage tool: ${name}` });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// packages/mcp-server/src/webhook-tools.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type VerboClient } from "./client.js";
|
|
4
|
+
|
|
5
|
+
export const webhookToolDefinitions = {
|
|
6
|
+
verbo_webhook_register: {
|
|
7
|
+
description:
|
|
8
|
+
"Register a webhook URL to receive real-time events from Verbo. Supported events: message.received, message.sent, conversation.opened, escalation.created.",
|
|
9
|
+
schema: {
|
|
10
|
+
url: z.string().describe("HTTPS URL to receive webhook POST requests"),
|
|
11
|
+
events: z
|
|
12
|
+
.array(z.string())
|
|
13
|
+
.describe(
|
|
14
|
+
"List of events to subscribe to (e.g. ['message.received', 'conversation.opened'])",
|
|
15
|
+
),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
verbo_webhook_list: {
|
|
19
|
+
description:
|
|
20
|
+
"List all registered webhooks. Shows URLs, subscribed events, and IDs.",
|
|
21
|
+
schema: {},
|
|
22
|
+
},
|
|
23
|
+
verbo_webhook_delete: {
|
|
24
|
+
description:
|
|
25
|
+
"Delete a registered webhook by its ID. Use verbo_webhook_list to find the ID.",
|
|
26
|
+
schema: {
|
|
27
|
+
id: z.string().describe("ID of the webhook to delete"),
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type WebhookToolName = keyof typeof webhookToolDefinitions;
|
|
33
|
+
|
|
34
|
+
export async function executeWebhookTool(
|
|
35
|
+
client: VerboClient,
|
|
36
|
+
name: string,
|
|
37
|
+
args: Record<string, unknown>,
|
|
38
|
+
): Promise<string> {
|
|
39
|
+
switch (name) {
|
|
40
|
+
case "verbo_webhook_register": {
|
|
41
|
+
const result = await client.webhookRegister(
|
|
42
|
+
args.url as string,
|
|
43
|
+
args.events as string[],
|
|
44
|
+
);
|
|
45
|
+
return JSON.stringify(result, null, 2) +
|
|
46
|
+
"\n\n→ Webhook registered. Verbo will POST events to your URL. Use verbo_webhook_list to see all webhooks.";
|
|
47
|
+
}
|
|
48
|
+
case "verbo_webhook_list": {
|
|
49
|
+
const result = await client.webhookList();
|
|
50
|
+
return JSON.stringify(result, null, 2) +
|
|
51
|
+
"\n\n→ Use verbo_webhook_delete with an ID to remove a webhook.";
|
|
52
|
+
}
|
|
53
|
+
case "verbo_webhook_delete": {
|
|
54
|
+
const result = await client.webhookDelete(args.id as string);
|
|
55
|
+
return JSON.stringify(result, null, 2) +
|
|
56
|
+
"\n\n→ Webhook deleted. No more events will be sent to that URL.";
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
return JSON.stringify({ error: `Unknown webhook tool: ${name}` });
|
|
60
|
+
}
|
|
61
|
+
}
|