get_attachment_action_details
Retrieve detailed information for a specific attachment action using its unique ID within the Webex MCP Server to access Cisco Webex messaging capabilities.
Instructions
Get details for an attachment action by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier for the attachment action. |
Implementation Reference
- The main handler function 'executeFunction' that performs a GET request to the Webex API to retrieve attachment action details by ID.
const executeFunction = async ({ id }) => { try { // Construct the URL with the provided ID const url = getWebexUrl('/attachment/actions/${encodeURIComponent(id)}'); // 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 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 fetching attachment action details:', error); return { error: 'An error occurred while fetching attachment action details.' }; } }; - The input schema defining the required 'id' parameter (note mismatch in required field 'actionId').
parameters: { type: 'object', properties: { id: { type: 'string', description: 'The unique identifier for the attachment action.' } }, required: ['actionId'] } - The 'apiTool' object exporting the tool's function reference and schema definition, which is imported and used during tool discovery.
const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'get_attachment_action_details', description: 'Get details for an attachment action by ID.', parameters: { type: 'object', properties: { id: { type: 'string', description: 'The unique identifier for the attachment action.' } }, required: ['actionId'] } } } }; export { apiTool }; - tools/paths.js:9-9 (registration)Entry in the toolPaths array that lists this tool file for dynamic loading by discoverTools.
'webex-public-workspace/webex-messaging/get-attachment-action-details.js', - lib/tools.js:7-16 (registration)The discoverTools function that dynamically loads and registers all apiTools, including this one, from the listed paths.
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); }