@ftservices/customer-mcp 0.0.0-stage → 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.
- package/dist/Config.js +42 -0
- package/dist/ConfirmText.js +28 -0
- package/dist/CustomerServer.js +122 -0
- package/dist/FtClient.js +69 -0
- package/dist/Targets.js +153 -0
- package/dist/Tools.js +216 -0
- package/dist/main.js +14 -0
- package/npm-shrinkwrap.json +1623 -0
- package/package.json +32 -4
- package/README.md +0 -3
package/dist/Tools.js
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** FT's IDs are ULIDs as FT writes them (26 characters, lower case). */
|
|
3
|
+
export const ID_SHAPE = /^[0-9a-hjkmnp-tv-z]{26}$/;
|
|
4
|
+
export const id = (what) => z.string().regex(ID_SHAPE, 'an FT ID: 26 letters and digits').describe(what);
|
|
5
|
+
const text = (most) => z.string().max(most);
|
|
6
|
+
const required = (most) => z.string().trim().min(1).max(most);
|
|
7
|
+
const cursor = z.string().max(500).optional().describe('The meta.next value of an earlier answer, for the next page');
|
|
8
|
+
const flag = z.boolean();
|
|
9
|
+
const date = z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'a date as YYYY-MM-DD');
|
|
10
|
+
const instant = z.string().max(40).describe('A date and time in ISO 8601, e.g. 2026-11-21T14:30:00+04:00');
|
|
11
|
+
const custom = z.record(z.string().max(100), z.union([z.string().max(5000), z.number(), z.boolean(), z.null()])).describe('Custom field values by field key');
|
|
12
|
+
const values = z.array(text(500)).max(20).optional().describe('The template\'s placeholder values, in order');
|
|
13
|
+
const basedOn = z.number().int().min(0).describe('The draft number you last read (get_ai_agent draft.number), 0 when there is no draft');
|
|
14
|
+
const contactFields = {
|
|
15
|
+
name: text(255).nullable().optional(),
|
|
16
|
+
phone: text(40).nullable().optional().describe('With the country code, e.g. +971501234567'),
|
|
17
|
+
email: z.email().max(254).nullable().optional(),
|
|
18
|
+
company_id: id('The company').nullable().optional(),
|
|
19
|
+
owner_user_id: id('The team member who owns the contact (list_team)').nullable().optional(),
|
|
20
|
+
language: z.enum(['en', 'ar']).nullable().optional(),
|
|
21
|
+
tags: z.array(text(50)).max(50).optional(),
|
|
22
|
+
custom: custom.optional(),
|
|
23
|
+
};
|
|
24
|
+
const dealFields = {
|
|
25
|
+
contact_id: id('The contact').nullable().optional(),
|
|
26
|
+
company_id: id('The company').nullable().optional(),
|
|
27
|
+
pipeline_id: id('The pipeline').optional(),
|
|
28
|
+
stage_id: id('The stage').optional(),
|
|
29
|
+
value_minor: z.number().int().min(0).optional().describe('The deal\'s value in the smallest unit of its currency (fils, cents)'),
|
|
30
|
+
currency: z.string().regex(/^[A-Z]{3}$/).optional(),
|
|
31
|
+
owner_user_id: id('The team member who owns the deal').nullable().optional(),
|
|
32
|
+
expected_close_on: date.nullable().optional(),
|
|
33
|
+
custom: custom.optional(),
|
|
34
|
+
};
|
|
35
|
+
const taskFields = {
|
|
36
|
+
due_at: instant.nullable().optional(),
|
|
37
|
+
remind_at: instant.nullable().optional(),
|
|
38
|
+
assigned_user_id: id('The team member doing it').nullable().optional(),
|
|
39
|
+
contact_id: id('The contact').nullable().optional(),
|
|
40
|
+
deal_id: id('The deal').nullable().optional(),
|
|
41
|
+
};
|
|
42
|
+
const chat = { chat: 'The chat' };
|
|
43
|
+
const contact = { contact: 'The contact' };
|
|
44
|
+
const deal = { deal: 'The deal' };
|
|
45
|
+
const task = { task: 'The task' };
|
|
46
|
+
const number = { number: 'The WhatsApp number the AI agent answers on (list_numbers)' };
|
|
47
|
+
const appointment = { appointment: 'The appointment' };
|
|
48
|
+
/**
|
|
49
|
+
* Every tool. Each reads or changes one thing in the signed-in user's own FT account, through the same API the
|
|
50
|
+
* dashboard uses, so FT checks the user's role on every call. Anything but GET asks the user to confirm first.
|
|
51
|
+
* Left out on purpose: payments and billing, the account's security (sign-in, sessions, devices, team, keys), closing
|
|
52
|
+
* the account, connecting WhatsApp numbers, AI vendor keys and tool secrets, and file uploads.
|
|
53
|
+
*/
|
|
54
|
+
export const TOOLS = [
|
|
55
|
+
{ name: 'whoami', title: 'Who am I', description: 'The signed-in user (name, role, language) and what they may do.', method: 'GET', path: 'me' },
|
|
56
|
+
{ name: 'list_numbers', title: 'WhatsApp numbers', description: 'The account\'s WhatsApp numbers this user may see.', method: 'GET', path: 'numbers' },
|
|
57
|
+
{ name: 'list_team', title: 'Team directory', description: 'The team\'s names, IDs and levels (for assigning chats, tasks and deals).', method: 'GET', path: 'team/directory' },
|
|
58
|
+
{
|
|
59
|
+
name: 'list_notifications', title: 'Notifications', description: 'The user\'s notifications, newest first.', method: 'GET', path: 'notifications',
|
|
60
|
+
query: { unread: flag.optional(), group: z.enum(['chats', 'ai', 'templates', 'support', 'account']).optional(), cursor },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'list_chats', title: 'Chats', description: 'Inbox chats, newest first, with filters.', method: 'GET', path: 'chats',
|
|
64
|
+
query: {
|
|
65
|
+
status: z.enum(['waiting', 'open', 'closed']).optional(), number_id: id('Only this number\'s chats').optional(),
|
|
66
|
+
assigned: z.string().max(26).optional().describe('"me", "none" or a team member\'s ID'), handler: z.enum(['ai', 'human']).optional(),
|
|
67
|
+
contact_id: id('Only this contact\'s chats').optional(), cursor,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{ name: 'get_chat', title: 'Chat and messages', description: 'One chat with its contact card, messages and notes (a page at a time).', method: 'GET', path: 'chats/{chat}', ids: chat, query: { cursor } },
|
|
71
|
+
{
|
|
72
|
+
name: 'reply_to_chat', title: 'Send a reply', description: 'Sends a WhatsApp reply in a chat: text inside the 24-hour window, or an approved template.', method: 'POST', path: 'chats/{chat}/reply', ids: chat, appRef: true,
|
|
73
|
+
body: { type: z.enum(['text', 'template']).optional(), body: text(4096).optional().describe('The text to send'), template_id: id('An approved template (list_templates)').optional(), values },
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'start_chat', title: 'Start a chat', description: 'Starts a WhatsApp conversation with a contact by sending an approved template.', method: 'POST', path: 'chats', appRef: true,
|
|
77
|
+
body: { contact_id: id('The contact'), number_id: id('The number to send from'), template_id: id('An approved template'), values },
|
|
78
|
+
},
|
|
79
|
+
{ name: 'claim_chat', title: 'Claim a chat', description: 'Takes a waiting chat for yourself.', method: 'POST', path: 'chats/{chat}/claim', ids: chat },
|
|
80
|
+
{ name: 'release_chat', title: 'Release a chat', description: 'Gives a chat you hold back to the waiting list.', method: 'POST', path: 'chats/{chat}/release', ids: chat },
|
|
81
|
+
{ name: 'reassign_chat', title: 'Reassign a chat', description: 'Gives a chat to another team member.', method: 'POST', path: 'chats/{chat}/reassign', ids: chat, body: { user_id: id('The team member (list_team)') } },
|
|
82
|
+
{ name: 'close_chat', title: 'Close a chat', description: 'Closes a chat.', method: 'POST', path: 'chats/{chat}/close', ids: chat },
|
|
83
|
+
{ name: 'mark_chat_read', title: 'Mark a chat read', description: 'Marks a chat\'s messages read.', method: 'POST', path: 'chats/{chat}/mark-read', ids: chat },
|
|
84
|
+
{ name: 'hand_chat_back_to_ai', title: 'Hand a chat back to the AI', description: 'Lets the AI agent answer this chat again.', method: 'POST', path: 'chats/{chat}/hand-back-to-ai', ids: chat },
|
|
85
|
+
{ name: 'add_chat_note', title: 'Add a chat note', description: 'An internal note on a chat; the customer never sees it.', method: 'POST', path: 'chats/{chat}/notes', ids: chat, body: { body: required(4000) } },
|
|
86
|
+
{
|
|
87
|
+
name: 'search_contacts', title: 'Search contacts', description: 'Contacts by name, phone, email or tag.', method: 'GET', path: 'contacts',
|
|
88
|
+
query: { q: text(100).optional(), tag: text(50).optional(), owner_user_id: id('Only this owner\'s contacts').optional(), company_id: id('Only this company\'s contacts').optional(), deleted: flag.optional(), cursor },
|
|
89
|
+
},
|
|
90
|
+
{ name: 'get_contact', title: 'Contact', description: 'One contact\'s card.', method: 'GET', path: 'contacts/{contact}', ids: contact },
|
|
91
|
+
{ name: 'get_contact_timeline', title: 'Contact timeline', description: 'Everything that happened with a contact, newest first.', method: 'GET', path: 'contacts/{contact}/timeline', ids: contact, query: { cursor } },
|
|
92
|
+
{ name: 'create_contact', title: 'Create a contact', description: 'Adds a contact.', method: 'POST', path: 'contacts', body: contactFields },
|
|
93
|
+
{ name: 'update_contact', title: 'Edit a contact', description: 'Changes the fields given; the others stay.', method: 'PATCH', path: 'contacts/{contact}', ids: contact, body: contactFields },
|
|
94
|
+
{ name: 'delete_contact', title: 'Delete a contact', description: 'Moves a contact to the bin.', method: 'DELETE', path: 'contacts/{contact}', ids: contact },
|
|
95
|
+
{ name: 'add_contact_note', title: 'Add a contact note', description: 'An internal note on a contact.', method: 'POST', path: 'contacts/{contact}/notes', ids: contact, body: { body: required(10000) } },
|
|
96
|
+
{
|
|
97
|
+
name: 'set_contact_consent', title: 'Set marketing consent', description: 'Records that a contact opted in to, or out of, WhatsApp or email marketing.', method: 'POST', path: 'contacts/{contact}/consent', ids: contact,
|
|
98
|
+
body: { channel: z.enum(['whatsapp', 'email']), in: z.boolean().describe('true: opted in; false: opted out') },
|
|
99
|
+
},
|
|
100
|
+
{ name: 'search_companies', title: 'Search companies', description: 'Companies by name.', method: 'GET', path: 'companies', query: { q: text(100).optional(), deleted: flag.optional(), cursor } },
|
|
101
|
+
{ name: 'get_company', title: 'Company', description: 'One company.', method: 'GET', path: 'companies/{company}', ids: { company: 'The company' } },
|
|
102
|
+
{ name: 'create_company', title: 'Create a company', description: 'Adds a company.', method: 'POST', path: 'companies', body: { name: required(255), domain: text(255).nullable().optional(), custom: custom.optional() } },
|
|
103
|
+
{
|
|
104
|
+
name: 'update_company', title: 'Edit a company', description: 'Changes the fields given; the others stay.', method: 'PATCH', path: 'companies/{company}', ids: { company: 'The company' },
|
|
105
|
+
body: { name: required(255).optional(), domain: text(255).nullable().optional(), custom: custom.optional() },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'list_deals', title: 'Deals', description: 'Deals, with filters.', method: 'GET', path: 'deals',
|
|
109
|
+
query: { pipeline_id: id('The pipeline').optional(), stage_id: id('The stage').optional(), owner_user_id: id('The owner').optional(), contact_id: id('The contact').optional(), open: flag.optional(), deleted: flag.optional(), cursor },
|
|
110
|
+
},
|
|
111
|
+
{ name: 'get_deal', title: 'Deal', description: 'One deal with its stage, value and contact.', method: 'GET', path: 'deals/{deal}', ids: deal },
|
|
112
|
+
{ name: 'get_crm_setup', title: 'Pipelines and fields', description: 'The deal pipelines with their stages, and the custom fields of contacts, companies and deals.', method: 'GET', path: 'crm-setup' },
|
|
113
|
+
{ name: 'create_deal', title: 'Create a deal', description: 'Adds a deal in a pipeline (get_crm_setup).', method: 'POST', path: 'deals', body: { title: required(255), ...dealFields, pipeline_id: id('The pipeline (get_crm_setup)') } },
|
|
114
|
+
{ name: 'update_deal', title: 'Edit a deal', description: 'Changes the fields given; the others stay.', method: 'PATCH', path: 'deals/{deal}', ids: deal, body: { title: required(255).optional(), ...dealFields } },
|
|
115
|
+
{ name: 'move_deal', title: 'Move a deal', description: 'Moves a deal to another stage.', method: 'POST', path: 'deals/{deal}/move', ids: deal, body: { stage_id: id('The stage') } },
|
|
116
|
+
{ name: 'win_deal', title: 'Mark a deal won', description: 'Marks a deal won.', method: 'POST', path: 'deals/{deal}/win', ids: deal },
|
|
117
|
+
{ name: 'lose_deal', title: 'Mark a deal lost', description: 'Marks a deal lost, with an optional reason.', method: 'POST', path: 'deals/{deal}/lose', ids: deal, body: { reason: text(255).nullable().optional() } },
|
|
118
|
+
{
|
|
119
|
+
name: 'list_tasks', title: 'Tasks', description: 'Tasks and reminders.', method: 'GET', path: 'tasks',
|
|
120
|
+
query: { mine: flag.optional(), open: flag.optional(), contact_id: id('The contact').optional(), deal_id: id('The deal').optional(), cursor },
|
|
121
|
+
},
|
|
122
|
+
{ name: 'get_task', title: 'Task', description: 'One task with its contact, deal and person.', method: 'GET', path: 'tasks/{task}', ids: task },
|
|
123
|
+
{ name: 'create_task', title: 'Create a task', description: 'Adds a task or reminder.', method: 'POST', path: 'tasks', body: { title: required(255), ...taskFields } },
|
|
124
|
+
{ name: 'update_task', title: 'Edit a task', description: 'Changes the fields given; the others stay.', method: 'PATCH', path: 'tasks/{task}', ids: task, body: { title: required(255).optional(), ...taskFields } },
|
|
125
|
+
{ name: 'complete_task', title: 'Complete a task', description: 'Marks a task done.', method: 'POST', path: 'tasks/{task}/complete', ids: task },
|
|
126
|
+
{ name: 'list_calendar_entries', title: 'Calendar', description: 'Appointments and busy times between two dates.', method: 'GET', path: 'calendar/entries', query: { from: date, to: date } },
|
|
127
|
+
{ name: 'list_calendar_members', title: 'Calendar members', description: 'The team members who take appointments.', method: 'GET', path: 'calendar/members' },
|
|
128
|
+
{ name: 'get_appointment', title: 'Appointment', description: 'One appointment or busy time (another member\'s shows as busy time to Staff).', method: 'GET', path: 'calendar/appointments/{appointment}', ids: appointment },
|
|
129
|
+
{
|
|
130
|
+
name: 'book_appointment', title: 'Book an appointment', description: 'Books an appointment with a contact; FT sends the contact the invitation.', method: 'POST', path: 'calendar/appointments',
|
|
131
|
+
body: {
|
|
132
|
+
member_id: id('The calendar member (list_calendar_members)'), contact_id: id('The contact'), deal_id: id('The deal').nullable().optional(), starts_at: instant,
|
|
133
|
+
title: text(255).nullable().optional(), location: text(500).nullable().optional(), notes: text(5000).nullable().optional(),
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: 'reschedule_appointment', title: 'Reschedule an appointment', description: 'Moves an appointment to a new time.', method: 'POST', path: 'calendar/appointments/{appointment}/reschedule', ids: appointment,
|
|
138
|
+
body: { version: z.number().int().min(1).describe('The appointment\'s version as last read'), starts_at: instant, member_id: id('Another calendar member').nullable().optional() },
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'cancel_appointment', title: 'Cancel an appointment', description: 'Cancels an appointment; FT tells the contact.', method: 'POST', path: 'calendar/appointments/{appointment}/cancel', ids: appointment,
|
|
142
|
+
body: { version: z.number().int().min(1).describe('The appointment\'s version as last read') },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'list_templates', title: 'Message templates', description: 'The account\'s WhatsApp message templates and their status.', method: 'GET', path: 'templates',
|
|
146
|
+
query: { status: text(20).optional(), category: text(20).optional(), language: text(10).optional() },
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'browse_template_library', title: 'Template library', description: 'Meta\'s ready-made templates.', method: 'GET', path: 'templates/library',
|
|
150
|
+
query: { search: text(100).optional(), topic: text(50).optional(), usecase: text(50).optional(), industry: text(50).optional(), language: text(10).optional() },
|
|
151
|
+
},
|
|
152
|
+
{ name: 'get_template_history', title: 'Template history', description: 'A template\'s review history.', method: 'GET', path: 'templates/{template}/history', ids: { template: 'The template' } },
|
|
153
|
+
{
|
|
154
|
+
name: 'create_template', title: 'Create a template', description: 'Sends a new WhatsApp template to Meta for review.', method: 'POST', path: 'templates',
|
|
155
|
+
body: {
|
|
156
|
+
name: required(512), language: required(10), category: required(20), header: text(200).nullable().optional(), body: required(2000), footer: text(200).nullable().optional(),
|
|
157
|
+
buttons: z.array(z.record(z.string().max(50), z.unknown())).max(20).nullable().optional(), samples: z.array(text(200)).max(20).nullable().optional(),
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'add_template_from_library', title: 'Add a library template', description: 'Adds one of Meta\'s ready-made templates to the account.', method: 'POST', path: 'templates/library',
|
|
162
|
+
body: { library_name: required(512), language: required(10), category: required(20), name: required(512) },
|
|
163
|
+
},
|
|
164
|
+
{ name: 'get_ai_agent', title: 'AI agent', description: 'The AI agent of a WhatsApp number: its published version and its draft.', method: 'GET', path: 'numbers/{number}/agent', ids: number },
|
|
165
|
+
{ name: 'get_ai_agent_by_id', title: 'AI agent by ID', description: 'An AI agent by its own ID (as the knowledge tools name it).', method: 'GET', path: 'agents/{agent}', ids: { agent: 'The AI agent' } },
|
|
166
|
+
{ name: 'list_ai_agent_versions', title: 'AI agent versions', description: 'Every version of an AI agent, newest first.', method: 'GET', path: 'numbers/{number}/agent/versions', ids: number },
|
|
167
|
+
{
|
|
168
|
+
name: 'build_ai_agent', title: 'Build an AI agent', description: 'Writes a new AI agent draft from a short description of the business (the dashboard\'s wizard). Publish it to make it live.', method: 'POST', path: 'numbers/{number}/agent/wizard', ids: number,
|
|
169
|
+
body: { based_on: basedOn, business: required(5000), tone: required(200), handles: z.array(text(200)).max(20), handover: z.array(text(200)).max(20) },
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'edit_ai_agent', title: 'Edit an AI agent', description: 'Changes the AI agent\'s draft: instructions, hand-over rules, wait and tools. Publish it to make it live.', method: 'PATCH', path: 'numbers/{number}/agent', ids: number,
|
|
173
|
+
body: {
|
|
174
|
+
based_on: basedOn, instructions: text(20000).nullable().optional(), handover_rules: z.array(text(500)).max(20).optional(),
|
|
175
|
+
wait_seconds: z.number().int().min(0).max(120).nullable().optional(), resume_after_hours: z.number().int().min(1).max(720).nullable().optional(),
|
|
176
|
+
tool_keys: z.array(text(100)).optional().describe('The AI tools the agent uses (list_ai_tools)'),
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{ name: 'publish_ai_agent', title: 'Publish an AI agent', description: 'Makes the draft the live version.', method: 'POST', path: 'numbers/{number}/agent/publish', ids: number, body: { based_on: basedOn } },
|
|
180
|
+
{ name: 'enable_ai_agent', title: 'Turn an AI agent on', description: 'The AI agent starts answering.', method: 'POST', path: 'numbers/{number}/agent/enable', ids: number },
|
|
181
|
+
{ name: 'disable_ai_agent', title: 'Turn an AI agent off', description: 'The AI agent stops answering; chats go to people.', method: 'POST', path: 'numbers/{number}/agent/disable', ids: number },
|
|
182
|
+
{
|
|
183
|
+
name: 'set_ai_agent_hours', title: 'AI agent hours', description: 'When the AI agent answers.', method: 'POST', path: 'numbers/{number}/agent/hours', ids: number,
|
|
184
|
+
body: {
|
|
185
|
+
based_on: basedOn,
|
|
186
|
+
days: z.array(z.strictObject({ day: z.enum(['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']), from: z.string().regex(/^\d{2}:\d{2}$/), to: z.string().regex(/^\d{2}:\d{2}$/) })).max(21),
|
|
187
|
+
outside_hours_only: z.boolean().describe('true: the agent answers only outside these hours'),
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'rollback_ai_agent', title: 'Roll back an AI agent', description: 'Goes back to an earlier published version.', method: 'POST', path: 'numbers/{number}/agent/rollback', ids: number,
|
|
192
|
+
body: { to: z.number().int().min(1).describe('The version number'), knowledge: z.enum(['back', 'current']).describe('back: that version\'s knowledge; current: the knowledge as it is now'), based_on: z.number().int().min(0).describe('The published version number you last read') },
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'test_ai_agent', title: 'Test an AI agent', description: 'Asks the AI agent\'s draft a question, as a customer would; nothing is sent to anyone. Uses AI credit.', method: 'POST', path: 'numbers/{number}/agent/test-chat', ids: number,
|
|
196
|
+
body: { text: required(4000), history: z.array(z.strictObject({ role: z.enum(['user', 'assistant']), content: required(4000) })).max(20).optional() },
|
|
197
|
+
},
|
|
198
|
+
{ name: 'list_ai_knowledge', title: 'AI knowledge', description: 'The knowledge an AI agent answers from.', method: 'GET', path: 'agents/{agent}/knowledge', ids: { agent: 'The AI agent (get_ai_agent id)' } },
|
|
199
|
+
{
|
|
200
|
+
name: 'add_ai_knowledge', title: 'Add AI knowledge', description: 'Adds a web page or questions and answers to an AI agent\'s knowledge.', method: 'POST', path: 'agents/{agent}/knowledge', ids: { agent: 'The AI agent (get_ai_agent id)' },
|
|
201
|
+
body: {
|
|
202
|
+
type: z.enum(['page', 'qa']), title: required(255), url: z.url({ protocol: /^https?$/ }).max(1000).optional().describe('For type page'),
|
|
203
|
+
qa: z.array(z.strictObject({ q: required(1000), a: required(4000) })).max(500).optional().describe('For type qa'),
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{ name: 'get_ai_knowledge_source', title: 'AI knowledge source', description: 'One knowledge source of an AI agent.', method: 'GET', path: 'knowledge/{source}', ids: { source: 'The knowledge source' } },
|
|
207
|
+
{ name: 'remove_ai_knowledge', title: 'Remove AI knowledge', description: 'Takes a knowledge source out of the AI agent.', method: 'DELETE', path: 'knowledge/{source}', ids: { source: 'The knowledge source' } },
|
|
208
|
+
{ name: 'list_ai_tools', title: 'AI tools', description: 'The AI tools the account has and whether each is set up and allowed.', method: 'GET', path: 'ai/tools' },
|
|
209
|
+
{
|
|
210
|
+
name: 'list_tickets', title: 'Support tickets', description: 'The account\'s support tickets with FT.', method: 'GET', path: 'tickets',
|
|
211
|
+
query: { status: z.enum(['open', 'in_progress', 'waiting_for_client', 'solved']).optional(), cursor },
|
|
212
|
+
},
|
|
213
|
+
{ name: 'get_ticket', title: 'Support ticket', description: 'One support ticket with its messages.', method: 'GET', path: 'tickets/{ticket}', ids: { ticket: 'The ticket' } },
|
|
214
|
+
{ name: 'open_ticket', title: 'Open a support ticket', description: 'Asks FT\'s support team for help.', method: 'POST', path: 'tickets', body: { subject: required(200), body: required(20000) } },
|
|
215
|
+
{ name: 'reply_to_ticket', title: 'Reply to a ticket', description: 'Writes to FT\'s support team on a ticket.', method: 'POST', path: 'tickets/{ticket}/reply', ids: { ticket: 'The ticket' }, body: { body: required(20000) } },
|
|
216
|
+
];
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { Config } from './Config.js';
|
|
4
|
+
import { CustomerServer } from './CustomerServer.js';
|
|
5
|
+
import { FtClient } from './FtClient.js';
|
|
6
|
+
/** Starts the FT customer MCP on stdio; a missing or wrong setting stops it before it serves anything. */
|
|
7
|
+
class CustomerMain {
|
|
8
|
+
static async run(env) {
|
|
9
|
+
const config = Config.fromEnv(env);
|
|
10
|
+
const client = new FtClient(config.baseUrl, config.key, (url, init) => fetch(url, init));
|
|
11
|
+
await new CustomerServer(client).connect(new StdioServerTransport());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
await CustomerMain.run(process.env);
|