Skip to main content
Glama

create_attachment_action

Create a new attachment action in Webex by specifying action type, message ID, and associated inputs like name, URL, email, and telephone number for enhanced messaging functionality.

Instructions

Create a new attachment action in Webex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsYes
messageIdYesThe ID of the message to which the attachment is related.
typeYesThe type of the action (e.g., "submit").

Implementation Reference

  • The main handler function `executeFunction` that implements the core logic: constructs Webex API URL and headers, sends POST request with type, messageId, and inputs, handles response or error.
    const executeFunction = async ({ type, messageId, inputs }) => {
    
      try {
        // Construct the URL for the request
        const url = getWebexUrl('/attachment/actions');
    
        // Set up headers for the request
        const headers = getWebexJsonHeaders();
    
        // Create the body of the request
        const body = JSON.stringify({
          type,
          messageId,
          inputs
        });
    
        // Perform the fetch request
        const response = await fetch(url, {
          method: 'POST',
          headers,
          body
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorData = await response.json();
          throw new Error(errorData);
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        console.error('Error creating attachment action:', error);
        return { error: 'An error occurred while creating the attachment action.' };
      }
    };
  • The JSON Schema defining the tool's input parameters: object with 'type' (string), 'messageId' (string, required), and 'inputs' object (required) containing 'Name', 'Url', 'Email', 'Tel' (all strings, required).
    parameters: {
      type: 'object',
      properties: {
        type: {
          type: 'string',
          description: 'The type of the action (e.g., "submit").'
        },
        messageId: {
          type: 'string',
          description: 'The ID of the message to which the attachment is related.'
        },
        inputs: {
          type: 'object',
          properties: {
            Name: {
              type: 'string',
              description: 'The name associated with the action.'
            },
            Url: {
              type: 'string',
              description: 'The URL associated with the action.'
            },
            Email: {
              type: 'string',
              description: 'The email associated with the action.'
            },
            Tel: {
              type: 'string',
              description: 'The telephone number associated with the action.'
            }
          },
          required: ['Name', 'Url', 'Email', 'Tel']
        }
      },
      required: ['messageId', 'inputs']
    }
  • The `apiTool` object that registers the tool, linking the handler `executeFunction` to the schema under the name 'create_attachment_action', and exports it for loading by the MCP tools system.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'create_attachment_action',
          description: 'Create a new attachment action in Webex.',
          parameters: {
            type: 'object',
            properties: {
              type: {
                type: 'string',
                description: 'The type of the action (e.g., "submit").'
              },
              messageId: {
                type: 'string',
                description: 'The ID of the message to which the attachment is related.'
              },
              inputs: {
                type: 'object',
                properties: {
                  Name: {
                    type: 'string',
                    description: 'The name associated with the action.'
                  },
                  Url: {
                    type: 'string',
                    description: 'The URL associated with the action.'
                  },
                  Email: {
                    type: 'string',
                    description: 'The email associated with the action.'
                  },
                  Tel: {
                    type: 'string',
                    description: 'The telephone number associated with the action.'
                  }
                },
                required: ['Name', 'Url', 'Email', 'Tel']
              }
            },
            required: ['messageId', 'inputs']
          }
        }
      }
    };
    
    export { apiTool };
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. It states 'create' implying a write operation but doesn't disclose behavioral traits like required permissions, whether this is idempotent, rate limits, or what happens on success/failure. The description is minimal and lacks essential context for a mutation tool.

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, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's function without unnecessary elaboration.

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 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what an attachment action is, what the tool returns, error conditions, or how it differs from related tools, leaving significant gaps for an AI agent to understand proper usage.

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 67%, with the 'inputs' object having detailed parameter descriptions but 'type' and 'messageId' lacking context. The description adds no parameter semantics beyond what the schema provides, so it meets the baseline of 3 given moderate schema coverage but doesn't compensate for gaps.

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 creates a new attachment action in Webex, which is a clear verb+resource combination. However, it doesn't specify what an 'attachment action' is or differentiate it from sibling tools like create_message or edit_message, leaving the purpose somewhat vague.

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. With siblings like create_message and edit_message that might involve attachments, the description offers no context about prerequisites, appropriate scenarios, or exclusions for this specific attachment action creation.

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