Skip to main content
Glama

Webex Messaging MCP Server

Official
by webex
list-teams.js1.73 kB
import { getWebexUrl, getWebexHeaders, getWebexJsonHeaders } from '../../../lib/webex-config.js'; /** * Function to list teams for the authenticated user in Webex. * * @param {Object} args - Arguments for the team listing. * @param {number} [args.max=100] - The maximum number of teams to return. * @returns {Promise<Object>} - The result of the team listing. */ const executeFunction = async ({ max = 100 }) => { try { // Construct the URL with query parameters const url = new URL(getWebexUrl('/teams')); 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(JSON.stringify(errorData)); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { console.error('Error listing teams:', error); return { error: 'An error occurred while listing teams.' }; } }; /** * Tool configuration for listing teams in Webex. * @type {Object} */ const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'list_teams', description: 'List teams for the authenticated user in Webex.', parameters: { type: 'object', properties: { max: { type: 'integer', description: 'The maximum number of teams to return.' } }, required: [] } } } }; export { apiTool };

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/webex/webex-messaging-mcp-server'

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