Skip to main content
Glama

Update User

update_user

Send updates to Slack or Discord for a captured message by specifying its ID and the new content to share. Ensures coordinated communication between AI agents via the Beep Boop MCP server.

Instructions

Sends a follow-up update back to the platform (Slack/Discord) for a captured message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageIdYesID of the captured message to respond to
updateContentYesMessage content to send as an update

Implementation Reference

  • Core handler function for the 'update_user' MCP tool. Retrieves message from inbox store and posts update to Slack/Discord thread/channel, with delegation to HTTP listener if enabled.
    export async function handleUpdateUser(params: UpdateUserParams): Promise<ToolResponse> {
      try {
        const { messageId, updateContent } = params;
        const config = loadConfig();
    
        // If central listener is enabled, delegate synchronously and return its response
        if (config.listenerEnabled) {
          try {
            const { listenerClient } = await import('./http-listener-client.js');
            const payload = { messageId, updateContent };
            const res = await listenerClient.post('/mcp/update_user', payload);
            if (res.ok) {
              const text = typeof res.data?.text === 'string' ? res.data.text : `✅ Update sent for message ${messageId}`;
              return { content: [{ type: 'text', text }] };
            }
            return { content: [{ type: 'text', text: `❌ Listener error (${res.status}): ${res.error || 'unknown error'}` }], isError: true };
          } catch (e) {
            return { content: [{ type: 'text', text: `❌ Listener call failed: ${e}` }], isError: true };
          }
        }
    
        // Fallback to local platform posting
        const inbox = new (await import('./ingress/inbox.js')).InboxStore(config);
        
        // Trigger auto-cleanup (non-blocking)
        inbox.autoCleanup();
        
        const msg = await inbox.read(messageId);
        if (!msg) {
          return { content: [{ type: 'text', text: `❌ Message ${messageId} not found` }], isError: true };
        }
    
        if (msg.platform === 'slack') {
          if (!config.slackBotToken) {
            return { content: [{ type: 'text', text: '❌ Slack bot token not configured' }], isError: true };
          }
          const { WebClient } = await import('@slack/web-api');
          const web = new WebClient(config.slackBotToken);
          const channel = msg.context.channelId as string;
          const thread_ts = msg.context.threadTs as string | undefined;
          await web.chat.postMessage({ channel, thread_ts, text: updateContent });
        } else if (msg.platform === 'discord') {
          if (!config.discordBotToken) {
            return { content: [{ type: 'text', text: '❌ Discord bot token not configured' }], isError: true };
          }
          const { REST, Routes } = await import('discord.js');
          const rest = new (REST as any)({ version: '10' }).setToken(config.discordBotToken);
          const threadId = (msg.context as any).threadId as string | undefined;
          if (threadId) {
            await rest.post((Routes as any).channelMessages(threadId), { body: { content: updateContent } });
          } else {
            const channelId = msg.context.channelId as string;
            await rest.post((Routes as any).channelMessages(channelId), { body: { content: updateContent, message_reference: { message_id: (msg.context as any).messageId } } });
          }
        } else {
          return { content: [{ type: 'text', text: `❌ Unsupported platform: ${(msg as any).platform}` }], isError: true };
        }
    
        return { content: [{ type: 'text', text: `✅ Update sent for message ${messageId}` }] };
      } catch (error) {
        return { content: [{ type: 'text', text: `❌ Failed to send update: ${error}` }], isError: true };
      }
    }
  • Zod input schema for validating 'update_user' tool parameters: messageId (string) and updateContent (string). Used in tool registration.
    /** Schema for update_user tool parameters */
    export const UpdateUserSchema = z.object({
      messageId: z.string().describe('ID of the captured message to respond to'),
      updateContent: z.string().describe('Message content to send as an update')
    });
  • src/index.ts:96-110 (registration)
    MCP server registration of the 'update_user' tool, specifying title, description, input schema imported from tools.js, and handler function.
     * Tool: update_user
     * Sends a follow-up update back to the platform thread/user tied to a captured message
     */
    server.registerTool(
      'update_user',
      {
        title: 'Update User',
        description: 'Sends a follow-up update back to the platform (Slack/Discord) for a captured message.',
        inputSchema: (await import('./tools.js')).UpdateUserSchema.shape
      },
      async (params) => {
        const { handleUpdateUser } = await import('./tools.js');
        return await handleUpdateUser(params);
      }
    );
  • TypeScript interface defining the UpdateUserParams type used by the update_user handler function.
    export interface UpdateUserParams {
      /** ID of the captured message in the inbox store */
      messageId: string;
      /** Message content to send as an update */
      updateContent: string;
    }
  • HTTP endpoint (/mcp/update_user) in ingress server that the tool handler delegates to when listenerEnabled=true. Implements the same Slack/Discord posting logic.
    if (req.method === 'POST' && url.pathname === '/mcp/update_user') {
      try {
        const body = await readJsonBody<any>(req);
        const { messageId, updateContent } = body || {};
        if (!messageId || !updateContent) {
          res.writeHead(400, { 'Content-Type': 'application/json' });
          res.end(JSON.stringify({ error: 'messageId and updateContent are required' }));
          return;
        }
    
        const msg = await inbox.read(messageId);
        if (!msg) {
          res.writeHead(404, { 'Content-Type': 'application/json' });
          res.end(JSON.stringify({ error: `Message ${messageId} not found` }));
          return;
        }
    
        if (msg.platform === 'slack') {
          const cfg = loadConfig();
          if (!cfg.slackBotToken) {
            res.writeHead(500, { 'Content-Type': 'application/json' });
            res.end(JSON.stringify({ error: 'Slack bot token not configured' }));
            return;
          }
          const { WebClient } = await import('@slack/web-api');
          const web = new WebClient(cfg.slackBotToken);
          const channel = msg.context.channelId as string;
          const thread_ts = (msg.context as any).threadTs as string | undefined;
          await web.chat.postMessage({ channel, thread_ts, text: updateContent });
        } else if (msg.platform === 'discord') {
          const cfg = loadConfig();
          if (!cfg.discordBotToken) {
            res.writeHead(500, { 'Content-Type': 'application/json' });
            res.end(JSON.stringify({ error: 'Discord bot token not configured' }));
            return;
          }
          const { REST, Routes } = await import('discord.js');
          const rest = new (REST as any)({ version: '10' }).setToken(cfg.discordBotToken);
          const threadId = (msg.context as any).threadId as string | undefined;
          if (threadId) {
            await rest.post((Routes as any).channelMessages(threadId), { body: { content: updateContent } });
          } else {
            const channelId = msg.context.channelId as string;
            await rest.post((Routes as any).channelMessages(channelId), { body: { content: updateContent, message_reference: { message_id: (msg.context as any).messageId } } });
          }
        } else {
          res.writeHead(400, { 'Content-Type': 'application/json' });
          res.end(JSON.stringify({ error: `Unsupported platform: ${(msg as any).platform}` }));
          return;
        }
    
        res.writeHead(200, { 'Content-Type': 'application/json' });
        res.end(JSON.stringify({ text: `✅ Update sent for message ${messageId}` }));
        return;
      } catch (e) {
        res.writeHead(500, { 'Content-Type': 'application/json' });
        res.end(JSON.stringify({ error: `Failed to send update: ${e}` }));
        return;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It implies a write operation ('sends') but doesn't specify permissions, rate limits, or effects (e.g., if updates are editable or permanent). This is inadequate for a mutation tool, leaving key behavioral traits undefined.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action. It avoids redundancy and wastes no words, making it appropriately concise, though it could be more structured with additional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a mutation with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, or return values, failing to compensate for the missing structured data, which is insufficient for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('messageId' and 'updateContent'). The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'sends a follow-up update back to the platform (Slack/Discord) for a captured message,' which provides a clear verb ('sends') and resource ('update'), but it's vague about what 'captured message' means and doesn't distinguish this from sibling tools like 'update_boop' or 'create_beep,' leaving ambiguity in its specific role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It mentions 'captured message' but doesn't explain prerequisites, context, or exclusions, and sibling tools like 'update_boop' or 'initiate_conversation' are not referenced, offering no help in tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thesammykins/beep_boop_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server