create_person
Create a new person in Webex with details like name, email, phone, and roles. Set location, department, and manager for streamlined user management.
Instructions
Create a new person in Webex.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addresses | No | The addresses associated with the person. | |
| avatar | No | The avatar URL for the person. | |
| department | No | The department of the person. | |
| displayName | No | The display name of the person. | |
| emails | Yes | The email addresses associated with the person. | |
| extension | No | The extension number for the person. | |
| firstName | Yes | The first name of the person. | |
| lastName | Yes | The last name of the person. | |
| licenses | No | The licenses associated with the person. | |
| locationId | No | The location ID for the person. | |
| manager | No | The name of the manager for the person. | |
| managerId | No | The manager ID for the person. | |
| orgId | No | The organization ID for the person. | |
| phoneNumbers | No | The phone numbers associated with the person. | |
| roles | No | The roles assigned to the person. | |
| siteUrls | No | The site URLs associated with the person. | |
| title | No | The title of the person. |
Implementation Reference
- Handler function that executes the create_person tool by making a POST request to Webex API to create a new person.const executeFunction = async (personData) => { try { const url = getWebexUrl('/people?callingData=true&minResponse=true'); const headers = { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}`, 'Accept': 'application/json' }; const response = await fetch(url, { method: 'POST', headers, body: JSON.stringify(personData) }); 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 person:', error); return { error: 'An error occurred while creating the person.' }; } };
- Tool schema definition including name, description, and detailed input parameters schema for validation.type: 'function', function: { name: 'create_person', description: 'Create a new person in Webex.', parameters: { type: 'object', properties: { emails: { type: 'array', items: { type: 'string' }, description: 'The email addresses associated with the person.' }, phoneNumbers: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, value: { type: 'string' } } }, description: 'The phone numbers associated with the person.' }, extension: { type: 'string', description: 'The extension number for the person.' }, locationId: { type: 'string', description: 'The location ID for the person.' }, displayName: { type: 'string', description: 'The display name of the person.' }, firstName: { type: 'string', description: 'The first name of the person.' }, lastName: { type: 'string', description: 'The last name of the person.' }, avatar: { type: 'string', description: 'The avatar URL for the person.' }, orgId: { type: 'string', description: 'The organization ID for the person.' }, roles: { type: 'array', items: { type: 'string' }, description: 'The roles assigned to the person.' }, licenses: { type: 'array', items: { type: 'string' }, description: 'The licenses associated with the person.' }, department: { type: 'string', description: 'The department of the person.' }, manager: { type: 'string', description: 'The name of the manager for the person.' }, managerId: { type: 'string', description: 'The manager ID for the person.' }, title: { type: 'string', description: 'The title of the person.' }, addresses: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, country: { type: 'string' }, locality: { type: 'string' }, region: { type: 'string' }, streetAddress: { type: 'string' }, postalCode: { type: 'string' } } }, description: 'The addresses associated with the person.' }, siteUrls: { type: 'array', items: { type: 'string' }, description: 'The site URLs associated with the person.' } }, required: ['emails', 'firstName', 'lastName'] } } } };
- The apiTool object exported from the tool file, which is imported and used in tool discovery.const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'create_person', description: 'Create a new person in Webex.', parameters: { type: 'object', properties: { emails: { type: 'array', items: { type: 'string' }, description: 'The email addresses associated with the person.' }, phoneNumbers: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, value: { type: 'string' } } }, description: 'The phone numbers associated with the person.' }, extension: { type: 'string', description: 'The extension number for the person.' }, locationId: { type: 'string', description: 'The location ID for the person.' }, displayName: { type: 'string', description: 'The display name of the person.' }, firstName: { type: 'string', description: 'The first name of the person.' }, lastName: { type: 'string', description: 'The last name of the person.' }, avatar: { type: 'string', description: 'The avatar URL for the person.' }, orgId: { type: 'string', description: 'The organization ID for the person.' }, roles: { type: 'array', items: { type: 'string' }, description: 'The roles assigned to the person.' }, licenses: { type: 'array', items: { type: 'string' }, description: 'The licenses associated with the person.' }, department: { type: 'string', description: 'The department of the person.' }, manager: { type: 'string', description: 'The name of the manager for the person.' }, managerId: { type: 'string', description: 'The manager ID for the person.' }, title: { type: 'string', description: 'The title of the person.' }, addresses: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, country: { type: 'string' }, locality: { type: 'string' }, region: { type: 'string' }, streetAddress: { type: 'string' }, postalCode: { type: 'string' } } }, description: 'The addresses associated with the person.' }, siteUrls: { type: 'array', items: { type: 'string' }, description: 'The site URLs associated with the person.' } }, required: ['emails', 'firstName', 'lastName'] } } } }; export { apiTool };
- lib/tools.js:7-16 (registration)Central tool registration/discovery function that dynamically loads apiTool from all tool files, including create-a-person.js.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:1-54 (registration)List of all tool file paths used for discovery, explicitly including the create-a-person.js file.export const toolPaths = [ 'webex-public-workspace/webex-messaging/delete-a-message.js', 'webex-public-workspace/webex-messaging/get-event-details.js', 'webex-public-workspace/webex-messaging/list-teams.js', 'webex-public-workspace/webex-messaging/delete-a-membership.js', 'webex-public-workspace/webex-messaging/get-room-details.js', 'webex-public-workspace/webex-messaging/delete-a-room-tab.js', 'webex-public-workspace/webex-messaging/get-membership-details.js', 'webex-public-workspace/webex-messaging/get-attachment-action-details.js', 'webex-public-workspace/webex-messaging/delete-a-team-membership.js', 'webex-public-workspace/webex-messaging/delete-a-person.js', 'webex-public-workspace/webex-messaging/create-a-team.js', 'webex-public-workspace/webex-messaging/delete-a-webhook.js', 'webex-public-workspace/webex-messaging/list-room-tabs.js', 'webex-public-workspace/webex-messaging/get-my-own-details.js', 'webex-public-workspace/webex-messaging/get-message-details.js', 'webex-public-workspace/webex-messaging/get-room-tab-details.js', 'webex-public-workspace/webex-messaging/update-a-team-membership.js', 'webex-public-workspace/webex-messaging/get-room-meeting-details.js', 'webex-public-workspace/webex-messaging/list-ecm-folder.js', 'webex-public-workspace/webex-messaging/update-a-team.js', 'webex-public-workspace/webex-messaging/unlink-an-ecm-linked-folder.js', 'webex-public-workspace/webex-messaging/list-webhooks.js', 'webex-public-workspace/webex-messaging/delete-a-room.js', 'webex-public-workspace/webex-messaging/delete-a-team.js', 'webex-public-workspace/webex-messaging/get-ecm-folder-details.js', 'webex-public-workspace/webex-messaging/get-team-membership-details.js', 'webex-public-workspace/webex-messaging/list-direct-messages.js', 'webex-public-workspace/webex-messaging/get-person-details.js', 'webex-public-workspace/webex-messaging/list-team-memberships.js', 'webex-public-workspace/webex-messaging/create-a-room-tab.js', 'webex-public-workspace/webex-messaging/get-team-details.js', 'webex-public-workspace/webex-messaging/edit-a-message.js', 'webex-public-workspace/webex-messaging/get-webhook-details.js', 'webex-public-workspace/webex-messaging/list-events.js', 'webex-public-workspace/webex-messaging/update-a-person.js', 'webex-public-workspace/webex-messaging/create-a-team-membership.js', 'webex-public-workspace/webex-messaging/create-a-membership.js', 'webex-public-workspace/webex-messaging/update-a-membership.js', 'webex-public-workspace/webex-messaging/update-a-room-tab.js', 'webex-public-workspace/webex-messaging/create-an-ecm-folder-configuration.js', 'webex-public-workspace/webex-messaging/create-a-webhook.js', 'webex-public-workspace/webex-messaging/list-memberships.js', 'webex-public-workspace/webex-messaging/create-an-attachment-action.js', 'webex-public-workspace/webex-messaging/update-a-room.js', 'webex-public-workspace/webex-messaging/create-a-room.js', 'webex-public-workspace/webex-messaging/create-a-message.js', 'webex-public-workspace/webex-messaging/update-a-webhook.js', 'webex-public-workspace/webex-messaging/list-rooms.js', 'webex-public-workspace/webex-messaging/update-an-ecm-linked-folder.js', 'webex-public-workspace/webex-messaging/list-messages.js', 'webex-public-workspace/webex-messaging/list-people.js', 'webex-public-workspace/webex-messaging/create-a-person.js' ];