Skip to main content
Glama

edit_message

Update text or markdown in a Webex message by specifying the message ID, room ID, and new content. Enables quick edits to enhance clarity or correct errors.

Instructions

Edit a message in Webex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownNoThe new markdown for the message (optional).
messageIdYesThe unique identifier for the message to edit.
roomIdYesThe ID of the room where the message is located.
textYesThe new text for the message.

Implementation Reference

  • The main handler function that executes the edit_message tool logic. It sends a PUT request to the Webex API to update the message with new text and optional markdown.
    const executeFunction = async ({ messageId, roomId, text, markdown }) => {
    
      try {
        // Construct the URL for the PUT request
        const url = getWebexUrl(`/messages/${encodeURIComponent(messageId)}`);
    
        // Prepare the request body
        const body = JSON.stringify({
          roomId,
          text,
          ...(markdown && { markdown }) // Include markdown only if provided
        });
    
        // Set up headers for the request
        const headers = getWebexJsonHeaders();
    
        // Perform the fetch request
        const response = await fetch(url, {
          method: 'PUT',
          headers,
          body
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorData = await response.json();
          throw new Error(JSON.stringify(errorData));
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        console.error('Error editing the message:', error);
        return {
          error: error.message || 'An error occurred while editing the message.',
          details: error.stack
        };
      }
    };
  • The input schema and tool name definition for the edit_message tool, including parameters and required fields.
    function: {
      name: 'edit_message',
      description: 'Edit a message in Webex.',
      parameters: {
        type: 'object',
        properties: {
          messageId: {
            type: 'string',
            description: 'The unique identifier for the message to edit.'
          },
          roomId: {
            type: 'string',
            description: 'The ID of the room where the message is located.'
          },
          text: {
            type: 'string',
            description: 'The new text for the message.'
          },
          markdown: {
            type: 'string',
            description: 'The new markdown for the message (optional).'
          }
        },
        required: ['messageId', 'text']
      }
    }
  • The apiTool object that encapsulates the handler and schema, exported from the tool file for registration.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'edit_message',
          description: 'Edit a message in Webex.',
          parameters: {
            type: 'object',
            properties: {
              messageId: {
                type: 'string',
                description: 'The unique identifier for the message to edit.'
              },
              roomId: {
                type: 'string',
                description: 'The ID of the room where the message is located.'
              },
              text: {
                type: 'string',
                description: 'The new text for the message.'
              },
              markdown: {
                type: 'string',
                description: 'The new markdown for the message (optional).'
              }
            },
            required: ['messageId', 'text']
          }
        }
      }
    };
  • tools/paths.js:33-33 (registration)
    The edit_message tool file is registered by being listed in the toolPaths array used for dynamic discovery.
    'webex-public-workspace/webex-messaging/edit-a-message.js',
  • lib/tools.js:7-16 (registration)
    The discoverTools function that dynamically loads and registers all tools, including edit_message, by importing their apiTool objects.
    export async function discoverTools() {
      const toolPromises = toolPaths.map(async (file) => {
        const module = await import(`../tools/${file}`);
        return {
          ...module.apiTool,
          path: file,
        };
      });
      return Promise.all(toolPromises);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Edit' implies a mutation operation, the description doesn't disclose any behavioral traits: it doesn't mention permissions required, whether edits are reversible, rate limits, what happens if markdown/text conflict, or response format. For a mutation tool with zero annotation coverage, this leaves critical behavioral aspects unspecified.

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

Conciseness5/5

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

The description is a single, clear sentence with zero wasted words. It's front-loaded with the essential action and resource. Every word earns its place, making it highly efficient while still conveying the core purpose. No structural issues or unnecessary elaboration are present.

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?

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address behavioral aspects (permissions, side effects), provide usage context relative to siblings, or explain what the tool returns. The 100% schema coverage helps with parameters, but overall context for safe and effective use is lacking given the tool's complexity as an edit operation.

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 all four parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. It doesn't explain relationships between parameters (e.g., text vs markdown, why both roomId and messageId are needed) or provide usage examples. With complete schema coverage, the baseline of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the action ('Edit') and resource ('a message in Webex'), making the purpose immediately understandable. It distinguishes from siblings like 'create_message' and 'delete_message' by specifying the edit operation, though it doesn't explicitly contrast with them. The description is specific enough to identify the tool's function without being tautological.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing message ID and room ID), when editing is appropriate versus creating a new message, or any constraints (e.g., only own messages can be edited). With multiple sibling tools for message operations, this lack of contextual guidance is a significant gap.

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/Kashyap-AI-ML-Solutions/webex-messaging-mcp-server'

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