Skip to main content
Glama

list_team_memberships

Retrieve and display team memberships for a specified team in Webex using the provided team ID and optional maximum results limit.

Instructions

List team memberships for a given team in Webex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoThe maximum number of team memberships to return.
teamIdYesThe ID of the team to list memberships for.

Implementation Reference

  • The main handler function `executeFunction` that lists team memberships by making a GET request to the Webex /team/memberships endpoint.
    const executeFunction = async ({ teamId, max = 100 }) => {
    
      try {
        // Construct the URL with query parameters
        const url = new URL(getWebexUrl('/team/memberships'));
        url.searchParams.append('teamId', teamId);
        url.searchParams.append('max', max.toString());
    
        // Set up headers for the request
        const headers = getWebexHeaders();
    
        // Perform the fetch request
        const response = await fetch(url.toString(), {
          method: 'GET',
          headers
        });
    
        // 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 listing team memberships:', error);
        return { error: 'An error occurred while listing team memberships.' };
      }
    };
  • The `apiTool` object defining the tool's schema, including name, description, parameters, and the handler reference.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'list_team_memberships',
          description: 'List team memberships for a given team in Webex.',
          parameters: {
            type: 'object',
            properties: {
              teamId: {
                type: 'string',
                description: 'The ID of the team to list memberships for.'
              },
              max: {
                type: 'integer',
                description: 'The maximum number of team memberships to return.'
              }
            },
            required: ['teamId']
          }
        }
      }
    };
  • tools/paths.js:30-30 (registration)
    The path to the tool's implementation file is listed in the `toolPaths` array.
    'webex-public-workspace/webex-messaging/list-team-memberships.js',
  • lib/tools.js:7-16 (registration)
    The `discoverTools` function dynamically loads and registers all tools by importing their `apiTool` exports based on paths from `toolPaths`.
    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);
    }

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