get_team_membership_details
Retrieve detailed information about a specific team membership in Webex using its unique ID to manage and verify user roles within teams.
Instructions
Get details for a team membership by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| membershipId | Yes | The unique identifier for the team membership. |
Implementation Reference
- The main handler function `executeFunction` that fetches team membership details from the Webex API endpoint `/team/memberships/{membershipId}` using a GET request, handles errors, and returns the data or error object.const executeFunction = async ({ membershipId }) => { try { // Construct the URL with the membership ID const url = getWebexUrl(`/team/memberships/${encodeURIComponent(membershipId)}`); // 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 team membership details:', error); return { error: 'An error occurred while fetching team membership details.' }; } };
- Input schema defining the required `membershipId` parameter as a string.parameters: { type: 'object', properties: { membershipId: { type: 'string', description: 'The unique identifier for the team membership.' } }, required: ['membershipId'] }
- The `apiTool` export that bundles the handler function, tool name 'get_team_membership_details', description, and schema. This is imported and registered dynamically via tools/paths.js and lib/tools.js.const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'get_team_membership_details', description: 'Get details for a team membership by ID.', parameters: { type: 'object', properties: { membershipId: { type: 'string', description: 'The unique identifier for the team membership.' } }, required: ['membershipId'] } } } }; export { apiTool };