@missionsquad/mcp-msq 0.1.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,169 @@
1
+ import { z } from 'zod';
2
+ const NonEmptyString = z.string().trim().min(1);
3
+ const MetadataSchema = z.record(z.unknown());
4
+ const MessageRoleSchema = z.enum(['system', 'user', 'assistant', 'tool']);
5
+ const ChatMessageSchema = z
6
+ .object({
7
+ role: MessageRoleSchema,
8
+ content: z.string(),
9
+ name: z.string().optional(),
10
+ tool_call_id: z.string().optional(),
11
+ })
12
+ .passthrough();
13
+ const OpenAiFunctionToolSchema = z.object({
14
+ type: z.literal('function'),
15
+ function: z.object({
16
+ name: NonEmptyString,
17
+ description: z.string().optional(),
18
+ parameters: z.object({}).passthrough(),
19
+ }),
20
+ });
21
+ const OpenAiToolChoiceSchema = z.union([z.string(), z.object({}).passthrough()]);
22
+ const ChunkingStrategySchema = z.union([
23
+ z.object({
24
+ type: z.literal('auto'),
25
+ }),
26
+ z.object({
27
+ type: z.literal('static'),
28
+ static: z.object({
29
+ max_chunk_size_tokens: z.number().int().positive(),
30
+ chunk_overlap_tokens: z.number().int().min(0),
31
+ }),
32
+ }),
33
+ ]);
34
+ export const EmptySchema = z.object({});
35
+ export const ChatCompletionsSchema = z
36
+ .object({
37
+ model: NonEmptyString,
38
+ messages: z.array(ChatMessageSchema).min(1),
39
+ temperature: z.number().optional(),
40
+ max_tokens: z.number().int().positive().optional(),
41
+ top_p: z.number().optional(),
42
+ n: z.number().int().positive().optional(),
43
+ stop: z.union([z.string(), z.array(z.string())]).optional(),
44
+ tools: z.array(OpenAiFunctionToolSchema).optional(),
45
+ tool_choice: OpenAiToolChoiceSchema.optional(),
46
+ stream: z.boolean().optional(),
47
+ xClientId: NonEmptyString.optional(),
48
+ xSessionId: NonEmptyString.optional(),
49
+ })
50
+ .passthrough();
51
+ export const EmbeddingsSchema = z
52
+ .object({
53
+ model: NonEmptyString,
54
+ input: z.union([z.string(), z.array(z.string()).min(1)]),
55
+ })
56
+ .passthrough();
57
+ export const AddProviderSchema = z.object({
58
+ providerKey: NonEmptyString,
59
+ apiKey: NonEmptyString.optional(),
60
+ url: z.string().url().optional(),
61
+ });
62
+ export const DeleteProviderSchema = z.object({
63
+ providerKey: NonEmptyString,
64
+ });
65
+ export const DiscoverProviderModelsSchema = z.object({
66
+ providerKey: NonEmptyString,
67
+ url: z.string().url().optional(),
68
+ apiKey: NonEmptyString.optional(),
69
+ });
70
+ export const AddModelSchema = z.object({
71
+ name: NonEmptyString,
72
+ description: z.string(),
73
+ providerKey: NonEmptyString,
74
+ model: NonEmptyString,
75
+ testResponse: z.boolean().optional(),
76
+ getAllApiModels: z.boolean().optional(),
77
+ extractEmbeddingModels: z.boolean().optional(),
78
+ });
79
+ export const DeleteModelSchema = z.object({
80
+ modelId: NonEmptyString,
81
+ });
82
+ export const AddAgentSchema = z.object({
83
+ name: NonEmptyString,
84
+ description: z.string(),
85
+ systemPrompt: z.string(),
86
+ model: NonEmptyString,
87
+ overwrite: z.boolean().optional(),
88
+ addToday: z.boolean().optional(),
89
+ timezoneOffset: NonEmptyString.optional(),
90
+ selectedFunctions: z.record(z.array(z.string())).optional(),
91
+ });
92
+ export const DeleteAgentSchema = z.object({
93
+ name: NonEmptyString,
94
+ });
95
+ export const GeneratePromptSchema = z.object({
96
+ model: NonEmptyString,
97
+ messages: z.array(ChatMessageSchema).min(1),
98
+ name: z.string().optional(),
99
+ description: z.string().optional(),
100
+ type: z.enum(['agent', 'workflow']).optional(),
101
+ modelOptions: z.object({}).passthrough().optional(),
102
+ });
103
+ export const AgentWorkflowSchema = z.object({
104
+ agentName: NonEmptyString,
105
+ messages: z.array(ChatMessageSchema).min(1),
106
+ data: z.object({}).passthrough().optional(),
107
+ delimiter: z.string().optional(),
108
+ concurrency: z.number().int().positive().optional(),
109
+ failureMessage: z.string().optional(),
110
+ failureInstruction: z.string().optional(),
111
+ });
112
+ export const ScrapeUrlSchema = z.object({
113
+ url: z.string().url(),
114
+ });
115
+ export const CoreCollectionSearchSchema = z.object({
116
+ collectionName: NonEmptyString,
117
+ query: z.string().min(1),
118
+ embeddingModelName: NonEmptyString,
119
+ topK: z.number().int().positive().optional(),
120
+ });
121
+ export const CoreCollectionDiagnosticsSchema = z.object({
122
+ collectionName: NonEmptyString,
123
+ });
124
+ export const CoreCollectionRecoverSchema = z.object({
125
+ collectionName: NonEmptyString,
126
+ strategy: z.enum(['auto', 'repair', 'reembed']).optional(),
127
+ force: z.boolean().optional(),
128
+ });
129
+ export const CreateVectorStoreSchema = z.object({
130
+ name: NonEmptyString,
131
+ file_ids: z.array(NonEmptyString).optional(),
132
+ chunking_strategy: ChunkingStrategySchema.optional(),
133
+ metadata: MetadataSchema.optional(),
134
+ embeddingModelName: NonEmptyString.optional(),
135
+ enhancePDF: z.boolean().optional(),
136
+ sseSessionId: NonEmptyString.optional(),
137
+ batchSize: z.number().int().positive().optional(),
138
+ });
139
+ export const VectorStoreIdSchema = z.object({
140
+ vectorStoreId: NonEmptyString,
141
+ });
142
+ export const VectorStoreFileSchema = z.object({
143
+ vectorStoreId: NonEmptyString,
144
+ fileId: NonEmptyString,
145
+ });
146
+ export const AddVectorStoreFileSchema = z.object({
147
+ vectorStoreId: NonEmptyString,
148
+ file_id: NonEmptyString,
149
+ chunking_strategy: ChunkingStrategySchema.optional(),
150
+ enhancePDF: z.boolean().optional(),
151
+ });
152
+ export const CancelVectorStoreSchema = z.object({
153
+ sessionId: NonEmptyString,
154
+ });
155
+ export const UploadFileSchema = z.object({
156
+ filePath: z.string().min(1),
157
+ purpose: NonEmptyString,
158
+ relativePath: z.string().optional(),
159
+ collectionName: z.string().optional(),
160
+ filename: z.string().optional(),
161
+ });
162
+ export const FileIdSchema = z.object({
163
+ fileId: NonEmptyString,
164
+ });
165
+ export const FileContentSchema = z.object({
166
+ fileId: NonEmptyString,
167
+ maxBytes: z.number().int().positive().optional(),
168
+ });
169
+ //# sourceMappingURL=schemas.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M,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,aAAa,EAAE,cAAc;IAC7B,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IACpD,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,cAAc;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,cAAc;CACvB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * MCP stdio transport requires stdout to contain JSON-RPC messages only.
3
+ * Redirect console methods that normally write to stdout so dependency logs
4
+ * cannot corrupt protocol frames.
5
+ */
6
+ export declare function routeConsoleStdoutToStderr(): void;
@@ -0,0 +1,27 @@
1
+ import { format, inspect } from 'node:util';
2
+ function writeLineToStderr(line) {
3
+ process.stderr.write(`${line}\n`);
4
+ }
5
+ function writeArgsToStderr(...args) {
6
+ writeLineToStderr(format(...args));
7
+ }
8
+ /**
9
+ * MCP stdio transport requires stdout to contain JSON-RPC messages only.
10
+ * Redirect console methods that normally write to stdout so dependency logs
11
+ * cannot corrupt protocol frames.
12
+ */
13
+ export function routeConsoleStdoutToStderr() {
14
+ console.log = (...args) => {
15
+ writeArgsToStderr(...args);
16
+ };
17
+ console.info = (...args) => {
18
+ writeArgsToStderr(...args);
19
+ };
20
+ console.debug = (...args) => {
21
+ writeArgsToStderr(...args);
22
+ };
23
+ console.dir = (item, options) => {
24
+ writeLineToStderr(inspect(item, options));
25
+ };
26
+ }
27
+ //# sourceMappingURL=stdio-safe-console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio-safe-console.js","sourceRoot":"","sources":["../src/stdio-safe-console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAuB,MAAM,WAAW,CAAA;AAEhE,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAG,IAAe;IAC3C,iBAAiB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,IAAe,EAAQ,EAAE;QACzC,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAA;IACD,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAe,EAAQ,EAAE;QAC1C,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAA;IACD,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAQ,EAAE;QAC3C,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAA;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,IAAa,EAAE,OAAwB,EAAQ,EAAE;QAC9D,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FastMCP } from '@missionsquad/fastmcp';
2
+ export declare const MSQ_TOOL_NAMES: string[];
3
+ export declare function registerMissionSquadTools(server: FastMCP<undefined>): void;
package/dist/tools.js ADDED
@@ -0,0 +1,415 @@
1
+ import { toUserError } from './errors.js';
2
+ import { stringifyResult } from './json.js';
3
+ import { createMissionSquadClient } from './msq-client.js';
4
+ import { AddAgentSchema, AddModelSchema, AddProviderSchema, AddVectorStoreFileSchema, AgentWorkflowSchema, CancelVectorStoreSchema, ChatCompletionsSchema, CoreCollectionDiagnosticsSchema, CoreCollectionRecoverSchema, CoreCollectionSearchSchema, CreateVectorStoreSchema, DeleteAgentSchema, DeleteModelSchema, DeleteProviderSchema, DiscoverProviderModelsSchema, EmbeddingsSchema, EmptySchema, FileContentSchema, FileIdSchema, GeneratePromptSchema, ScrapeUrlSchema, UploadFileSchema, VectorStoreFileSchema, VectorStoreIdSchema, } from './schemas.js';
5
+ function defineTool(definition) {
6
+ return definition;
7
+ }
8
+ function encodePathSegment(value) {
9
+ return encodeURIComponent(value);
10
+ }
11
+ const msqTools = [
12
+ defineTool({
13
+ name: 'msq_list_models',
14
+ description: 'List all models and agents in your MissionSquad namespace.',
15
+ parameters: EmptySchema,
16
+ run: async (client) => client.requestJson({
17
+ method: 'GET',
18
+ path: 'models',
19
+ }),
20
+ }),
21
+ defineTool({
22
+ name: 'msq_get_model_map',
23
+ description: 'Get the full model map keyed by model/agent name.',
24
+ parameters: EmptySchema,
25
+ run: async (client) => client.requestJson({
26
+ method: 'GET',
27
+ path: 'modelmap',
28
+ }),
29
+ }),
30
+ defineTool({
31
+ name: 'msq_chat_completions',
32
+ description: 'Create OpenAI-compatible chat completions in MissionSquad.',
33
+ parameters: ChatCompletionsSchema,
34
+ run: async (client, args) => {
35
+ const headers = {
36
+ 'x-client-id': args.xClientId,
37
+ 'x-session-id': args.xSessionId,
38
+ };
39
+ const body = { ...args };
40
+ delete body.xClientId;
41
+ delete body.xSessionId;
42
+ return client.requestJson({
43
+ method: 'POST',
44
+ path: 'chat/completions',
45
+ headers,
46
+ body,
47
+ });
48
+ },
49
+ }),
50
+ defineTool({
51
+ name: 'msq_embeddings',
52
+ description: 'Create OpenAI-compatible embeddings in MissionSquad.',
53
+ parameters: EmbeddingsSchema,
54
+ run: async (client, args) => client.requestJson({
55
+ method: 'POST',
56
+ path: 'embeddings',
57
+ body: args,
58
+ }),
59
+ }),
60
+ defineTool({
61
+ name: 'msq_list_providers',
62
+ description: 'List configured upstream providers for your account.',
63
+ parameters: EmptySchema,
64
+ run: async (client) => client.requestJson({
65
+ method: 'GET',
66
+ path: 'core/providers',
67
+ }),
68
+ }),
69
+ defineTool({
70
+ name: 'msq_add_provider',
71
+ description: 'Add or update a provider configuration.',
72
+ parameters: AddProviderSchema,
73
+ run: async (client, args) => client.requestJson({
74
+ method: 'POST',
75
+ path: 'core/add/provider',
76
+ body: args,
77
+ }),
78
+ }),
79
+ defineTool({
80
+ name: 'msq_delete_provider',
81
+ description: 'Delete a provider configuration by providerKey.',
82
+ parameters: DeleteProviderSchema,
83
+ run: async (client, args) => client.requestJson({
84
+ method: 'POST',
85
+ path: 'core/delete/provider',
86
+ body: args,
87
+ }),
88
+ }),
89
+ defineTool({
90
+ name: 'msq_discover_provider_models',
91
+ description: 'Discover available models from a configured provider.',
92
+ parameters: DiscoverProviderModelsSchema,
93
+ run: async (client, args) => client.requestJson({
94
+ method: 'POST',
95
+ path: 'core/models',
96
+ body: args,
97
+ }),
98
+ }),
99
+ defineTool({
100
+ name: 'msq_add_model',
101
+ description: 'Add a model to your MissionSquad namespace.',
102
+ parameters: AddModelSchema,
103
+ run: async (client, args) => client.requestJson({
104
+ method: 'POST',
105
+ path: 'core/add/model',
106
+ body: args,
107
+ }),
108
+ }),
109
+ defineTool({
110
+ name: 'msq_delete_model',
111
+ description: 'Delete a model or embedding model by modelId.',
112
+ parameters: DeleteModelSchema,
113
+ run: async (client, args) => client.requestJson({
114
+ method: 'POST',
115
+ path: 'core/delete/model',
116
+ body: args,
117
+ }),
118
+ }),
119
+ defineTool({
120
+ name: 'msq_list_agents',
121
+ description: 'List your MissionSquad agents.',
122
+ parameters: EmptySchema,
123
+ run: async (client) => client.requestJson({
124
+ method: 'GET',
125
+ path: 'core/agents',
126
+ }),
127
+ }),
128
+ defineTool({
129
+ name: 'msq_add_agent',
130
+ description: 'Create or update an agent definition.',
131
+ parameters: AddAgentSchema,
132
+ run: async (client, args) => client.requestJson({
133
+ method: 'POST',
134
+ path: 'core/add/agent',
135
+ body: args,
136
+ }),
137
+ }),
138
+ defineTool({
139
+ name: 'msq_delete_agent',
140
+ description: 'Delete an agent by name.',
141
+ parameters: DeleteAgentSchema,
142
+ run: async (client, args) => client.requestJson({
143
+ method: 'POST',
144
+ path: 'core/delete/agent',
145
+ body: args,
146
+ }),
147
+ }),
148
+ defineTool({
149
+ name: 'msq_generate_prompt',
150
+ description: 'Generate a prompt using MissionSquad core prompt generation.',
151
+ parameters: GeneratePromptSchema,
152
+ run: async (client, args) => client.requestJson({
153
+ method: 'POST',
154
+ path: 'core/generate/prompt',
155
+ body: args,
156
+ }),
157
+ }),
158
+ defineTool({
159
+ name: 'msq_run_agent_workflow',
160
+ description: 'Execute a MissionSquad agent workflow.',
161
+ parameters: AgentWorkflowSchema,
162
+ run: async (client, args) => client.requestJson({
163
+ method: 'POST',
164
+ path: 'core/agent-workflow',
165
+ body: args,
166
+ }),
167
+ }),
168
+ defineTool({
169
+ name: 'msq_get_core_config',
170
+ description: 'Get MissionSquad core config (models, agents, embeddings, collections).',
171
+ parameters: EmptySchema,
172
+ run: async (client) => client.requestJson({
173
+ method: 'GET',
174
+ path: 'core/config',
175
+ }),
176
+ }),
177
+ defineTool({
178
+ name: 'msq_scrape_url',
179
+ description: 'Request MissionSquad to scrape text content from a URL.',
180
+ parameters: ScrapeUrlSchema,
181
+ run: async (client, args) => client.requestJson({
182
+ method: 'POST',
183
+ path: 'core/scrape-url',
184
+ body: args,
185
+ }),
186
+ }),
187
+ defineTool({
188
+ name: 'msq_list_tools',
189
+ description: 'List MissionSquad MCP tool inventories available to agents.',
190
+ parameters: EmptySchema,
191
+ run: async (client) => client.requestJson({
192
+ method: 'GET',
193
+ path: 'core/tools',
194
+ }),
195
+ }),
196
+ defineTool({
197
+ name: 'msq_list_servers',
198
+ description: 'List MissionSquad MCP server inventory and status.',
199
+ parameters: EmptySchema,
200
+ run: async (client) => client.requestJson({
201
+ method: 'GET',
202
+ path: 'core/servers',
203
+ }),
204
+ }),
205
+ defineTool({
206
+ name: 'msq_list_core_collections',
207
+ description: 'List MissionSquad core embedded collections.',
208
+ parameters: EmptySchema,
209
+ run: async (client) => client.requestJson({
210
+ method: 'GET',
211
+ path: 'core/collections',
212
+ }),
213
+ }),
214
+ defineTool({
215
+ name: 'msq_search_core_collection',
216
+ description: 'Search a MissionSquad core embedded collection.',
217
+ parameters: CoreCollectionSearchSchema,
218
+ run: async (client, args) => {
219
+ const { collectionName, ...body } = args;
220
+ return client.requestJson({
221
+ method: 'POST',
222
+ path: `core/collections/${encodePathSegment(collectionName)}/search`,
223
+ body,
224
+ });
225
+ },
226
+ }),
227
+ defineTool({
228
+ name: 'msq_get_core_collection_diagnostics',
229
+ description: 'Get diagnostics for a MissionSquad core embedded collection.',
230
+ parameters: CoreCollectionDiagnosticsSchema,
231
+ run: async (client, args) => client.requestJson({
232
+ method: 'GET',
233
+ path: `core/collections/${encodePathSegment(args.collectionName)}/diagnostics`,
234
+ }),
235
+ }),
236
+ defineTool({
237
+ name: 'msq_recover_core_collection',
238
+ description: 'Run collection recovery for a MissionSquad core embedded collection.',
239
+ parameters: CoreCollectionRecoverSchema,
240
+ run: async (client, args) => {
241
+ const { collectionName, ...body } = args;
242
+ return client.requestJson({
243
+ method: 'POST',
244
+ path: `core/collections/${encodePathSegment(collectionName)}/recover`,
245
+ body,
246
+ });
247
+ },
248
+ }),
249
+ defineTool({
250
+ name: 'msq_list_vector_stores',
251
+ description: 'List MissionSquad vector stores.',
252
+ parameters: EmptySchema,
253
+ run: async (client) => client.requestJson({
254
+ method: 'GET',
255
+ path: 'vector_stores',
256
+ }),
257
+ }),
258
+ defineTool({
259
+ name: 'msq_create_vector_store',
260
+ description: 'Create a MissionSquad vector store and optionally enqueue files.',
261
+ parameters: CreateVectorStoreSchema,
262
+ run: async (client, args) => client.requestJson({
263
+ method: 'POST',
264
+ path: 'vector_stores',
265
+ body: args,
266
+ }),
267
+ }),
268
+ defineTool({
269
+ name: 'msq_get_vector_store',
270
+ description: 'Get a MissionSquad vector store by id.',
271
+ parameters: VectorStoreIdSchema,
272
+ run: async (client, args) => client.requestJson({
273
+ method: 'GET',
274
+ path: `vector_stores/${encodePathSegment(args.vectorStoreId)}`,
275
+ }),
276
+ }),
277
+ defineTool({
278
+ name: 'msq_delete_vector_store',
279
+ description: 'Delete a MissionSquad vector store by id.',
280
+ parameters: VectorStoreIdSchema,
281
+ run: async (client, args) => client.requestJson({
282
+ method: 'DELETE',
283
+ path: `vector_stores/${encodePathSegment(args.vectorStoreId)}`,
284
+ }),
285
+ }),
286
+ defineTool({
287
+ name: 'msq_list_vector_store_files',
288
+ description: 'List files associated with a vector store.',
289
+ parameters: VectorStoreIdSchema,
290
+ run: async (client, args) => client.requestJson({
291
+ method: 'GET',
292
+ path: `vector_stores/${encodePathSegment(args.vectorStoreId)}/files`,
293
+ }),
294
+ }),
295
+ defineTool({
296
+ name: 'msq_add_vector_store_file',
297
+ description: 'Add an existing uploaded file to a vector store and embed it.',
298
+ parameters: AddVectorStoreFileSchema,
299
+ run: async (client, args) => {
300
+ const { vectorStoreId, ...body } = args;
301
+ return client.requestJson({
302
+ method: 'POST',
303
+ path: `vector_stores/${encodePathSegment(vectorStoreId)}/files`,
304
+ body,
305
+ });
306
+ },
307
+ }),
308
+ defineTool({
309
+ name: 'msq_get_vector_store_file',
310
+ description: 'Get vector-store association details for a specific file.',
311
+ parameters: VectorStoreFileSchema,
312
+ run: async (client, args) => client.requestJson({
313
+ method: 'GET',
314
+ path: `vector_stores/${encodePathSegment(args.vectorStoreId)}/files/${encodePathSegment(args.fileId)}`,
315
+ }),
316
+ }),
317
+ defineTool({
318
+ name: 'msq_cancel_vector_store_session',
319
+ description: 'Cancel an in-progress vector-store embedding session by sessionId.',
320
+ parameters: CancelVectorStoreSchema,
321
+ run: async (client, args) => client.requestJson({
322
+ method: 'POST',
323
+ path: 'vector_stores/cancel',
324
+ body: args,
325
+ }),
326
+ }),
327
+ defineTool({
328
+ name: 'msq_list_files',
329
+ description: 'List uploaded files.',
330
+ parameters: EmptySchema,
331
+ run: async (client) => client.requestJson({
332
+ method: 'GET',
333
+ path: 'files',
334
+ }),
335
+ }),
336
+ defineTool({
337
+ name: 'msq_upload_file',
338
+ description: 'Upload a file for vector-store workflows.',
339
+ parameters: UploadFileSchema,
340
+ run: async (client, args) => client.uploadFile({
341
+ filePath: args.filePath,
342
+ purpose: args.purpose,
343
+ relativePath: args.relativePath,
344
+ collectionName: args.collectionName,
345
+ filename: args.filename,
346
+ }),
347
+ }),
348
+ defineTool({
349
+ name: 'msq_get_file',
350
+ description: 'Get uploaded file metadata by id.',
351
+ parameters: FileIdSchema,
352
+ run: async (client, args) => client.requestJson({
353
+ method: 'GET',
354
+ path: `files/${encodePathSegment(args.fileId)}`,
355
+ }),
356
+ }),
357
+ defineTool({
358
+ name: 'msq_delete_file',
359
+ description: 'Delete an uploaded file by id.',
360
+ parameters: FileIdSchema,
361
+ run: async (client, args) => client.requestJson({
362
+ method: 'DELETE',
363
+ path: `files/${encodePathSegment(args.fileId)}`,
364
+ }),
365
+ }),
366
+ defineTool({
367
+ name: 'msq_get_file_content',
368
+ description: 'Fetch file content as base64 with byte limits for safe transport.',
369
+ parameters: FileContentSchema,
370
+ run: async (client, args) => client.getFileContent({
371
+ fileId: args.fileId,
372
+ maxBytes: args.maxBytes,
373
+ }),
374
+ }),
375
+ defineTool({
376
+ name: 'msq_list_user_collections',
377
+ description: 'List convenience user collections summary.',
378
+ parameters: EmptySchema,
379
+ run: async (client) => client.requestJson({
380
+ method: 'GET',
381
+ path: 'user-collections',
382
+ }),
383
+ }),
384
+ defineTool({
385
+ name: 'msq_get_vector_store_file_details',
386
+ description: 'Get decoded filename/path details for files in a vector store.',
387
+ parameters: VectorStoreIdSchema,
388
+ run: async (client, args) => client.requestJson({
389
+ method: 'GET',
390
+ path: `vector_stores/${encodePathSegment(args.vectorStoreId)}/file-details`,
391
+ }),
392
+ }),
393
+ ];
394
+ export const MSQ_TOOL_NAMES = msqTools.map((tool) => tool.name);
395
+ export function registerMissionSquadTools(server) {
396
+ for (const tool of msqTools) {
397
+ server.addTool({
398
+ name: tool.name,
399
+ description: tool.description,
400
+ parameters: tool.parameters,
401
+ execute: async (args, context) => {
402
+ try {
403
+ const client = createMissionSquadClient(context.extraArgs);
404
+ const run = tool.run;
405
+ const result = await run(client, args);
406
+ return stringifyResult(result);
407
+ }
408
+ catch (error) {
409
+ throw toUserError(error, `Tool ${tool.name} failed`);
410
+ }
411
+ },
412
+ });
413
+ }
414
+ }
415
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAA2B,MAAM,iBAAiB,CAAA;AACnF,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,+BAA+B,EAC/B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