@relaycast/mcp 0.2.3 → 0.2.4

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.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { createRelayMcpServer, MCP_VERSION } from './server.js';
2
2
  export type { McpServerOptions } from './server.js';
3
3
  export { startStdio, createHttpHandler } from './transports.js';
4
+ export type { SessionLifecycle } from './transports.js';
4
5
  export { DEFAULT_SYSTEM_PROMPT } from './prompts.js';
5
6
  export type { SessionState } from './types.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEvE,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAuGzE"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAcpE,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEvE,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA8IzE"}
package/dist/server.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
2
3
  import { Relay, WsClient } from '@relaycast/sdk';
3
4
  import { registerRegistrationTools } from './tools/registration.js';
4
5
  import { registerChannelTools } from './tools/channels.js';
@@ -45,20 +46,38 @@ export function createRelayMcpServer(options) {
45
46
  session.wsBridge = null;
46
47
  session.subscriptions = null;
47
48
  }
49
+ if (shouldResetBridge) {
50
+ session.wsInitAttempted = false;
51
+ }
48
52
  // When an agent token is set, initialize the WebSocket bridge.
49
- if (nextAgentToken && !session.wsBridge) {
50
- const subscriptions = new SubscriptionManager();
51
- const wsClient = new WsClient({
52
- token: nextAgentToken,
53
- baseUrl: options.baseUrl,
54
- });
55
- const wsBridge = new WsBridge(wsClient, subscriptions, (uri) => {
56
- mcpServer.server.sendResourceUpdated({ uri }).catch(() => {
57
- // Silently ignore notification failures
53
+ if (nextAgentToken && !session.wsBridge && !session.wsInitAttempted) {
54
+ try {
55
+ const subscriptions = new SubscriptionManager();
56
+ const wsClient = new WsClient({
57
+ token: nextAgentToken,
58
+ baseUrl: options.baseUrl,
58
59
  });
59
- });
60
- wsBridge.start();
61
- Object.assign(session, partial, { wsBridge, subscriptions });
60
+ const wsBridge = new WsBridge(wsClient, subscriptions, (uri) => {
61
+ mcpServer.server.sendResourceUpdated({ uri }).catch(() => {
62
+ // Silently ignore notification failures
63
+ });
64
+ });
65
+ wsBridge.start();
66
+ Object.assign(session, partial, {
67
+ wsBridge,
68
+ subscriptions,
69
+ wsInitAttempted: true,
70
+ });
71
+ }
72
+ catch {
73
+ // In non-WS runtimes (e.g. some test environments), keep session usable
74
+ // without real-time resource updates.
75
+ Object.assign(session, partial, {
76
+ wsBridge: null,
77
+ subscriptions: null,
78
+ wsInitAttempted: true,
79
+ });
80
+ }
62
81
  telemetry.capture('relaycast_mcp_session_authenticated', {
63
82
  source_surface: 'mcp',
64
83
  agent_name: nextAgentName,
@@ -86,6 +105,20 @@ export function createRelayMcpServer(options) {
86
105
  registerProgrammabilityTools(mcpServer, getRelay, getAgentClient);
87
106
  // Register system prompt
88
107
  registerSystemPrompt(mcpServer);
108
+ const handlers = mcpServer.server._requestHandlers;
109
+ const origToolsListHandler = handlers.get('tools/list');
110
+ if (origToolsListHandler) {
111
+ mcpServer.server.setRequestHandler(ListToolsRequestSchema, async (req, extra) => {
112
+ const result = (await origToolsListHandler(req, extra));
113
+ if (result?.tools) {
114
+ result.tools = result.tools.map(t => {
115
+ const { execution, outputSchema, _meta, ...clean } = t;
116
+ return clean;
117
+ });
118
+ }
119
+ return result;
120
+ });
121
+ }
89
122
  return mcpServer;
90
123
  }
91
124
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAe,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAqB,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,eAAe,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B,CAAC,GAAG,EAAE,KAAK,CAAC,CAA0C,CAAC;YACjG,IAAI,MAAM,EAAE,KAAK,EAAE,CAAC;gBAClB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;oBAClC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;oBACvD,OAAO,KAAK,CAAC;gBACf,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Smithery config schema – exposed to the Smithery registry so it can
4
+ * auto-generate a configuration form and validate user input.
5
+ *
6
+ * Both fields are optional: callers can set a workspace key at runtime
7
+ * via the `set_workspace_key` / `create_workspace` tools instead.
8
+ */
9
+ export declare const configSchema: z.ZodObject<{
10
+ relayApiKey: z.ZodOptional<z.ZodString>;
11
+ relayBaseUrl: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ /**
14
+ * Smithery entry point.
15
+ *
16
+ * Smithery calls this function with validated config and expects a
17
+ * low-level `Server` instance from @modelcontextprotocol/sdk.
18
+ */
19
+ export default function createServer(context: {
20
+ config: z.infer<typeof configSchema>;
21
+ }): import("@modelcontextprotocol/sdk/server").Server<{
22
+ method: string;
23
+ params?: {
24
+ [x: string]: unknown;
25
+ _meta?: {
26
+ [x: string]: unknown;
27
+ progressToken?: string | number | undefined;
28
+ "io.modelcontextprotocol/related-task"?: {
29
+ taskId: string;
30
+ } | undefined;
31
+ } | undefined;
32
+ } | undefined;
33
+ }, {
34
+ method: string;
35
+ params?: {
36
+ [x: string]: unknown;
37
+ _meta?: {
38
+ [x: string]: unknown;
39
+ progressToken?: string | number | undefined;
40
+ "io.modelcontextprotocol/related-task"?: {
41
+ taskId: string;
42
+ } | undefined;
43
+ } | undefined;
44
+ } | undefined;
45
+ }, {
46
+ [x: string]: unknown;
47
+ _meta?: {
48
+ [x: string]: unknown;
49
+ progressToken?: string | number | undefined;
50
+ "io.modelcontextprotocol/related-task"?: {
51
+ taskId: string;
52
+ } | undefined;
53
+ } | undefined;
54
+ }>;
55
+ //# sourceMappingURL=smithery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smithery.d.ts","sourceRoot":"","sources":["../src/smithery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;iBAavB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;CACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQA"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { createRelayMcpServer } from './server.js';
3
+ /**
4
+ * Smithery config schema – exposed to the Smithery registry so it can
5
+ * auto-generate a configuration form and validate user input.
6
+ *
7
+ * Both fields are optional: callers can set a workspace key at runtime
8
+ * via the `set_workspace_key` / `create_workspace` tools instead.
9
+ */
10
+ export const configSchema = z.object({
11
+ relayApiKey: z
12
+ .string()
13
+ .optional()
14
+ .describe('Workspace API key (rk_live_...) used to pre-authenticate the MCP session.'),
15
+ relayBaseUrl: z
16
+ .string()
17
+ .optional()
18
+ .describe('Override API base URL for self-hosted Relaycast deployments (defaults to https://api.relaycast.dev).'),
19
+ });
20
+ /**
21
+ * Smithery entry point.
22
+ *
23
+ * Smithery calls this function with validated config and expects a
24
+ * low-level `Server` instance from @modelcontextprotocol/sdk.
25
+ */
26
+ export default function createServer(context) {
27
+ const mcpServer = createRelayMcpServer({
28
+ apiKey: context.config.relayApiKey,
29
+ baseUrl: context.config.relayBaseUrl,
30
+ telemetryTransport: 'stdio',
31
+ });
32
+ return mcpServer.server;
33
+ }
34
+ //# sourceMappingURL=smithery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smithery.js","sourceRoot":"","sources":["../src/smithery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,2EAA2E,CAC5E;IACH,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sGAAsG,CACvG;CACJ,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAEpC;IACC,MAAM,SAAS,GAAG,oBAAoB,CAAC;QACrC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW;QAClC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;QACpC,kBAAkB,EAAE,OAAO;KAC5B,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM,WAAW,GAChC,IAAI,CAqIN"}
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM,WAAW,GAChC,IAAI,CAsKN"}
@@ -1,25 +1,32 @@
1
1
  import { z } from 'zod';
2
+ /** Passthrough object schema for dynamic API responses. */
3
+ const jsonResult = z.object({}).passthrough();
2
4
  export function registerChannelTools(server, getAgentClient) {
3
- // Tool 3: create_channel
4
5
  server.registerTool('create_channel', {
5
6
  title: 'Create Channel',
6
- description: 'Create a new channel in the workspace.',
7
+ description: 'Create a new communication channel in the workspace. Channels are the primary way for agents to broadcast and receive messages in a shared context. Channel names must be lowercase with no spaces, similar to Slack channel naming conventions. Optionally set an initial topic to describe the channel\'s purpose.',
7
8
  inputSchema: {
8
- name: z.string().describe('Channel name (no spaces, lowercase)'),
9
- topic: z.string().optional().describe('Channel topic/description'),
9
+ name: z.string().describe('Unique channel name using lowercase letters, numbers, and hyphens (e.g. "build-alerts", "team-chat")'),
10
+ topic: z.string().optional().describe('Short description of the channel\'s purpose, visible to all members when they view channel details'),
10
11
  },
12
+ outputSchema: jsonResult,
11
13
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
12
14
  }, async ({ name, topic }) => {
13
15
  const client = getAgentClient();
14
16
  const channel = await client.channels.create({ name, topic });
15
- return { content: [{ type: 'text', text: JSON.stringify(channel, null, 2) }] };
17
+ return {
18
+ content: [{ type: 'text', text: JSON.stringify(channel, null, 2) }],
19
+ structuredContent: channel,
20
+ };
16
21
  });
17
- // Tool 4: list_channels
18
22
  server.registerTool('list_channels', {
19
23
  title: 'List Channels',
20
- description: 'List all channels in the workspace.',
24
+ description: 'List all channels available in the workspace. Returns each channel\'s name, topic, member count, and creation date. By default only active channels are shown; set include_archived to true to also see archived channels.',
21
25
  inputSchema: {
22
- include_archived: z.boolean().optional().describe('Include archived channels'),
26
+ include_archived: z.boolean().optional().describe('When true, include archived channels in the response alongside active ones'),
27
+ },
28
+ outputSchema: {
29
+ channels: z.array(z.object({}).passthrough()).describe('Array of channel objects with name, topic, and member details'),
23
30
  },
24
31
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
25
32
  }, async ({ include_archived }) => {
@@ -27,74 +34,102 @@ export function registerChannelTools(server, getAgentClient) {
27
34
  const channels = await client.channels.list(include_archived ? { include_archived } : undefined);
28
35
  return {
29
36
  content: [{ type: 'text', text: JSON.stringify(channels, null, 2) }],
37
+ structuredContent: { channels: channels },
30
38
  };
31
39
  });
32
- // Tool 5: join_channel
33
40
  server.registerTool('join_channel', {
34
41
  title: 'Join Channel',
35
- description: 'Join a channel.',
42
+ description: 'Join an existing channel to start receiving its messages. The agent will appear in the channel\'s member list and can post messages after joining. This operation is idempotent — joining a channel you are already a member of has no effect.',
36
43
  inputSchema: {
37
- channel: z.string().describe('Channel name to join'),
44
+ channel: z.string().describe('Name of the channel to join (e.g. "general", "build-alerts")'),
45
+ },
46
+ outputSchema: {
47
+ message: z.string().describe('Confirmation message indicating the channel was joined'),
38
48
  },
39
49
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
40
50
  }, async ({ channel }) => {
41
51
  const client = getAgentClient();
42
52
  await client.channels.join(channel);
43
- return { content: [{ type: 'text', text: `Joined channel #${channel}` }] };
53
+ const message = `Joined channel #${channel}`;
54
+ return {
55
+ content: [{ type: 'text', text: message }],
56
+ structuredContent: { message },
57
+ };
44
58
  });
45
- // Tool 6: leave_channel
46
59
  server.registerTool('leave_channel', {
47
60
  title: 'Leave Channel',
48
- description: 'Leave a channel.',
61
+ description: 'Leave a channel to stop receiving its messages. The agent is removed from the channel\'s member list but the channel and its history are preserved. You can rejoin at any time. This operation is idempotent — leaving a channel you are not a member of has no effect.',
49
62
  inputSchema: {
50
- channel: z.string().describe('Channel name to leave'),
63
+ channel: z.string().describe('Name of the channel to leave (e.g. "general", "build-alerts")'),
64
+ },
65
+ outputSchema: {
66
+ message: z.string().describe('Confirmation message indicating the channel was left'),
51
67
  },
52
68
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
53
69
  }, async ({ channel }) => {
54
70
  const client = getAgentClient();
55
71
  await client.channels.leave(channel);
56
- return { content: [{ type: 'text', text: `Left channel #${channel}` }] };
72
+ const message = `Left channel #${channel}`;
73
+ return {
74
+ content: [{ type: 'text', text: message }],
75
+ structuredContent: { message },
76
+ };
57
77
  });
58
- // Tool 7: invite_to_channel
59
78
  server.registerTool('invite_to_channel', {
60
79
  title: 'Invite to Channel',
61
- description: 'Invite an agent to a channel.',
80
+ description: 'Invite another agent to join a channel. The invited agent is automatically added as a member and will begin receiving messages from the channel. This is useful for onboarding new agents into specific conversations or workflows.',
62
81
  inputSchema: {
63
- channel: z.string().describe('Channel name'),
64
- agent: z.string().describe('Agent name to invite'),
82
+ channel: z.string().describe('Name of the channel to invite the agent to (e.g. "general", "build-alerts")'),
83
+ agent: z.string().describe('Name of the registered agent to invite into the channel'),
84
+ },
85
+ outputSchema: {
86
+ message: z.string().describe('Confirmation message indicating the agent was invited'),
65
87
  },
66
88
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
67
89
  }, async ({ channel, agent }) => {
68
90
  const client = getAgentClient();
69
91
  await client.channels.invite(channel, agent);
70
- return { content: [{ type: 'text', text: `Invited ${agent} to #${channel}` }] };
92
+ const message = `Invited ${agent} to #${channel}`;
93
+ return {
94
+ content: [{ type: 'text', text: message }],
95
+ structuredContent: { message },
96
+ };
71
97
  });
72
- // Tool 8: set_channel_topic
73
98
  server.registerTool('set_channel_topic', {
74
99
  title: 'Set Channel Topic',
75
- description: 'Set the topic for a channel.',
100
+ description: 'Update the topic description for a channel. The topic is a short text visible to all members that describes the channel\'s current purpose or focus. Changing the topic does not send a notification to channel members.',
76
101
  inputSchema: {
77
- channel: z.string().describe('Channel name'),
78
- topic: z.string().describe('New topic text'),
102
+ channel: z.string().describe('Name of the channel whose topic should be updated'),
103
+ topic: z.string().describe('New topic text describing the channel\'s purpose or current focus'),
79
104
  },
105
+ outputSchema: jsonResult,
80
106
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
81
107
  }, async ({ channel, topic }) => {
82
108
  const client = getAgentClient();
83
109
  const updated = await client.channels.setTopic(channel, topic);
84
- return { content: [{ type: 'text', text: JSON.stringify(updated, null, 2) }] };
110
+ return {
111
+ content: [{ type: 'text', text: JSON.stringify(updated, null, 2) }],
112
+ structuredContent: updated,
113
+ };
85
114
  });
86
- // Tool 9: archive_channel
87
115
  server.registerTool('archive_channel', {
88
116
  title: 'Archive Channel',
89
- description: 'Archive a channel (soft delete).',
117
+ description: 'Archive a channel to remove it from the active channel list. Archived channels preserve their full message history but no new messages can be posted. This is a soft delete — the channel can be restored later if needed. Use this to clean up channels that are no longer in use.',
90
118
  inputSchema: {
91
- channel: z.string().describe('Channel name to archive'),
119
+ channel: z.string().describe('Name of the channel to archive (e.g. "old-project", "temp-discussion")'),
120
+ },
121
+ outputSchema: {
122
+ message: z.string().describe('Confirmation message indicating the channel was archived'),
92
123
  },
93
124
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
94
125
  }, async ({ channel }) => {
95
126
  const client = getAgentClient();
96
127
  await client.channels.archive(channel);
97
- return { content: [{ type: 'text', text: `Archived channel #${channel}` }] };
128
+ const message = `Archived channel #${channel}`;
129
+ return {
130
+ content: [{ type: 'text', text: message }],
131
+ structuredContent: { message },
132
+ };
98
133
  });
99
134
  }
100
135
  //# sourceMappingURL=channels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,cAAiC;IAEjC,yBAAyB;IACzB,MAA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OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;YAC1C,iBAAiB,EAAE,EAAE,OAAO,EAAE;SAC/B,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/tools/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM,WAAW,GAChC,IAAI,CA+FN"}
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/tools/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM,WAAW,GAChC,IAAI,CA2IN"}
@@ -1,92 +1,138 @@
1
1
  import { z } from 'zod';
2
+ /** Passthrough object schema for dynamic API responses. */
3
+ const jsonResult = z.object({}).passthrough();
2
4
  export function registerFeatureTools(server, getAgentClient) {
3
5
  server.registerTool('add_reaction', {
4
6
  title: 'Add Reaction',
5
- description: 'Add an emoji reaction to a message.',
7
+ description: 'Add an emoji reaction to a message. Reactions are a lightweight way for agents to acknowledge, vote on, or express sentiment about messages without posting a reply. Each agent can add multiple different emoji reactions to the same message. Adding a reaction that already exists from the same agent has no effect.',
6
8
  inputSchema: {
7
- message_id: z.string().describe('Message ID'),
8
- emoji: z.string().describe('Emoji to react with'),
9
+ message_id: z.string().describe('ID of the message to react to'),
10
+ emoji: z.string().describe('Emoji character or shortcode to react with (e.g. "thumbsup", "rocket", "check")'),
11
+ },
12
+ outputSchema: {
13
+ message: z.string().describe('Confirmation message indicating the reaction was added'),
9
14
  },
10
15
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
11
16
  }, async ({ message_id, emoji }) => {
12
17
  const client = getAgentClient();
13
18
  await client.react(message_id, emoji);
14
- return { content: [{ type: 'text', text: `Reacted with ${emoji}` }] };
19
+ const message = `Reacted with ${emoji}`;
20
+ return {
21
+ content: [{ type: 'text', text: message }],
22
+ structuredContent: { message },
23
+ };
15
24
  });
16
25
  server.registerTool('remove_reaction', {
17
26
  title: 'Remove Reaction',
18
- description: 'Remove an emoji reaction from a message.',
27
+ description: 'Remove a previously added emoji reaction from a message. Only reactions added by the current agent can be removed. This is useful for correcting accidental reactions or changing your response to a message.',
19
28
  inputSchema: {
20
- message_id: z.string().describe('Message ID'),
21
- emoji: z.string().describe('Emoji to remove'),
29
+ message_id: z.string().describe('ID of the message to remove the reaction from'),
30
+ emoji: z.string().describe('Emoji character or shortcode to remove (must match a reaction previously added by this agent)'),
31
+ },
32
+ outputSchema: {
33
+ message: z.string().describe('Confirmation message indicating the reaction was removed'),
22
34
  },
23
35
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
24
36
  }, async ({ message_id, emoji }) => {
25
37
  const client = getAgentClient();
26
38
  await client.unreact(message_id, emoji);
27
- return { content: [{ type: 'text', text: `Removed reaction ${emoji}` }] };
39
+ const message = `Removed reaction ${emoji}`;
40
+ return {
41
+ content: [{ type: 'text', text: message }],
42
+ structuredContent: { message },
43
+ };
28
44
  });
29
45
  server.registerTool('search_messages', {
30
46
  title: 'Search Messages',
31
- description: 'Search messages across channels.',
47
+ description: 'Search for messages across all channels in the workspace using a text query. Results can be filtered by channel name or sender agent to narrow down matches. Returns matching messages with their channel, author, text content, and timestamp.',
32
48
  inputSchema: {
33
- query: z.string().describe('Search query'),
34
- channel: z.string().optional().describe('Limit to channel'),
35
- from: z.string().optional().describe('Filter by sender agent'),
36
- limit: z.number().optional().describe('Max results'),
49
+ query: z.string().describe('Text search query to match against message content'),
50
+ channel: z.string().optional().describe('Restrict search results to messages in this channel only'),
51
+ from: z.string().optional().describe('Restrict search results to messages sent by this agent name'),
52
+ limit: z.number().optional().describe('Maximum number of search results to return'),
53
+ },
54
+ outputSchema: {
55
+ results: z.array(z.object({}).passthrough()).describe('Array of matching message objects'),
37
56
  },
38
57
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
39
58
  }, async ({ query, channel, from, limit }) => {
40
59
  const client = getAgentClient();
41
60
  const results = await client.search(query, { channel, from, limit });
42
- return { content: [{ type: 'text', text: JSON.stringify(results, null, 2) }] };
61
+ return {
62
+ content: [{ type: 'text', text: JSON.stringify(results, null, 2) }],
63
+ structuredContent: { results: results },
64
+ };
43
65
  });
44
66
  server.registerTool('check_inbox', {
45
67
  title: 'Check Inbox',
46
- description: 'Check inbox for unread messages, mentions, and DMs.',
68
+ description: 'Check the current agent\'s inbox for unread messages, @mentions, and direct messages. The inbox aggregates all notifications across channels and DMs into a single view. Use this to stay up-to-date on conversations that require your attention.',
69
+ inputSchema: {
70
+ limit: z.number().optional().describe('Maximum number of inbox items to return'),
71
+ },
72
+ outputSchema: jsonResult,
47
73
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
48
74
  }, async () => {
49
75
  const client = getAgentClient();
50
76
  const inbox = await client.inbox();
51
- return { content: [{ type: 'text', text: JSON.stringify(inbox, null, 2) }] };
77
+ return {
78
+ content: [{ type: 'text', text: JSON.stringify(inbox, null, 2) }],
79
+ structuredContent: inbox,
80
+ };
52
81
  });
53
82
  server.registerTool('mark_read', {
54
83
  title: 'Mark as Read',
55
- description: 'Mark a message as read.',
84
+ description: 'Mark a specific message as read by the current agent. This updates the agent\'s read receipt for the message, which other agents can query using get_readers. Marking a message as read also clears it from the agent\'s inbox notifications.',
56
85
  inputSchema: {
57
- message_id: z.string().describe('Message ID to mark as read'),
86
+ message_id: z.string().describe('ID of the message to mark as read by the current agent'),
87
+ },
88
+ outputSchema: {
89
+ message: z.string().describe('Confirmation message indicating the message was marked as read'),
58
90
  },
59
91
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
60
92
  }, async ({ message_id }) => {
61
93
  const client = getAgentClient();
62
94
  await client.markRead(message_id);
63
- return { content: [{ type: 'text', text: `Marked message ${message_id} as read` }] };
95
+ const message = `Marked message ${message_id} as read`;
96
+ return {
97
+ content: [{ type: 'text', text: message }],
98
+ structuredContent: { message },
99
+ };
64
100
  });
65
101
  server.registerTool('get_readers', {
66
102
  title: 'Get Readers',
67
- description: 'Get list of agents who have read a message.',
103
+ description: 'Get the list of agents who have read a specific message. Returns each reader\'s agent name and the timestamp when they marked the message as read. This is useful for confirming that important messages have been seen by their intended audience.',
68
104
  inputSchema: {
69
- message_id: z.string().describe('Message ID'),
105
+ message_id: z.string().describe('ID of the message to check read receipts for'),
106
+ },
107
+ outputSchema: {
108
+ readers: z.array(z.object({}).passthrough()).describe('Array of reader objects with agent name and read timestamp'),
70
109
  },
71
110
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
72
111
  }, async ({ message_id }) => {
73
112
  const client = getAgentClient();
74
113
  const readers = await client.readers(message_id);
75
- return { content: [{ type: 'text', text: JSON.stringify(readers, null, 2) }] };
114
+ return {
115
+ content: [{ type: 'text', text: JSON.stringify(readers, null, 2) }],
116
+ structuredContent: { readers: readers },
117
+ };
76
118
  });
77
119
  server.registerTool('upload_file', {
78
120
  title: 'Upload File',
79
- description: 'Upload a file and get an attachment ID.',
121
+ description: 'Upload a file to the workspace and receive an attachment ID that can be used when posting messages. Files are stored securely and can be shared across channels and DMs. Provide the filename, MIME type, and size in bytes to initiate the upload. The returned attachment ID should be passed to post_message or send_dm to attach the file.',
80
122
  inputSchema: {
81
- filename: z.string().describe('File name'),
82
- content_type: z.string().describe('MIME type (e.g. text/plain, image/png)'),
83
- size_bytes: z.number().describe('File size in bytes'),
123
+ filename: z.string().describe('Name of the file including extension (e.g. "report.pdf", "screenshot.png")'),
124
+ content_type: z.string().describe('MIME type of the file content (e.g. "text/plain", "image/png", "application/pdf")'),
125
+ size_bytes: z.number().describe('Size of the file in bytes, used for upload validation and storage allocation'),
84
126
  },
127
+ outputSchema: jsonResult,
85
128
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
86
129
  }, async ({ filename, content_type, size_bytes }) => {
87
130
  const client = getAgentClient();
88
131
  const upload = await client.files.upload({ filename, content_type, size_bytes });
89
- return { content: [{ type: 'text', text: JSON.stringify(upload, null, 2) }] };
132
+ return {
133
+ content: [{ type: 'text', text: JSON.stringify(upload, null, 2) }],
134
+ structuredContent: upload,
135
+ };
90
136
  });
91
137
  }
92
138
  //# sourceMappingURL=features.js.map