Skip to main content
Glama

updatePerson

Update a person's details in Teamwork, including name, email, timezone, and role. Modify user information with specified fields.

Instructions

Update a person in Teamwork. This endpoint allows you to modify user information like timezone, name, email, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personIdYesThe ID of the person to update
first-nameNoFirst name of the person
last-nameNoLast name of the person
email-addressNoEmail address of the person
titleNoJob title or position of the person
phone-number-officeNoOffice phone number
timezoneIdNoTimezone ID for the person
administratorNoMake this person an administrator
user-typeNoUser type (account, collaborator, contact)
company-idNoID of the company the person belongs to

Implementation Reference

  • The main handler function for the updatePerson tool. Validates input, constructs the update payload (excluding personId), calls the service layer, and returns a formatted response.
    export async function handleUpdatePerson(input: any) {
      logger.info('Calling teamworkService.updatePerson()');
      logger.info(`Person ID: ${input.personId}`);
      
      try {
        const personId = input.personId;
        
        if (!personId) {
          throw new Error("Person ID is required");
        }
        
        // Create update data object with the person wrapper
        const updateData: { person: Record<string, any> } = {
          person: {}
        };
        
        // Copy all fields from input to updateData.person 
        // except personId which is used for the API path
        Object.keys(input).forEach(key => {
          if (key !== 'personId') {
            updateData.person[key] = input[key];
          }
        });
        
        // Make sure we're not sending an empty update
        if (Object.keys(updateData.person).length === 0) {
          throw new Error("At least one field to update must be provided");
        }
        
        logger.info(`Sending update data: ${JSON.stringify(updateData)}`);
        const result = await teamworkService.updatePerson(personId, updateData);
        logger.info(`Successfully updated person with ID: ${personId}`);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Updating person');
      }
    } 
  • The tool definition including name, description, inputSchema (with personId required and optional fields), and annotations.
    export const updatePersonDefinition = {
      name: "updatePerson",
      description: "Update a person in Teamwork. This endpoint allows you to modify user information like timezone, name, email, etc.",
      inputSchema: {
        type: 'object',
        properties: {
          personId: {
            type: 'integer',
            description: 'The ID of the person to update'
          },
          // Field names match the Swagger definition
          "first-name": {
            type: 'string',
            description: 'First name of the person'
          },
          "last-name": {
            type: 'string',
            description: 'Last name of the person'
          },
          "email-address": {
            type: 'string',
            description: 'Email address of the person'
          },
          "title": {
            type: 'string',
            description: 'Job title or position of the person'
          },
          "phone-number-office": {
            type: 'string',
            description: 'Office phone number'
          },
          "timezoneId": {
            type: 'integer',
            description: 'Timezone ID for the person'
          },
          "administrator": {
            type: 'boolean',
            description: 'Make this person an administrator'
          },
          "user-type": {
            type: 'string',
            description: 'User type (account, collaborator, contact)'
          },
          "company-id": {
            type: 'integer',
            description: 'ID of the company the person belongs to'
          }
        },
        required: ['personId']
      },
      annotations: {
        title: "Update a Person",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of the updatePerson tool in the toolPairs array, pairing its definition with its handler.
    { definition: updatePerson, handler: handleUpdatePerson },
  • Re-export of the handleUpdatePerson function from the tools index.
    export { handleUpdatePerson } from './people/updatePerson.js';
  • The service-layer helper that calls the Teamwork v1 API (PUT people/{personId}.json) with the update data.
    export const updatePerson = async (personId: number, updateData: any) => {
      try {
        logger.info(`Updating person with ID ${personId}`);
        logger.info(`Update data: ${JSON.stringify(updateData)}`);
        
        const api = getApiClientForVersion('v1');
        // Note: We use put because this is a v1 API endpoint (the base path is handled by the API client)
        const response = await api.put(`people/${personId}.json`, updateData);
        
        logger.info(`Successfully updated person with ID ${personId}`);
        return response.data;
      } catch (error: any) {
        logger.error(`Error updating person with ID ${personId}: ${error.message}`);
        throw new Error(`Failed to update person with ID ${personId}: ${error.message}`);
      }
    };
Behavior3/5

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

Annotations indicate the tool is not read-only and not destructive, which is consistent with an update operation. The description adds that it modifies user information but does not elaborate on side effects, error scenarios, or permission requirements. With annotations providing basic safety info, the description adds minimal behavioral context.

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 two short sentences with no extraneous information. Every word serves a purpose, making it highly concise and clear.

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?

Given 10 parameters with full schema descriptions and annotations, the description is adequate but lacks context on expected return value (e.g., updated object or success message) and any limitations (e.g., immutable fields). It covers the basics but could be improved.

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?

All 10 parameters have schema descriptions, so the description's mention of 'timezone, name, email, etc.' adds little beyond enumeration. The description does not clarify any parameter-specific constraints (e.g., valid formats, interdependent fields). Baseline 3 is appropriate given high schema coverage.

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 tool updates a person in Teamwork and lists examples of modifiable fields. However, it does not differentiate from sibling update tools (updateCompany, updateTask), which is acceptable as the resource is distinct.

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?

No guidance on when to use this tool vs alternatives, or under what conditions (e.g., required permissions, prerequisites). The description only states what it does, not when to use it.

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