@talkspresso/mcp-server 1.2.0 → 1.3.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 +8 -0
- package/dist/client.js +40 -0
- package/dist/index.js +2 -2
- package/dist/tools/appointments.js +47 -33
- package/dist/tools/brew.js +12 -33
- package/dist/tools/calendar.js +3 -6
- package/dist/tools/clients.js +5 -12
- package/dist/tools/earnings.js +11 -14
- package/dist/tools/fileLibrary.js +8 -21
- package/dist/tools/googleCalendar.js +4 -9
- package/dist/tools/live.js +6 -15
- package/dist/tools/messaging.js +6 -15
- package/dist/tools/notifications.js +4 -9
- package/dist/tools/organization.js +8 -21
- package/dist/tools/prequalification.js +10 -27
- package/dist/tools/products.js +10 -27
- package/dist/tools/profile.js +25 -22
- package/dist/tools/promoCodes.js +8 -21
- package/dist/tools/recordings.js +9 -24
- package/dist/tools/services.js +8 -21
- package/dist/tools/subscription.js +5 -12
- package/dist/tools/testimonials.js +9 -24
- package/package.json +1 -1
package/dist/tools/messaging.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerMessagingTools(server, client) {
|
|
3
4
|
server.tool('list-conversations', 'Get all your message conversations with clients. Returns conversations sorted by most recent message.', {}, async () => {
|
|
4
5
|
const data = await client.get('/messaging/conversations', { userType: 'provider' });
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('get-conversation-messages', 'Get messages from a specific conversation. Returns the most recent messages in chronological order.', {
|
|
10
9
|
conversation_id: z.string().describe('The conversation ID'),
|
|
@@ -14,9 +13,7 @@ export function registerMessagingTools(server, client) {
|
|
|
14
13
|
if (params.limit)
|
|
15
14
|
queryParams.limit = String(params.limit);
|
|
16
15
|
const data = await client.get(`/messaging/conversations/${params.conversation_id}/messages`, queryParams);
|
|
17
|
-
return
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
19
|
-
};
|
|
16
|
+
return formatMcpResponse(data);
|
|
20
17
|
});
|
|
21
18
|
server.tool('send-message', 'Send a message to a client in an existing conversation. Use list-conversations first to find the conversation ID.', {
|
|
22
19
|
conversation_id: z.string().describe('The conversation ID'),
|
|
@@ -29,15 +26,11 @@ export function registerMessagingTools(server, client) {
|
|
|
29
26
|
senderName: params.sender_name,
|
|
30
27
|
message: params.message,
|
|
31
28
|
});
|
|
32
|
-
return
|
|
33
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
34
|
-
};
|
|
29
|
+
return formatMcpResponse(data);
|
|
35
30
|
});
|
|
36
31
|
server.tool('get-unread-message-count', 'Get the total number of unread messages across all conversations.', {}, async () => {
|
|
37
32
|
const data = await client.get('/messaging/unread-count', { userType: 'provider' });
|
|
38
|
-
return
|
|
39
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
40
|
-
};
|
|
33
|
+
return formatMcpResponse(data);
|
|
41
34
|
});
|
|
42
35
|
server.tool('mark-conversation-read', 'Mark all messages in a conversation as read.', {
|
|
43
36
|
conversation_id: z.string().describe('The conversation ID to mark as read'),
|
|
@@ -45,8 +38,6 @@ export function registerMessagingTools(server, client) {
|
|
|
45
38
|
const data = await client.post(`/messaging/conversations/${params.conversation_id}/read`, {
|
|
46
39
|
userType: 'provider',
|
|
47
40
|
});
|
|
48
|
-
return
|
|
49
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
50
|
-
};
|
|
41
|
+
return formatMcpResponse(data);
|
|
51
42
|
});
|
|
52
43
|
}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerNotificationTools(server, client) {
|
|
3
4
|
server.tool('list-notifications', 'Get all your notifications including new bookings, messages, and system alerts. Use this to check what needs your attention.', {
|
|
4
5
|
user_id: z.string().describe('Your user ID (get this from get-profile first)'),
|
|
5
6
|
}, async (params) => {
|
|
6
7
|
const data = await client.get(`/notification/${params.user_id}`);
|
|
7
|
-
return
|
|
8
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
9
|
-
};
|
|
8
|
+
return formatMcpResponse(data);
|
|
10
9
|
});
|
|
11
10
|
server.tool('mark-notification-read', 'Mark a single notification as read.', {
|
|
12
11
|
notification_id: z.string().describe('The notification ID to mark as read'),
|
|
13
12
|
}, async (params) => {
|
|
14
13
|
const data = await client.put(`/notification/${params.notification_id}/read`);
|
|
15
|
-
return
|
|
16
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
17
|
-
};
|
|
14
|
+
return formatMcpResponse(data);
|
|
18
15
|
});
|
|
19
16
|
server.tool('mark-all-notifications-read', 'Mark all your notifications as read. Use this to clear your notification count.', {}, async () => {
|
|
20
17
|
const data = await client.put('/notification/read-all');
|
|
21
|
-
return
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
18
|
+
return formatMcpResponse(data);
|
|
24
19
|
});
|
|
25
20
|
}
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerOrganizationTools(server, client) {
|
|
3
4
|
server.tool('list-my-organizations', 'Get organizations you are an admin or member of. Use this to see your org memberships.', {}, async () => {
|
|
4
5
|
const data = await client.get('/organization/my');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('get-organization', 'Get detailed information about a specific organization by ID.', {
|
|
10
9
|
id: z.string().describe('The organization ID'),
|
|
11
10
|
}, async (params) => {
|
|
12
11
|
const data = await client.get(`/organization/${params.id}`);
|
|
13
|
-
return
|
|
14
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
15
|
-
};
|
|
12
|
+
return formatMcpResponse(data);
|
|
16
13
|
});
|
|
17
14
|
server.tool('get-organization-members', 'Get all members of an organization. Use this to see who belongs to the org.', {
|
|
18
15
|
id: z.string().describe('The organization ID'),
|
|
19
16
|
}, async (params) => {
|
|
20
17
|
const data = await client.get(`/organization/${params.id}/members`);
|
|
21
|
-
return
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
18
|
+
return formatMcpResponse(data);
|
|
24
19
|
});
|
|
25
20
|
server.tool('get-organization-stats', 'Get statistics for an organization including member count, booking count, and revenue.', {
|
|
26
21
|
id: z.string().describe('The organization ID'),
|
|
27
22
|
}, async (params) => {
|
|
28
23
|
const data = await client.get(`/organization/${params.id}/stats`);
|
|
29
|
-
return
|
|
30
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
31
|
-
};
|
|
24
|
+
return formatMcpResponse(data);
|
|
32
25
|
});
|
|
33
26
|
server.tool('update-organization', 'Update organization settings like name, description, or branding.', {
|
|
34
27
|
id: z.string().describe('The organization ID to update'),
|
|
@@ -38,9 +31,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
38
31
|
}, async (params) => {
|
|
39
32
|
const { id, ...updateData } = params;
|
|
40
33
|
const data = await client.put(`/organization/${id}`, updateData);
|
|
41
|
-
return
|
|
42
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
43
|
-
};
|
|
34
|
+
return formatMcpResponse(data);
|
|
44
35
|
});
|
|
45
36
|
server.tool('add-organization-member', 'Add a new member to an organization.', {
|
|
46
37
|
id: z.string().describe('The organization ID'),
|
|
@@ -50,9 +41,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
50
41
|
}, async (params) => {
|
|
51
42
|
const { id, ...body } = params;
|
|
52
43
|
const data = await client.post(`/organization/${id}/members`, body);
|
|
53
|
-
return
|
|
54
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
55
|
-
};
|
|
44
|
+
return formatMcpResponse(data);
|
|
56
45
|
});
|
|
57
46
|
server.tool('send-organization-invitation', 'Send an invitation email to join an organization.', {
|
|
58
47
|
id: z.string().describe('The organization ID'),
|
|
@@ -61,8 +50,6 @@ export function registerOrganizationTools(server, client) {
|
|
|
61
50
|
}, async (params) => {
|
|
62
51
|
const { id, ...body } = params;
|
|
63
52
|
const data = await client.post(`/organization/${id}/invitations`, body);
|
|
64
|
-
return
|
|
65
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
66
|
-
};
|
|
53
|
+
return formatMcpResponse(data);
|
|
67
54
|
});
|
|
68
55
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerPrequalificationTools(server, client) {
|
|
3
4
|
server.tool('list-intake-questions', 'Get all your intake (prequalification) questions. These are shown to clients before booking or messaging you.', {}, async () => {
|
|
4
5
|
const data = await client.get('/prequalification/questions');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('create-intake-question', 'Create a new intake question for clients to answer before booking or messaging.', {
|
|
10
9
|
question: z.string().describe('The question text'),
|
|
@@ -16,9 +15,7 @@ export function registerPrequalificationTools(server, client) {
|
|
|
16
15
|
context: z.enum(['booking', 'messaging', 'both']).optional().describe('When to show: booking, messaging, or both (default both)'),
|
|
17
16
|
}, async (params) => {
|
|
18
17
|
const data = await client.post('/prequalification/questions', params);
|
|
19
|
-
return
|
|
20
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
21
|
-
};
|
|
18
|
+
return formatMcpResponse(data);
|
|
22
19
|
});
|
|
23
20
|
server.tool('update-intake-question', 'Update an existing intake question.', {
|
|
24
21
|
id: z.string().describe('The question ID to update'),
|
|
@@ -33,31 +30,23 @@ export function registerPrequalificationTools(server, client) {
|
|
|
33
30
|
}, async (params) => {
|
|
34
31
|
const { id, ...updateData } = params;
|
|
35
32
|
const data = await client.put(`/prequalification/questions/${id}`, updateData);
|
|
36
|
-
return
|
|
37
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
38
|
-
};
|
|
33
|
+
return formatMcpResponse(data);
|
|
39
34
|
});
|
|
40
35
|
server.tool('delete-intake-question', 'Delete an intake question.', {
|
|
41
36
|
id: z.string().describe('The question ID to delete'),
|
|
42
37
|
}, async (params) => {
|
|
43
38
|
const data = await client.delete(`/prequalification/questions/${params.id}`);
|
|
44
|
-
return
|
|
45
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
46
|
-
};
|
|
39
|
+
return formatMcpResponse(data);
|
|
47
40
|
});
|
|
48
41
|
server.tool('reorder-intake-questions', 'Reorder your intake questions by providing the question IDs in the desired order.', {
|
|
49
42
|
questionIds: z.array(z.string()).describe('Array of question IDs in the desired order'),
|
|
50
43
|
}, async (params) => {
|
|
51
44
|
const data = await client.put('/prequalification/questions/reorder', { questionIds: params.questionIds });
|
|
52
|
-
return
|
|
53
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
54
|
-
};
|
|
45
|
+
return formatMcpResponse(data);
|
|
55
46
|
});
|
|
56
47
|
server.tool('generate-intake-question-suggestions', 'Use AI to generate intake question suggestions based on your profile. Great for setting up intake forms quickly.', {}, async () => {
|
|
57
48
|
const data = await client.post('/prequalification/questions/ai-suggestions');
|
|
58
|
-
return
|
|
59
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
60
|
-
};
|
|
49
|
+
return formatMcpResponse(data);
|
|
61
50
|
});
|
|
62
51
|
server.tool('generate-service-intake-questions', 'Use AI to generate intake questions tailored to a specific service or course.', {
|
|
63
52
|
serviceTitle: z.string().describe('The title of the service'),
|
|
@@ -65,9 +54,7 @@ export function registerPrequalificationTools(server, client) {
|
|
|
65
54
|
sessionCount: z.number().optional().describe('Number of sessions in the package'),
|
|
66
55
|
}, async (params) => {
|
|
67
56
|
const data = await client.post('/prequalification/questions/generate-for-service', params);
|
|
68
|
-
return
|
|
69
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
70
|
-
};
|
|
57
|
+
return formatMcpResponse(data);
|
|
71
58
|
});
|
|
72
59
|
server.tool('get-client-intake-responses', 'Get a specific client\'s intake question responses. Use this to review what a client shared before their session.', {
|
|
73
60
|
client_id: z.string().describe('The client ID'),
|
|
@@ -80,16 +67,12 @@ export function registerPrequalificationTools(server, client) {
|
|
|
80
67
|
if (params.appointmentId)
|
|
81
68
|
queryParams.appointmentId = params.appointmentId;
|
|
82
69
|
const data = await client.get(`/prequalification/responses/client/${params.client_id}`, queryParams);
|
|
83
|
-
return
|
|
84
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
85
|
-
};
|
|
70
|
+
return formatMcpResponse(data);
|
|
86
71
|
});
|
|
87
72
|
server.tool('seed-default-intake-questions', 'Auto-generate and save default intake questions based on your profile. Useful for first-time setup.', {
|
|
88
73
|
force: z.boolean().optional().describe('Force re-seed even if questions already exist (default false)'),
|
|
89
74
|
}, async (params) => {
|
|
90
75
|
const data = await client.post('/prequalification/questions/seed-defaults', { force: params.force || false });
|
|
91
|
-
return
|
|
92
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
93
|
-
};
|
|
76
|
+
return formatMcpResponse(data);
|
|
94
77
|
});
|
|
95
78
|
}
|
package/dist/tools/products.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerProductTools(server, client) {
|
|
3
4
|
server.tool('list-products', 'Get all your digital products (downloads, video courses, bundles). Use this to see what you have for sale.', {}, async () => {
|
|
4
5
|
const data = await client.get('/product/me');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('get-product', 'Get detailed information about a specific product including files, pricing, and sales stats.', {
|
|
10
9
|
id: z.string().describe('The product ID'),
|
|
11
10
|
}, async (params) => {
|
|
12
11
|
const data = await client.get(`/product/${params.id}`);
|
|
13
|
-
return
|
|
14
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
15
|
-
};
|
|
12
|
+
return formatMcpResponse(data);
|
|
16
13
|
});
|
|
17
14
|
server.tool('create-product', 'Create a new digital product to sell on your profile. Supports downloads (PDFs, files), videos, and bundles.', {
|
|
18
15
|
title: z.string().describe('Product title'),
|
|
@@ -24,9 +21,7 @@ export function registerProductTools(server, client) {
|
|
|
24
21
|
keywords: z.array(z.string()).optional().describe('Keywords for SEO and discovery'),
|
|
25
22
|
}, async (params) => {
|
|
26
23
|
const data = await client.post('/product', params);
|
|
27
|
-
return
|
|
28
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
29
|
-
};
|
|
24
|
+
return formatMcpResponse(data);
|
|
30
25
|
});
|
|
31
26
|
server.tool('update-product', 'Update an existing product (title, price, description, status, etc.).', {
|
|
32
27
|
id: z.string().describe('The product ID to update'),
|
|
@@ -39,37 +34,27 @@ export function registerProductTools(server, client) {
|
|
|
39
34
|
}, async (params) => {
|
|
40
35
|
const { id, ...updateData } = params;
|
|
41
36
|
const data = await client.put(`/product/${id}`, updateData);
|
|
42
|
-
return
|
|
43
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
44
|
-
};
|
|
37
|
+
return formatMcpResponse(data);
|
|
45
38
|
});
|
|
46
39
|
server.tool('delete-product', 'Delete a product. This removes it from your store.', {
|
|
47
40
|
id: z.string().describe('The product ID to delete'),
|
|
48
41
|
}, async (params) => {
|
|
49
42
|
const data = await client.delete(`/product/${params.id}`);
|
|
50
|
-
return
|
|
51
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
52
|
-
};
|
|
43
|
+
return formatMcpResponse(data);
|
|
53
44
|
});
|
|
54
45
|
server.tool('get-product-analytics', 'Get analytics for your products including views, sales, and revenue. Use this to check how your products are performing.', {}, async () => {
|
|
55
46
|
const data = await client.get('/product/analytics');
|
|
56
|
-
return
|
|
57
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
58
|
-
};
|
|
47
|
+
return formatMcpResponse(data);
|
|
59
48
|
});
|
|
60
49
|
server.tool('list-product-purchases', 'Get all purchases across all your products. See who bought what and when.', {}, async () => {
|
|
61
50
|
const data = await client.get('/product/purchases');
|
|
62
|
-
return
|
|
63
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
64
|
-
};
|
|
51
|
+
return formatMcpResponse(data);
|
|
65
52
|
});
|
|
66
53
|
server.tool('get-product-purchases', 'Get purchases for a specific product. See who bought it.', {
|
|
67
54
|
product_id: z.string().describe('The product ID to get purchases for'),
|
|
68
55
|
}, async (params) => {
|
|
69
56
|
const data = await client.get(`/product/${params.product_id}/purchases`);
|
|
70
|
-
return
|
|
71
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
72
|
-
};
|
|
57
|
+
return formatMcpResponse(data);
|
|
73
58
|
});
|
|
74
59
|
server.tool('generate-product-details', 'Use AI to generate product title, description, keywords, and suggested price from a brief description. Great for quickly creating product listings.', {
|
|
75
60
|
description: z.string().describe('Brief description of what the product is about (at least 10 characters)'),
|
|
@@ -79,8 +64,6 @@ export function registerProductTools(server, client) {
|
|
|
79
64
|
description: params.description,
|
|
80
65
|
productType: params.product_type || 'download',
|
|
81
66
|
});
|
|
82
|
-
return
|
|
83
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
84
|
-
};
|
|
67
|
+
return formatMcpResponse(data);
|
|
85
68
|
});
|
|
86
69
|
}
|
package/dist/tools/profile.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerProfileTools(server, client) {
|
|
3
4
|
server.tool('get-profile', 'Get your Talkspresso profile information', {}, async () => {
|
|
4
5
|
const data = await client.get('/profile/me');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('update-profile', 'Update your Talkspresso profile', {
|
|
10
9
|
expert_title: z.string().optional().describe('Your professional title (e.g., "Executive Coach")'),
|
|
@@ -13,15 +12,23 @@ export function registerProfileTools(server, client) {
|
|
|
13
12
|
categories: z.array(z.string()).optional().describe('Array of category strings (e.g., ["coaching", "consulting"])'),
|
|
14
13
|
}, async (params) => {
|
|
15
14
|
const data = await client.put('/profile', params);
|
|
16
|
-
return
|
|
17
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
18
|
-
};
|
|
15
|
+
return formatMcpResponse(data);
|
|
19
16
|
});
|
|
20
17
|
server.tool('get-schedule', 'Get your upcoming schedule (next 50 appointments)', {}, async () => {
|
|
21
18
|
const data = await client.get('/appointments/me', { status: 'upcoming', limit: 50 });
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const appointments = Array.isArray(data) ? data : data?.appointments || data?.rows || [];
|
|
20
|
+
const trimmed = appointments.map((apt) => ({
|
|
21
|
+
id: apt.id,
|
|
22
|
+
status: apt.status,
|
|
23
|
+
start_time: apt.start_time,
|
|
24
|
+
end_time: apt.end_time,
|
|
25
|
+
duration: apt.duration,
|
|
26
|
+
client_name: apt.client?.name || apt.client_name,
|
|
27
|
+
client_email: apt.client?.email || apt.client_email,
|
|
28
|
+
service_title: apt.service?.title || apt.service_title,
|
|
29
|
+
is_complimentary: apt.is_complimentary,
|
|
30
|
+
}));
|
|
31
|
+
return formatMcpResponse(trimmed);
|
|
25
32
|
});
|
|
26
33
|
server.tool('get-booking-link', 'Get a shareable booking link for a specific service or your general booking page. Use this when you want to send someone a link to book with you.', {
|
|
27
34
|
service_id: z.string().optional().describe('Service ID for a specific service link. If omitted, returns your general booking page.'),
|
|
@@ -34,19 +41,15 @@ export function registerProfileTools(server, client) {
|
|
|
34
41
|
const service = (Array.isArray(services) ? services : services.services || [])
|
|
35
42
|
.find((s) => s.id === params.service_id);
|
|
36
43
|
const slug = service?.slug || params.service_id;
|
|
37
|
-
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, null, 2) }],
|
|
43
|
-
};
|
|
44
|
+
return formatMcpResponse({
|
|
45
|
+
booking_link: `${baseUrl}/${handle}/${slug}`,
|
|
46
|
+
general_link: `${baseUrl}/${handle}`,
|
|
47
|
+
service_title: service?.title || 'Unknown service',
|
|
48
|
+
});
|
|
44
49
|
}
|
|
45
|
-
return {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, null, 2) }],
|
|
50
|
-
};
|
|
50
|
+
return formatMcpResponse({
|
|
51
|
+
booking_link: `${baseUrl}/${handle}`,
|
|
52
|
+
handle,
|
|
53
|
+
});
|
|
51
54
|
});
|
|
52
55
|
}
|
package/dist/tools/promoCodes.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerPromoCodeTools(server, client) {
|
|
3
4
|
server.tool('list-promo-codes', 'Get all your promo codes including their status, usage count, and discount details. Use this to manage discounts and promotions.', {}, async () => {
|
|
4
5
|
const data = await client.get('/promo-code');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('get-promo-code', 'Get detailed information about a specific promo code including usage history.', {
|
|
10
9
|
id: z.string().describe('The promo code ID'),
|
|
11
10
|
}, async (params) => {
|
|
12
11
|
const data = await client.get(`/promo-code/${params.id}`);
|
|
13
|
-
return
|
|
14
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
15
|
-
};
|
|
12
|
+
return formatMcpResponse(data);
|
|
16
13
|
});
|
|
17
14
|
server.tool('create-promo-code', 'Create a new promo code for discounts on services or products. Use this to offer promotions to clients.', {
|
|
18
15
|
code: z.string().describe('The promo code string clients will enter (e.g., "WELCOME20")'),
|
|
@@ -24,9 +21,7 @@ export function registerPromoCodeTools(server, client) {
|
|
|
24
21
|
is_active: z.boolean().optional().describe('Whether the code is active (default true)'),
|
|
25
22
|
}, async (params) => {
|
|
26
23
|
const data = await client.post('/promo-code', params);
|
|
27
|
-
return
|
|
28
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
29
|
-
};
|
|
24
|
+
return formatMcpResponse(data);
|
|
30
25
|
});
|
|
31
26
|
server.tool('update-promo-code', 'Update an existing promo code settings.', {
|
|
32
27
|
id: z.string().describe('The promo code ID to update'),
|
|
@@ -39,30 +34,22 @@ export function registerPromoCodeTools(server, client) {
|
|
|
39
34
|
}, async (params) => {
|
|
40
35
|
const { id, ...updateData } = params;
|
|
41
36
|
const data = await client.put(`/promo-code/${id}`, updateData);
|
|
42
|
-
return
|
|
43
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
44
|
-
};
|
|
37
|
+
return formatMcpResponse(data);
|
|
45
38
|
});
|
|
46
39
|
server.tool('delete-promo-code', 'Permanently delete a promo code.', {
|
|
47
40
|
id: z.string().describe('The promo code ID to delete'),
|
|
48
41
|
}, async (params) => {
|
|
49
42
|
const data = await client.delete(`/promo-code/${params.id}`);
|
|
50
|
-
return
|
|
51
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
52
|
-
};
|
|
43
|
+
return formatMcpResponse(data);
|
|
53
44
|
});
|
|
54
45
|
server.tool('toggle-promo-code-active', 'Toggle a promo code between active and inactive without deleting it.', {
|
|
55
46
|
id: z.string().describe('The promo code ID to toggle'),
|
|
56
47
|
}, async (params) => {
|
|
57
48
|
const data = await client.post(`/promo-code/${params.id}/toggle-active`);
|
|
58
|
-
return
|
|
59
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
60
|
-
};
|
|
49
|
+
return formatMcpResponse(data);
|
|
61
50
|
});
|
|
62
51
|
server.tool('get-promo-code-analytics', 'Get analytics for all your promo codes including total usage, revenue impact, and top-performing codes.', {}, async () => {
|
|
63
52
|
const data = await client.get('/promo-code/analytics');
|
|
64
|
-
return
|
|
65
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
66
|
-
};
|
|
53
|
+
return formatMcpResponse(data);
|
|
67
54
|
});
|
|
68
55
|
}
|
package/dist/tools/recordings.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerRecordingTools(server, client) {
|
|
3
4
|
server.tool('list-recordings', 'Get all your session recordings. Returns the recording library with titles, durations, transcription status, and more. Use this to browse past session recordings.', {
|
|
4
5
|
page: z.number().optional().describe('Page number (default 1)'),
|
|
@@ -6,17 +7,13 @@ export function registerRecordingTools(server, client) {
|
|
|
6
7
|
visibility: z.enum(['all', 'private', 'unlisted', 'public']).optional().describe('Filter by visibility (default all)'),
|
|
7
8
|
}, async (params) => {
|
|
8
9
|
const data = await client.get('/recordings', params);
|
|
9
|
-
return
|
|
10
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
11
|
-
};
|
|
10
|
+
return formatMcpResponse(data);
|
|
12
11
|
});
|
|
13
12
|
server.tool('get-recording', 'Get detailed information about a specific recording including transcription, summary, key takeaways, and action items. Use this to review what happened in a past session.', {
|
|
14
13
|
id: z.string().describe('The recording ID'),
|
|
15
14
|
}, async (params) => {
|
|
16
15
|
const data = await client.get(`/recordings/${params.id}`);
|
|
17
|
-
return
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
19
|
-
};
|
|
16
|
+
return formatMcpResponse(data);
|
|
20
17
|
});
|
|
21
18
|
server.tool('update-recording', 'Update a recording title, description, or visibility setting.', {
|
|
22
19
|
id: z.string().describe('The recording ID to update'),
|
|
@@ -26,33 +23,25 @@ export function registerRecordingTools(server, client) {
|
|
|
26
23
|
}, async (params) => {
|
|
27
24
|
const { id, ...updateData } = params;
|
|
28
25
|
const data = await client.put(`/recordings/${id}`, updateData);
|
|
29
|
-
return
|
|
30
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
31
|
-
};
|
|
26
|
+
return formatMcpResponse(data);
|
|
32
27
|
});
|
|
33
28
|
server.tool('delete-recording', 'Permanently delete a recording. This cannot be undone.', {
|
|
34
29
|
id: z.string().describe('The recording ID to delete'),
|
|
35
30
|
}, async (params) => {
|
|
36
31
|
const data = await client.delete(`/recordings/${params.id}`);
|
|
37
|
-
return
|
|
38
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
39
|
-
};
|
|
32
|
+
return formatMcpResponse(data);
|
|
40
33
|
});
|
|
41
34
|
server.tool('get-client-recordings', 'Get all recordings from sessions with a specific client. Use this to review session history with a particular client.', {
|
|
42
35
|
client_id: z.string().describe('The client ID to get recordings for'),
|
|
43
36
|
}, async (params) => {
|
|
44
37
|
const data = await client.get(`/recordings/client/${params.client_id}`);
|
|
45
|
-
return
|
|
46
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
47
|
-
};
|
|
38
|
+
return formatMcpResponse(data);
|
|
48
39
|
});
|
|
49
40
|
server.tool('get-recording-files', 'Get individual participant recording files for a session (for editing workflows like Descript). Returns signed download URLs.', {
|
|
50
41
|
id: z.string().describe('The recording ID'),
|
|
51
42
|
}, async (params) => {
|
|
52
43
|
const data = await client.get(`/recordings/${params.id}/files`);
|
|
53
|
-
return
|
|
54
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
55
|
-
};
|
|
44
|
+
return formatMcpResponse(data);
|
|
56
45
|
});
|
|
57
46
|
server.tool('create-product-from-recording', 'Turn a session recording into a sellable digital product. Automatically generates title, description, and keywords from the recording summary.', {
|
|
58
47
|
id: z.string().describe('The recording ID to create a product from'),
|
|
@@ -63,14 +52,10 @@ export function registerRecordingTools(server, client) {
|
|
|
63
52
|
}, async (params) => {
|
|
64
53
|
const { id, ...body } = params;
|
|
65
54
|
const data = await client.post(`/recordings/${id}/create-product`, body);
|
|
66
|
-
return
|
|
67
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
68
|
-
};
|
|
55
|
+
return formatMcpResponse(data);
|
|
69
56
|
});
|
|
70
57
|
server.tool('retry-recording-transcription', 'Retry transcription and AI summary for recordings that failed or are stuck. Use this if a recording shows "failed" or "pending" transcription status.', {}, async () => {
|
|
71
58
|
const data = await client.post('/recordings/admin/retry-transcriptions');
|
|
72
|
-
return
|
|
73
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
74
|
-
};
|
|
59
|
+
return formatMcpResponse(data);
|
|
75
60
|
});
|
|
76
61
|
}
|
package/dist/tools/services.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { formatMcpResponse } from '../client.js';
|
|
2
3
|
export function registerServiceTools(server, client) {
|
|
3
4
|
server.tool('list-services', 'Get all your services (video calls, workshops, etc.)', {}, async () => {
|
|
4
5
|
const data = await client.get('/service/me');
|
|
5
|
-
return
|
|
6
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
7
|
-
};
|
|
6
|
+
return formatMcpResponse(data);
|
|
8
7
|
});
|
|
9
8
|
server.tool('create-service', 'Create a new service offering', {
|
|
10
9
|
title: z.string().describe('Service title'),
|
|
@@ -14,17 +13,13 @@ export function registerServiceTools(server, client) {
|
|
|
14
13
|
type: z.enum(['video_call', 'group_session', 'workshop', 'webinar']).describe('Type of service'),
|
|
15
14
|
}, async (params) => {
|
|
16
15
|
const data = await client.post('/service', params);
|
|
17
|
-
return
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
19
|
-
};
|
|
16
|
+
return formatMcpResponse(data);
|
|
20
17
|
});
|
|
21
18
|
server.tool('get-service', 'Get detailed information about a specific service including pricing, duration, and logistics.', {
|
|
22
19
|
id: z.string().describe('The service ID'),
|
|
23
20
|
}, async (params) => {
|
|
24
21
|
const data = await client.get(`/service/${params.id}`);
|
|
25
|
-
return
|
|
26
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
27
|
-
};
|
|
22
|
+
return formatMcpResponse(data);
|
|
28
23
|
});
|
|
29
24
|
server.tool('update-service', 'Update an existing service', {
|
|
30
25
|
id: z.string().describe('Service ID to update'),
|
|
@@ -36,32 +31,24 @@ export function registerServiceTools(server, client) {
|
|
|
36
31
|
}, async (params) => {
|
|
37
32
|
const { id, ...updateData } = params;
|
|
38
33
|
const data = await client.put(`/service/${id}`, updateData);
|
|
39
|
-
return
|
|
40
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
41
|
-
};
|
|
34
|
+
return formatMcpResponse(data);
|
|
42
35
|
});
|
|
43
36
|
server.tool('delete-service', 'Delete a service from your profile. This cannot be undone.', {
|
|
44
37
|
id: z.string().describe('The service ID to delete'),
|
|
45
38
|
}, async (params) => {
|
|
46
39
|
const data = await client.delete(`/service/${params.id}`);
|
|
47
|
-
return
|
|
48
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
49
|
-
};
|
|
40
|
+
return formatMcpResponse(data);
|
|
50
41
|
});
|
|
51
42
|
server.tool('duplicate-service', 'Create a copy of an existing service. Useful for creating variations of popular services.', {
|
|
52
43
|
id: z.string().describe('The service ID to duplicate'),
|
|
53
44
|
}, async (params) => {
|
|
54
45
|
const data = await client.post(`/service/${params.id}/duplicate`);
|
|
55
|
-
return
|
|
56
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
57
|
-
};
|
|
46
|
+
return formatMcpResponse(data);
|
|
58
47
|
});
|
|
59
48
|
server.tool('get-service-bookings', 'Get all bookings for a specific service. See who has booked and upcoming sessions.', {
|
|
60
49
|
id: z.string().describe('The service ID'),
|
|
61
50
|
}, async (params) => {
|
|
62
51
|
const data = await client.get(`/service/${params.id}/bookings`);
|
|
63
|
-
return
|
|
64
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
65
|
-
};
|
|
52
|
+
return formatMcpResponse(data);
|
|
66
53
|
});
|
|
67
54
|
}
|