Skip to main content
Glama

deletePerson

Destructive

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`);
      }
    };
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true and readOnlyHint=false, but the description reinforces this by explicitly stating 'Delete' which implies permanent removal. However, it doesn't add behavioral context beyond what annotations provide, such as confirmation requirements, permissions needed, or irreversible consequences.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive operation with no output schema, the description is minimally adequate but lacks important context. It doesn't explain what happens after deletion, potential side effects, or error conditions. The annotations help, but the description could better address the tool's complexity and consequences.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'personId' well-documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a person from Teamwork'), providing specific verb+resource pairing. However, it doesn't differentiate from sibling tools like 'deleteCompany' or 'deleteTask' beyond the resource type, missing explicit sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'updatePerson' or 'getPersonById', nor does it mention prerequisites or exclusions. It's a basic statement of function without contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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