Skip to main content
Glama

update_webhook

Modify a Webex webhook by updating its name, target URL, secret, or status using the provided webhook ID. Ensure real-time integration and automation with custom configurations.

Instructions

Update a webhook in Webex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the webhook.
secretYesThe secret for the webhook.
statusYesThe status of the webhook (e.g., active).
targetUrlYesThe target URL for the webhook.
webhookIdYesThe unique identifier for the webhook.

Implementation Reference

  • The core handler function that executes the update_webhook tool. It constructs the Webex API URL, request body with webhook details, headers (including optional token), performs a PUT fetch request, handles errors, and returns the response or error.
    const executeFunction = async ({ webhookId, name, targetUrl, secret, status }) => { try { // Construct the URL with the webhook ID const url = getWebexUrl('/webhooks/${webhookId}'); // Prepare the request body const body = JSON.stringify({ name, targetUrl, secret, ownedBy: 'org', status }); // Set up headers for the request const headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' }; // If a token is provided, add it to the Authorization header if (token) { headers['Authorization'] = `Bearer ${token}`; } // Perform the fetch request const response = await fetch(url, { method: 'PUT', 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 updating webhook:', error); return { error: 'An error occurred while updating the webhook.' }; } };
  • The JSON schema definition for the update_webhook tool, including name, description, input parameters (webhookId, name, targetUrl, secret, status), and required fields.
    name: 'update_webhook', description: 'Update a webhook in Webex.', parameters: { type: 'object', properties: { webhookId: { type: 'string', description: 'The unique identifier for the webhook.' }, name: { type: 'string', description: 'The name of the webhook.' }, targetUrl: { type: 'string', description: 'The target URL for the webhook.' }, secret: { type: 'string', description: 'The secret for the webhook.' }, status: { type: 'string', description: 'The status of the webhook (e.g., active).' } }, required: ['webhookId', 'name', 'event'] } } }
  • The apiTool export that packages the handler function and schema definition, intended for registration in the MCP tools registry.
    const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'update_webhook', description: 'Update a webhook in Webex.', parameters: { type: 'object', properties: { webhookId: { type: 'string', description: 'The unique identifier for the webhook.' }, name: { type: 'string', description: 'The name of the webhook.' }, targetUrl: { type: 'string', description: 'The target URL for the webhook.' }, secret: { type: 'string', description: 'The secret for the webhook.' }, status: { type: 'string', description: 'The status of the webhook (e.g., active).' } }, required: ['webhookId', 'name', 'event'] } } } }; 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