Skip to main content
Glama

Webex Messaging MCP Server

Official
by webex
create-a-team.js1.87 kB
import { getWebexUrl, getWebexHeaders, getWebexJsonHeaders } from '../../../lib/webex-config.js'; /** * Function to create a team in Webex. * * @param {Object} args - Arguments for creating a team. * @param {string} args.name - The name of the team. * @param {string} args.description - A description of the team. * @returns {Promise<Object>} - The result of the team creation. */ const executeFunction = async ({ name, description }) => { try { // Construct the URL for the team creation const url = getWebexUrl('/teams'); // Prepare the request body const body = JSON.stringify({ name, description }); // Set up headers for the request const headers = getWebexJsonHeaders(); // 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 team:', error); return { error: 'An error occurred while creating the team.' }; } }; /** * Tool configuration for creating a team in Webex. * @type {Object} */ const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'create_team', description: 'Create a team in Webex.', parameters: { type: 'object', properties: { name: { type: 'string', description: 'The name of the team.' }, description: { type: 'string', description: 'A description of the team.' } }, required: ['name'] } } } }; 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