@intangle/mcp-server 2.3.9 → 2.4.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/index.js CHANGED
@@ -196,6 +196,20 @@ try {
196
196
  unlink: args.unlink,
197
197
  });
198
198
  }
199
+ async function handleMessage(args) {
200
+ if (!args.type || !args.content) {
201
+ throw new Error("type and content are required");
202
+ }
203
+ // Inject session_id from environment variable
204
+ const sessionId = process.env.INTANGLE_SESSION_ID;
205
+ if (!sessionId) {
206
+ throw new Error("INTANGLE_SESSION_ID environment variable is required for the message tool");
207
+ }
208
+ return makeApiCall("message", {
209
+ ...args,
210
+ session_id: sessionId,
211
+ });
212
+ }
199
213
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
200
214
  const { name, arguments: args } = request.params;
201
215
  try {
@@ -228,6 +242,9 @@ try {
228
242
  case "update_space":
229
243
  result = await handleUpdateSpace(args);
230
244
  break;
245
+ case "message":
246
+ result = await handleMessage(args);
247
+ break;
231
248
  default:
232
249
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
233
250
  }
@@ -302,6 +302,44 @@ export const TOOLS = [
302
302
  required: ["space_id"]
303
303
  }
304
304
  },
305
+ {
306
+ name: "message",
307
+ title: "Send Message",
308
+ description: "Send a message to the Intangle assistant for user interaction. Use type 'approval' to request approval (blocks until user responds), 'question' to ask the user a question (blocks until answered), 'notification' for informational updates (returns immediately), 'completion' to signal task completion (returns immediately), or 'error' to report errors (returns immediately).",
309
+ inputSchema: {
310
+ type: "object",
311
+ properties: {
312
+ type: {
313
+ type: "string",
314
+ enum: ["approval", "question", "notification", "completion", "error"],
315
+ description: "Message type. 'approval' and 'question' block until the user responds. 'notification', 'completion', and 'error' return immediately."
316
+ },
317
+ content: {
318
+ type: "string",
319
+ description: "The message content to display to the user"
320
+ },
321
+ metadata: {
322
+ type: "object",
323
+ description: "Optional context about the message",
324
+ properties: {
325
+ file: {
326
+ type: "string",
327
+ description: "Related file path"
328
+ },
329
+ action: {
330
+ type: "string",
331
+ description: "Action being performed"
332
+ },
333
+ details: {
334
+ type: "string",
335
+ description: "Additional details"
336
+ }
337
+ }
338
+ }
339
+ },
340
+ required: ["type", "content"]
341
+ }
342
+ },
305
343
  // DISABLED: memory_action tool is broken and causing errors.
306
344
  // Pending OHM protocol fix. Use update_space, search, or fetch_items instead.
307
345
  // {
package/index.ts CHANGED
@@ -270,6 +270,25 @@ try {
270
270
  })
271
271
  }
272
272
 
273
+ async function handleMessage(args: any) {
274
+ if (!args.type || !args.content) {
275
+ throw new Error("type and content are required")
276
+ }
277
+
278
+ // Inject session_id from environment variable
279
+ const sessionId = process.env.INTANGLE_SESSION_ID
280
+ if (!sessionId) {
281
+ throw new Error(
282
+ "INTANGLE_SESSION_ID environment variable is required for the message tool"
283
+ )
284
+ }
285
+
286
+ return makeApiCall("message", {
287
+ ...args,
288
+ session_id: sessionId,
289
+ })
290
+ }
291
+
273
292
  server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
274
293
  const { name, arguments: args } = request.params
275
294
 
@@ -304,6 +323,9 @@ try {
304
323
  case "update_space":
305
324
  result = await handleUpdateSpace(args)
306
325
  break
326
+ case "message":
327
+ result = await handleMessage(args)
328
+ break
307
329
  default:
308
330
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`)
309
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intangle/mcp-server",
3
- "version": "2.3.9",
3
+ "version": "2.4.0",
4
4
  "description": "Model Context Protocol server for Intangle - AI context that persists across conversations",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -341,6 +341,46 @@ export const TOOLS = [
341
341
  required: ["space_id"]
342
342
  }
343
343
  },
344
+ {
345
+ name: "message",
346
+ title: "Send Message",
347
+ description:
348
+ "Send a message to the Intangle assistant for user interaction. Use type 'approval' to request approval (blocks until user responds), 'question' to ask the user a question (blocks until answered), 'notification' for informational updates (returns immediately), 'completion' to signal task completion (returns immediately), or 'error' to report errors (returns immediately).",
349
+ inputSchema: {
350
+ type: "object",
351
+ properties: {
352
+ type: {
353
+ type: "string",
354
+ enum: ["approval", "question", "notification", "completion", "error"],
355
+ description:
356
+ "Message type. 'approval' and 'question' block until the user responds. 'notification', 'completion', and 'error' return immediately."
357
+ },
358
+ content: {
359
+ type: "string",
360
+ description: "The message content to display to the user"
361
+ },
362
+ metadata: {
363
+ type: "object",
364
+ description: "Optional context about the message",
365
+ properties: {
366
+ file: {
367
+ type: "string",
368
+ description: "Related file path"
369
+ },
370
+ action: {
371
+ type: "string",
372
+ description: "Action being performed"
373
+ },
374
+ details: {
375
+ type: "string",
376
+ description: "Additional details"
377
+ }
378
+ }
379
+ }
380
+ },
381
+ required: ["type", "content"]
382
+ }
383
+ },
344
384
  // DISABLED: memory_action tool is broken and causing errors.
345
385
  // Pending OHM protocol fix. Use update_space, search, or fetch_items instead.
346
386
  // {