@abhinavyadav/bolna-mcp 1.0.0

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.
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "registerViolationTools", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return registerViolationTools;
9
+ }
10
+ });
11
+ const _zod = require("zod");
12
+ const _formdata = /*#__PURE__*/ _interop_require_default(require("form-data"));
13
+ const _client = require("../client.js");
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ function registerViolationTools(server) {
20
+ server.tool("bolna_list_violations", "Retrieve a paginated list of call violations, optionally filtered by status", {
21
+ status: _zod.z.string().optional().describe('Filter violations by status, e.g. "pending", "resolved"'),
22
+ page_number: _zod.z.number().int().positive().optional().default(1).describe("Page number (1-indexed)"),
23
+ page_size: _zod.z.number().int().positive().optional().default(10).describe("Results per page")
24
+ }, async (args)=>{
25
+ try {
26
+ const params = {
27
+ page_number: args.page_number ?? 1,
28
+ page_size: args.page_size ?? 10
29
+ };
30
+ if (args.status) params.status = args.status;
31
+ const response = await _client.bolnaClient.get("/violations/list", {
32
+ params
33
+ });
34
+ return {
35
+ content: [
36
+ {
37
+ type: "text",
38
+ text: JSON.stringify(response.data, null, 2)
39
+ }
40
+ ]
41
+ };
42
+ } catch (error) {
43
+ (0, _client.handleAxiosError)(error, "bolna_list_violations");
44
+ }
45
+ });
46
+ server.tool("bolna_submit_violation", "Submit a violation with an optional evidence file (e.g. a screenshot or document as base64)", {
47
+ violation_id: _zod.z.string().describe("The ID of the violation to submit evidence for"),
48
+ evidence_base64: _zod.z.string().optional().describe("Base64-encoded evidence file content (e.g. PNG screenshot or PDF)"),
49
+ evidence_filename: _zod.z.string().optional().default("evidence.png").describe("Filename for the evidence file"),
50
+ notes: _zod.z.string().optional().describe("Optional notes or explanation to include with the submission")
51
+ }, async (args)=>{
52
+ try {
53
+ const form = new _formdata.default();
54
+ form.append("violation_id", args.violation_id);
55
+ if (args.evidence_base64) {
56
+ const buf = Buffer.from(args.evidence_base64, "base64");
57
+ form.append("file", buf, {
58
+ filename: args.evidence_filename ?? "evidence.png"
59
+ });
60
+ }
61
+ if (args.notes) form.append("notes", args.notes);
62
+ const response = await _client.bolnaClient.post("/violations/submit", form, {
63
+ headers: {
64
+ ...form.getHeaders()
65
+ }
66
+ });
67
+ return {
68
+ content: [
69
+ {
70
+ type: "text",
71
+ text: JSON.stringify(response.data, null, 2)
72
+ }
73
+ ]
74
+ };
75
+ } catch (error) {
76
+ (0, _client.handleAxiosError)(error, "bolna_submit_violation");
77
+ }
78
+ });
79
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "registerVoiceTools", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return registerVoiceTools;
9
+ }
10
+ });
11
+ const _zod = require("zod");
12
+ const _client = require("../client.js");
13
+ function registerVoiceTools(server) {
14
+ server.tool("bolna_list_voices", "List all available voices for your Bolna account including provider, language, and accent details", {
15
+ provider: _zod.z.string().optional().describe('Filter by TTS provider, e.g. "elevenlabs", "deepgram", "azure", "cartesia", "aws_polly"'),
16
+ language: _zod.z.string().optional().describe('Filter by language code, e.g. "en", "hi", "ta"')
17
+ }, async (args)=>{
18
+ try {
19
+ const params = {};
20
+ if (args.provider) params.provider = args.provider;
21
+ if (args.language) params.language = args.language;
22
+ const response = await _client.bolnaClient.get("/voice/get-all-voices", {
23
+ params: Object.keys(params).length > 0 ? params : undefined
24
+ });
25
+ return {
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: JSON.stringify(response.data, null, 2)
30
+ }
31
+ ]
32
+ };
33
+ } catch (error) {
34
+ (0, _client.handleAxiosError)(error, "bolna_list_voices");
35
+ }
36
+ });
37
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@abhinavyadav/bolna-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for the Bolna Voice AI platform — manage agents, calls, batches, knowledgebases, and phone numbers through natural language",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "bolna-mcp": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "swc src -d dist --strip-leading-paths",
14
+ "postbuild": "rm -rf dist/__tests__",
15
+ "typecheck": "tsc --noEmit",
16
+ "start": "node dist/index.js",
17
+ "dev": "ts-node src/index.ts",
18
+ "test": "jest",
19
+ "test:coverage": "jest --coverage",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "model-context-protocol",
25
+ "bolna",
26
+ "voice-ai",
27
+ "ai-agent",
28
+ "llm",
29
+ "telephony",
30
+ "claude"
31
+ ],
32
+ "author": "Abhinav Yadav",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/abhinavyadav/bolna-mcp.git"
37
+ },
38
+ "homepage": "https://github.com/abhinavyadav/bolna-mcp#readme",
39
+ "engines": {
40
+ "node": ">=18"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "latest",
44
+ "axios": "^1.6.0",
45
+ "form-data": "^4.0.0",
46
+ "zod": "^3.22.0"
47
+ },
48
+ "devDependencies": {
49
+ "@swc/cli": "^0.8.1",
50
+ "@swc/core": "^1.15.41",
51
+ "@types/jest": "^29.0.0",
52
+ "@types/node": "^20.0.0",
53
+ "jest": "^29.0.0",
54
+ "ts-jest": "^29.0.0",
55
+ "ts-node": "^10.9.0",
56
+ "typescript": "^5.0.0"
57
+ }
58
+ }