create_ecm_folder
Automate ECM folder configuration in Webex by linking folders to specific rooms, associating content URLs, and setting default folder preferences.
Instructions
Create an ECM folder configuration in Webex.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contentUrl | Yes | The URL of the content associated with the folder. | |
| defaultFolder | No | Whether this folder is the default folder. | |
| displayName | Yes | The display name for the folder. | |
| driveId | Yes | The ID of the drive where the folder is located. | |
| itemId | Yes | The ID of the item (folder) to be linked. | |
| roomId | Yes | The ID of the room where the folder will be linked. |
Implementation Reference
- The executeFunction is the core handler that sends a POST request to Webex API endpoint '/room/linkedFolders' to create the ECM folder configuration with the provided parameters.const executeFunction = async ({ roomId, contentUrl, displayName, driveId, itemId, defaultFolder = false }) => { const url = getWebexUrl('/room/linkedFolders'); const headers = getWebexJsonHeaders(); const body = JSON.stringify({ roomId, contentUrl, displayName, driveId, itemId, defaultFolder }); try { const response = await fetch(url, { method: 'POST', headers, body }); if (!response.ok) { const errorData = await response.json(); throw new Error(errorData); } const data = await response.json(); return data; } catch (error) { console.error('Error creating ECM folder configuration:', error); return { error: 'An error occurred while creating the ECM folder configuration.' }; } };
- The tool schema defining the name 'create_ecm_folder', description, input parameters with types and descriptions, and required fields.name: 'create_ecm_folder', description: 'Create an ECM folder configuration in Webex.', parameters: { type: 'object', properties: { roomId: { type: 'string', description: 'The ID of the room where the folder will be linked.' }, contentUrl: { type: 'string', description: 'The URL of the content associated with the folder.' }, displayName: { type: 'string', description: 'The display name for the folder.' }, driveId: { type: 'string', description: 'The ID of the drive where the folder is located.' }, itemId: { type: 'string', description: 'The ID of the item (folder) to be linked.' }, defaultFolder: { type: 'boolean', description: 'Whether this folder is the default folder.' } }, required: ['roomId', 'contentUrl', 'displayName', 'driveId', 'itemId'] } } }
- lib/tools.js:7-16 (registration)The discoverTools function dynamically imports all tool modules listed in toolPaths and extracts/registers their apiTool objects for use in the MCP server.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); }
- tools/paths.js:41-41 (registration)The specific path to this tool's file is included in the toolPaths array, enabling its discovery and registration by discoverTools().'webex-public-workspace/webex-messaging/create-an-ecm-folder-configuration.js',