Skip to main content
Glama

delete_membership

Remove a specific membership by its unique ID from Webex using the MCP server. This tool ensures targeted deletion of memberships to manage access and participation effectively.

Instructions

Delete a membership by ID in Webex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
membershipIdYesThe unique identifier for the membership to be deleted.

Implementation Reference

  • The main handler function that performs the DELETE request to the Webex API to delete a membership by its ID.
    const executeFunction = async ({ membershipId }) => {
    
      try {
        // Construct the URL with the membership ID
        const url = getWebexUrl(`/memberships/${encodeURIComponent(membershipId)}`);
    
        // Set up headers for the request
        const headers = getWebexHeaders();
    
        // Perform the fetch request
        const response = await fetch(url, {
          method: 'DELETE',
          headers
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorData = await response.json();
          throw new Error(errorData);
        }
    
        // Return the response status
        return { status: response.status, message: 'Membership deleted successfully.' };
      } catch (error) {
        console.error('Error deleting membership:', error);
        return { error: 'An error occurred while deleting the membership.' };
      }
    };
  • Tool schema definition including the name, description, input parameters (membershipId as required string), used for validation.
      definition: {
        type: 'function',
        function: {
          name: 'delete_membership',
          description: 'Delete a membership by ID in Webex.',
          parameters: {
            type: 'object',
            properties: {
              membershipId: {
                type: 'string',
                description: 'The unique identifier for the membership to be deleted.'
              }
            },
            required: ['membershipId']
          }
        }
      }
    };
  • The apiTool object that bundles the handler function and schema definition, exported for registration in the MCP tools system.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'delete_membership',
          description: 'Delete a membership by ID in Webex.',
          parameters: {
            type: 'object',
            properties: {
              membershipId: {
                type: 'string',
                description: 'The unique identifier for the membership to be deleted.'
              }
            },
            required: ['membershipId']
          }
        }
      }
    };
    
    export { apiTool };

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