Skip to main content
Glama

deletePerson

Remove a person from Teamwork projects by specifying their ID to manage team access and permissions.

Instructions

Delete a person from Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personIdYesThe ID of the person to delete

Implementation Reference

  • The handler function that executes the deletePerson tool logic. It validates the input personId, calls the teamwork service to delete the person, handles the response, and returns formatted output or errors.
    export async function handleDeletePerson(input: any) { logger.info('=== deletePerson tool called ==='); logger.info(`Input parameters: ${JSON.stringify(input || {})}`); try { if (!input.personId) { logger.error('Missing required parameter: personId'); return { content: [{ type: "text", text: "Error: Missing required parameter 'personId'" }] }; } const personId = parseInt(input.personId, 10); if (isNaN(personId)) { logger.error(`Invalid personId: ${input.personId}`); return { content: [{ type: "text", text: `Error: Invalid personId. Must be a number.` }] }; } logger.info(`Calling teamworkService.deletePerson(${personId})`); const result = await teamworkService.deletePerson(personId); // Debug the response logger.info(`Delete person response type: ${typeof result}`); try { const jsonString = JSON.stringify(result || { success: true, message: "Person deleted successfully" }, null, 2); logger.info(`Successfully stringified response`); logger.info('=== deletePerson tool completed successfully ==='); return { content: [{ type: "text", text: jsonString }] }; } catch (jsonError: any) { logger.error(`JSON stringify error: ${jsonError.message}`); return { content: [{ type: "text", text: `Error formatting response: ${jsonError.message}` }] }; } } catch (error: any) { return createErrorResponse(error, 'Deleting person'); } }
  • The tool definition including name, description, input schema, and annotations for the deletePerson tool.
    export const deletePersonDefinition = { name: "deletePerson", description: "Delete a person from Teamwork", inputSchema: { type: "object", properties: { personId: { type: "integer", description: "The ID of the person to delete" } }, required: ["personId"] }, annotations: { title: "Delete Person", readOnlyHint: false, destructiveHint: true, openWorldHint: false } };
  • Registration of the deletePerson tool in the toolPairs array, pairing the definition with its handler.
    { definition: deletePerson, handler: handleDeletePerson },
  • The service helper function that performs the actual API call to delete a person from Teamwork.
    export const deletePerson = async (personId: number) => { try { logger.info(`Deleting person with ID ${personId} from Teamwork API`); const api = ensureApiClient(); const response = await api.delete(`/people/${personId}.json`); logger.info(`Successfully deleted person with ID ${personId}`); return response.data; } catch (error: any) { logger.error(`Teamwork API error: ${error.message}`); throw new Error(`Failed to delete person with ID ${personId} from Teamwork API`); } };

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/Vizioz/Teamwork-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server