@omnidim-ai/mcp-server 0.18.1 → 0.19.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/README.md +6 -0
- package/build/docs-tools.d.ts +12 -0
- package/build/docs-tools.js +105 -0
- package/build/docs-tools.js.map +1 -0
- package/build/helpers.js +39 -7
- package/build/helpers.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +34 -16
- package/build/index.js.map +1 -1
- package/build/telemetry.d.ts +1 -0
- package/build/telemetry.js +12 -1
- package/build/telemetry.js.map +1 -1
- package/build/tool-annotations.d.ts +5 -0
- package/build/tool-annotations.js +19 -159
- package/build/tool-annotations.js.map +1 -1
- package/build/tool-marks.d.ts +2 -0
- package/build/tool-marks.js +621 -0
- package/build/tool-marks.js.map +1 -0
- package/package.json +2 -1
- package/src/docs-tools.ts +109 -0
- package/src/helpers.ts +39 -8
- package/src/index.ts +31 -15
- package/src/telemetry.ts +15 -1
- package/src/tool-annotations.ts +22 -162
- package/src/tool-marks.ts +623 -0
package/src/tool-annotations.ts
CHANGED
|
@@ -1,154 +1,8 @@
|
|
|
1
1
|
// MCP tool annotations: a display title plus read-only / destructive /
|
|
2
2
|
// open-world hints, so clients can parallelize reads and confirm before
|
|
3
|
-
// destructive or real-world actions.
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
// Human-readable display names, separate from the machine `name` the model sees.
|
|
7
|
-
const TOOL_TITLES: Record<string, string> = {
|
|
8
|
-
listAgents: "List agents",
|
|
9
|
-
createAgent: "Create agent",
|
|
10
|
-
getAgent: "Get agent",
|
|
11
|
-
updateAgent: "Update agent",
|
|
12
|
-
deleteAgent: "Delete agent",
|
|
13
|
-
listAgentVersions: "List agent versions",
|
|
14
|
-
createAgentVersion: "Save agent version",
|
|
15
|
-
diffAgentVersion: "Diff agent version",
|
|
16
|
-
restoreAgentVersion: "Restore agent version",
|
|
17
|
-
renameAgentVersion: "Rename agent version",
|
|
18
|
-
deleteAgentVersion: "Delete agent version",
|
|
19
|
-
createSession: "Create voice session",
|
|
20
|
-
dispatchCall: "Dispatch call",
|
|
21
|
-
listCallLogs: "List call logs",
|
|
22
|
-
getCallLog: "Get call log",
|
|
23
|
-
fetchBulkCalls: "List bulk campaigns",
|
|
24
|
-
createBulkCall: "Create bulk campaign",
|
|
25
|
-
addBulkCallContact: "Add contact to campaign",
|
|
26
|
-
getBulkCall: "Get bulk campaign",
|
|
27
|
-
bulkCallActions: "Control bulk campaign",
|
|
28
|
-
cancelBulkCall: "Cancel bulk campaign",
|
|
29
|
-
getBulkCallLiveStatus: "Get campaign live status",
|
|
30
|
-
startBulkCall: "Start draft campaign",
|
|
31
|
-
addBulkCallContacts: "Add contacts to campaign",
|
|
32
|
-
retryBulkCall: "Retry unconnected contacts",
|
|
33
|
-
setBulkCallConcurrency: "Set campaign concurrency",
|
|
34
|
-
setBulkCallDailyTimeControl: "Set campaign calling hours",
|
|
35
|
-
listBulkCallLines: "List campaign call results",
|
|
36
|
-
listBulkCallNumbers: "List campaign number pool",
|
|
37
|
-
addBulkCallNumber: "Add number to campaign pool",
|
|
38
|
-
setBulkCallNumberActive: "Pause or resume pool number",
|
|
39
|
-
listKnowledgeBaseFiles: "List knowledge base files",
|
|
40
|
-
canUploadFile: "Check file upload eligibility",
|
|
41
|
-
uploadKnowledgeBaseFile: "Upload knowledge base file",
|
|
42
|
-
attachKnowledgeBaseFiles: "Attach knowledge base files",
|
|
43
|
-
detachKnowledgeBaseFiles: "Detach knowledge base files",
|
|
44
|
-
deleteKnowledgeBaseFile: "Delete knowledge base file",
|
|
45
|
-
listPhoneNumbers: "List phone numbers",
|
|
46
|
-
attachPhoneNumber: "Attach phone number",
|
|
47
|
-
detachPhoneNumber: "Detach phone number",
|
|
48
|
-
importTwilioNumber: "Import Twilio number",
|
|
49
|
-
importExotelNumber: "Import Exotel number",
|
|
50
|
-
importSipTrunk: "Import SIP trunk",
|
|
51
|
-
listLLMProviders: "List LLM providers",
|
|
52
|
-
listVoices: "List voices",
|
|
53
|
-
listSTTProviders: "List speech-to-text providers",
|
|
54
|
-
listTTSProviders: "List text-to-speech providers",
|
|
55
|
-
listAllProviders: "List all providers",
|
|
56
|
-
getVoice: "Get voice",
|
|
57
|
-
searchPhoneNumbers: "Search available phone numbers",
|
|
58
|
-
purchasePhoneNumber: "Buy phone number",
|
|
59
|
-
releasePhoneNumber: "Release phone number",
|
|
60
|
-
getAccountBalance: "Get account balance",
|
|
61
|
-
listClonedVoices: "List cloned voices",
|
|
62
|
-
getClonedVoice: "Get cloned voice",
|
|
63
|
-
updateClonedVoice: "Update cloned voice",
|
|
64
|
-
deleteClonedVoice: "Delete cloned voice",
|
|
65
|
-
getClonedVoiceSample: "Get cloned voice sample",
|
|
66
|
-
regenerateClonedVoiceSample: "Regenerate cloned voice sample",
|
|
67
|
-
listWorkflowNodeTypes: "List workflow node types",
|
|
68
|
-
getWorkflowNodeType: "Get workflow node type",
|
|
69
|
-
listWorkflowFieldOptions: "List choices for a workflow field",
|
|
70
|
-
listWorkflows: "List workflows",
|
|
71
|
-
createWorkflow: "Create workflow",
|
|
72
|
-
getWorkflow: "Get workflow",
|
|
73
|
-
showWorkflow: "Show workflow canvas",
|
|
74
|
-
editWorkflow: "Edit workflow draft",
|
|
75
|
-
deleteWorkflow: "Delete workflow",
|
|
76
|
-
validateWorkflow: "Validate workflow",
|
|
77
|
-
publishWorkflow: "Publish workflow",
|
|
78
|
-
activateWorkflow: "Turn workflow on",
|
|
79
|
-
deactivateWorkflow: "Turn workflow off",
|
|
80
|
-
testWorkflow: "Test workflow (runs for real)",
|
|
81
|
-
getWorkflowExecution: "Get workflow run",
|
|
82
|
-
listPostCallActions: "List post-call actions",
|
|
83
|
-
addPostCallAction: "Add a post-call action",
|
|
84
|
-
deletePostCallAction: "Delete a post-call action",
|
|
85
|
-
updatePostCallAction: "Update a post-call action",
|
|
86
|
-
listIntegrations: "List integrations",
|
|
87
|
-
createCustomApiIntegration: "Create custom API integration",
|
|
88
|
-
listAgentIntegrations: "List agent integrations",
|
|
89
|
-
attachAgentIntegration: "Attach integration to agent",
|
|
90
|
-
detachAgentIntegration: "Detach integration from agent",
|
|
91
|
-
setBulkCallRotation: "Set campaign number rotation",
|
|
92
|
-
setPhoneNumberAutoRenew: "Set phone number auto-renew",
|
|
93
|
-
listWhatsappNumbers: "List WhatsApp numbers",
|
|
94
|
-
importWhatsappNumbers: "Import WhatsApp numbers",
|
|
95
|
-
previewWhatsappNumbers: "Preview WhatsApp numbers to import",
|
|
96
|
-
getWhatsappNumber: "Get WhatsApp number",
|
|
97
|
-
listWhatsappTemplates: "List WhatsApp templates",
|
|
98
|
-
syncWhatsappTemplates: "Sync WhatsApp templates",
|
|
99
|
-
getWhatsappCalling: "Get WhatsApp calling setting",
|
|
100
|
-
setWhatsappCalling: "Turn WhatsApp calling on or off",
|
|
101
|
-
listWhatsappConversations: "List WhatsApp conversations",
|
|
102
|
-
getWhatsappConversation: "Get WhatsApp conversation",
|
|
103
|
-
takeOverWhatsappConversation: "Take over WhatsApp conversation",
|
|
104
|
-
handBackWhatsappConversation: "Hand WhatsApp conversation back to agent",
|
|
105
|
-
listWhatsappMessages: "List WhatsApp messages",
|
|
106
|
-
sendWhatsappMessage: "Send WhatsApp message",
|
|
107
|
-
getWhatsappMessage: "Get WhatsApp message",
|
|
108
|
-
listWhatsappOptOuts: "List WhatsApp opt-outs",
|
|
109
|
-
addWhatsappOptOut: "Add WhatsApp opt-out",
|
|
110
|
-
liftWhatsappOptOut: "Lift WhatsApp opt-out",
|
|
111
|
-
listWhatsappCampaigns: "List WhatsApp campaigns",
|
|
112
|
-
createWhatsappCampaign: "Create WhatsApp campaign",
|
|
113
|
-
getWhatsappCampaign: "Get WhatsApp campaign",
|
|
114
|
-
listWhatsappCampaignContacts: "List WhatsApp campaign contacts",
|
|
115
|
-
addWhatsappCampaignContacts: "Add contacts to WhatsApp campaign",
|
|
116
|
-
launchWhatsappCampaign: "Launch WhatsApp campaign",
|
|
117
|
-
pauseWhatsappCampaign: "Pause WhatsApp campaign",
|
|
118
|
-
resumeWhatsappCampaign: "Resume WhatsApp campaign",
|
|
119
|
-
cancelWhatsappCampaign: "Cancel WhatsApp campaign",
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// POST tools that only validate or preview, with no state change.
|
|
123
|
-
const READ_ONLY_TOOLS = new Set(["canUploadFile", "validateWorkflow", "previewWhatsappNumbers"]);
|
|
124
|
-
|
|
125
|
-
// Irreversible removals, overwrites of live config, plus tools that place
|
|
126
|
-
// real outbound calls or send real messages.
|
|
127
|
-
const DESTRUCTIVE_TOOLS = new Set([
|
|
128
|
-
"deleteAgent", "deleteAgentVersion", "restoreAgentVersion",
|
|
129
|
-
"deleteKnowledgeBaseFile", "detachKnowledgeBaseFiles", "detachPhoneNumber",
|
|
130
|
-
"cancelBulkCall", "dispatchCall", "createBulkCall", "addBulkCallContact",
|
|
131
|
-
"addBulkCallContacts", "startBulkCall", "retryBulkCall", "bulkCallActions",
|
|
132
|
-
"purchasePhoneNumber", "releasePhoneNumber",
|
|
133
|
-
"deleteClonedVoice", "regenerateClonedVoiceSample", "deleteWorkflow", "publishWorkflow", "activateWorkflow",
|
|
134
|
-
"deactivateWorkflow", "testWorkflow", "deletePostCallAction",
|
|
135
|
-
"sendWhatsappMessage", "launchWhatsappCampaign", "resumeWhatsappCampaign",
|
|
136
|
-
"addWhatsappCampaignContacts", "cancelWhatsappCampaign", "liftWhatsappOptOut",
|
|
137
|
-
"importWhatsappNumbers", "attachAgentIntegration", "detachAgentIntegration",
|
|
138
|
-
"setPhoneNumberAutoRenew",
|
|
139
|
-
]);
|
|
140
|
-
|
|
141
|
-
// Tools that reach people or systems outside our API: a carrier, Meta, or
|
|
142
|
-
// (attachAgentIntegration) a live agent calling a caller-supplied URL.
|
|
143
|
-
const OPEN_WORLD_TOOLS = new Set([
|
|
144
|
-
"testWorkflow",
|
|
145
|
-
"dispatchCall", "createBulkCall", "addBulkCallContact",
|
|
146
|
-
"addBulkCallContacts", "startBulkCall", "retryBulkCall", "bulkCallActions",
|
|
147
|
-
"purchasePhoneNumber", "releasePhoneNumber",
|
|
148
|
-
"sendWhatsappMessage", "launchWhatsappCampaign", "resumeWhatsappCampaign",
|
|
149
|
-
"addWhatsappCampaignContacts", "importWhatsappNumbers", "setWhatsappCalling",
|
|
150
|
-
"attachAgentIntegration",
|
|
151
|
-
]);
|
|
3
|
+
// destructive or real-world actions. index.ts imports toolAnnotations and
|
|
4
|
+
// applies it in the tools/list handler.
|
|
5
|
+
import { TOOL_MARKS } from "./tool-marks.js";
|
|
152
6
|
|
|
153
7
|
export interface ToolAnnotations {
|
|
154
8
|
title?: string;
|
|
@@ -157,19 +11,25 @@ export interface ToolAnnotations {
|
|
|
157
11
|
openWorldHint?: boolean;
|
|
158
12
|
}
|
|
159
13
|
|
|
160
|
-
//
|
|
161
|
-
|
|
14
|
+
// Tools that are not spec operations, so they carry no x-mcp block.
|
|
15
|
+
const HAND_MARKS: Record<string, ToolAnnotations> = {
|
|
16
|
+
showWorkflow: { title: "Show workflow canvas", readOnlyHint: true, openWorldHint: false },
|
|
17
|
+
searchDocs: { title: "Search the docs", readOnlyHint: true, openWorldHint: false },
|
|
18
|
+
readDoc: { title: "Read a docs page", readOnlyHint: true, openWorldHint: false },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Spec tools get their marks from the spec's x-mcp block, through regen.
|
|
162
22
|
export function toolAnnotations(def: { name: string; method: string }): ToolAnnotations {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
23
|
+
return { ...(TOOL_MARKS[def.name] ?? HAND_MARKS[def.name] ?? {}) };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// OMNIDIM_READONLY=1 serves only tools that read data, so an agent cannot change the account or place a call.
|
|
27
|
+
export function readOnlyMode(env: Record<string, string | undefined> = process.env): boolean {
|
|
28
|
+
return ["1", "true", "on", "yes"].includes((env.OMNIDIM_READONLY ?? "").toLowerCase());
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function keepReadOnlyTools(map: Map<string, { name: string; method: string }>): void {
|
|
32
|
+
for (const def of [...map.values()]) {
|
|
33
|
+
if (!toolAnnotations(def).readOnlyHint) map.delete(def.name);
|
|
173
34
|
}
|
|
174
|
-
return annotations;
|
|
175
35
|
}
|