Skip to main content
Glama

Webex Messaging MCP Server

Official
by webex
get-room-details.js1.95 kB
import { getWebexUrl, getWebexHeaders } from '../../../lib/webex-config.js'; /** * Function to get room details from Webex. * * @param {Object} args - Arguments for the room details request. * @param {string} args.roomId - The unique identifier for the room. * @returns {Promise<Object>} - The details of the room. */ const executeFunction = async ({ roomId }) => { try { // Construct the URL with the roomId const url = getWebexUrl(`/rooms/${encodeURIComponent(roomId)}`); // Set up headers for the request const headers = getWebexHeaders(); // Perform the fetch request const response = await fetch(url, { method: 'GET', headers }); // Check if the response was successful if (!response.ok) { const errorText = await response.text(); let errorMessage = `HTTP ${response.status}: ${response.statusText}`; try { const errorData = JSON.parse(errorText); errorMessage = errorData.message || errorData.error || JSON.stringify(errorData); } catch (e) { errorMessage = errorText || errorMessage; } throw new Error(errorMessage); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { console.error('Error getting room details:', error); return { error: 'An error occurred while getting room details.' }; } }; /** * Tool configuration for getting room details from Webex. * @type {Object} */ const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'get_room_details', description: 'Get details of a room by ID.', parameters: { type: 'object', properties: { roomId: { type: 'string', description: 'The unique identifier for the room.' } }, required: ['roomId'] } } } }; 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