Skip to main content
Glama

getProjectPerson

Read-onlyIdempotent

Retrieve people records from a Teamwork project, enabling filtering by user type, company, team, and activity status to manage project members effectively.

Instructions

Returns one or more people on a project. Retrieve a person(s) record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesPath parameter: projectId
personIdYesPath parameter: personId
userTypeNouser type
updatedAfterNodate time
searchTermNofilter by comment content
orderModeNoorder mode
orderByNoorder by
lastLoginAfterNoQuery parameter: lastLoginAfter
pageSizeNonumber of items in a page (not used when generating reports)
pageNopage number (not used when generating reports)
skipCountsNoSkipCounts allows you to skip doing counts on a list API endpoint for performance reasons.
showDeletedNoinclude deleted items
searchUserJobRoleNoInclude user job role in search
orderPrioritiseCurrentUserNoForce to have the current/session user in the response
onlySiteOwnerNoQuery parameter: onlySiteOwner
onlyOwnerCompanyNoreturn people only from the owner company. This will replace any provided company ID.
inclusiveFilterNomake the filter inclusive for user ids, teamIds, companyIds
includeServiceAccountsNoinclude service accounts
includePlaceholdersNoinclude placeholder users
includeCollaboratorsNoexclude collaborators types, returning only account and contact.
includeClientsNoinclude clients
filterByNoCostRateNoReturns users who are missing cost rates(OCA only)
excludeContactsNoexclude contact types, returning only account and collaborator.
teamIdsNoteam ids
projectIdsNofilter by project ids
includeNoinclude (not used when generating reports)
idsNofilter by user ids
fieldsTeamsNoQuery parameter: fields[teams]
fieldsPersonNoQuery parameter: fields[person]
fieldsPeopleNoQuery parameter: fields[people]
fieldsCompaniesNoQuery parameter: fields[companies]
fieldsProjectPermissionsNoQuery parameter: fields[ProjectPermissions]
excludeProjectIdsNoexclude people assigned to certain project id
excludeIdsNoexclude certain user ids
companyIdsNocompany ids

Implementation Reference

  • The handler function that executes the tool logic. It processes input parameters, maps fields for the API, calls the underlying service, and returns the response as JSON text or an error.
    export async function handleGetProjectPerson(input: any) {
      logger.info("Calling getProjectPersonService()");
    
      const apiInput: Record<string, any> = { ...input };
    
      const fieldMappings: Record<string, string> = {
        fieldsTeams: "fields[teams]",
        fieldsPerson: "fields[person]",
        fieldsPeople: "fields[people]",
        fieldsCompanies: "fields[companies]",
        fieldsProjectPermissions: "fields[ProjectPermissions]",
      };
    
      for (const [camelCaseKey, apiKey] of Object.entries(fieldMappings)) {
        if (apiInput[camelCaseKey] !== undefined) {
          apiInput[apiKey] = apiInput[camelCaseKey];
          delete apiInput[camelCaseKey];
        }
      }
    
      try {
        const response = await getProjectPersonService({
          projectId: apiInput.projectId,
          personId: apiInput.personId,
          ...apiInput
        });
        logger.info("getProjectPersonService response received");
        return {
          content: [{
            type: "text",
            text: JSON.stringify(response, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Retrieving project person');
      }
    } 
  • The tool schema definition including inputSchema with all parameters, required fields (projectId, personId), description, and annotations.
    export const getProjectPersonDefinition = {
      name: "getProjectPerson",
      description: "Returns one or more people on a project. Retrieve a person(s) record.",
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'integer',
            description: 'Path parameter: projectId'
          },
          personId: {
            type: 'integer',
            description: 'Path parameter: personId'
          },
          userType: {
            type: 'string',
            description: 'user type',
            enum: [
              'account',
              'collaborator',
              'contact'
            ]
          },
          updatedAfter: {
            type: 'string',
            description: 'date time'
          },
          searchTerm: {
            type: 'string',
            description: 'filter by comment content'
          },
          orderMode: {
            type: 'string',
            description: 'order mode',
            enum: [
              'asc',
              'desc'
            ]
          },
          orderBy: {
            type: 'string',
            description: 'order by',
            enum: [
              'name',
              'namecaseinsensitive',
              'company'
            ]
          },
          lastLoginAfter: {
            type: 'string',
            description: 'Query parameter: lastLoginAfter'
          },
          pageSize: {
            type: 'integer',
            description: 'number of items in a page (not used when generating reports)'
          },
          page: {
            type: 'integer',
            description: 'page number (not used when generating reports)'
          },
          skipCounts: {
            type: 'boolean',
            description: 'SkipCounts allows you to skip doing counts on a list API endpoint for performance reasons.'
          },
          showDeleted: {
            type: 'boolean',
            description: 'include deleted items'
          },
          searchUserJobRole: {
            type: 'boolean',
            description: 'Include user job role in search'
          },
          orderPrioritiseCurrentUser: {
            type: 'boolean',
            description: 'Force to have the current/session user in the response'
          },
          onlySiteOwner: {
            type: 'boolean',
            description: 'Query parameter: onlySiteOwner'
          },
          onlyOwnerCompany: {
            type: 'boolean',
            description: 'return people only from the owner company. This will replace any provided company ID.'
          },
          inclusiveFilter: {
            type: 'boolean',
            description: 'make the filter inclusive for user ids, teamIds, companyIds'
          },
          includeServiceAccounts: {
            type: 'boolean',
            description: 'include service accounts'
          },
          includePlaceholders: {
            type: 'boolean',
            description: 'include placeholder users'
          },
          includeCollaborators: {
            type: 'boolean',
            description: 'exclude collaborators types, returning only account and contact.'
          },
          includeClients: {
            type: 'boolean',
            description: 'include clients'
          },
          filterByNoCostRate: {
            type: 'boolean',
            description: 'Returns users who are missing cost rates(OCA only)'
          },
          excludeContacts: {
            type: 'boolean',
            description: 'exclude contact types, returning only account and collaborator.'
          },
          teamIds: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'team ids'
          },
          projectIds: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'filter by project ids'
          },
          include: {
            type: 'array',
            items: {
              type: 'string'
            },
            description: 'include (not used when generating reports)'
          },
          ids: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'filter by user ids'
          },
          fieldsTeams: {
            type: 'array',
            description: 'Query parameter: fields[teams]',
            items: {
              type: 'string',
              enum: [
                "id",
                "name",
                "teamLogo",
                "teamLogoIcon",
                "teamLogoColor"
              ]
            }
          },
          fieldsPerson: {
            type: 'array',
            description: 'Query parameter: fields[person]',
            items: {
              type: 'string',
              enum: [
                "id",
                "firstName",
                "lastName",
                "title",
                "email",
                "companyId",
                "company",
                "isAdmin",
                "isClientUser",
                "isServiceAccount",
                "type",
                "deleted",
                "avatarUrl",
                "lengthOfDay",
                "workingHoursId",
                "workingHour",
                "userRate",
                "userCost",
                "canAddProjects"
              ]
            }
          },
          fieldsPeople: {
            type: 'array',
            description: 'Query parameter: fields[people]',
            items: {
              type: 'string',
              enum: [
                "id",
                "firstName",
                "lastName",
                "title",
                "email",
                "companyId",
                "company",
                "isAdmin",
                "isClientUser",
                "isServiceAccount",
                "type",
                "deleted",
                "avatarUrl",
                "lengthOfDay",
                "workingHoursId",
                "workingHour",
                "userRate",
                "userCost",
                "canAddProjects"
              ]
            }
          },
          fieldsCompanies: {
            type: 'array',
            description: 'Query parameter: fields[companies]',
            items: {
              type: 'string',
              enum: [
                "id",
                "name",
                "logoUploadedToServer",
                "logoImage"
              ]
            }
          },
          fieldsProjectPermissions: {
            type: 'array',
            description: 'Query parameter: fields[ProjectPermissions]',
            items: {
              type: 'string',
              enum: [
                "viewMessagesAndFiles",
                "viewTasksAndMilestones",
                "viewTime",
                "viewNotebooks",
                "viewRiskRegister",
                "viewEstimatedTime",
                "viewInvoices",
                "addTasks",
                "addRisks",
                "manageCustomFields",
                "addExpenses",
                "editAllTasks",
                "addMilestones",
                "addTaskLists",
                "addMessages",
                "addFiles",
                "addTime",
                "addNotebooks",
                "viewLinks",
                "addLinks",
                "canViewForms",
                "addForms",
                "viewAllTimeLogs",
                "setPrivacy",
                "projectAdministrator",
                "viewProjectUpdate",
                "addProjectUpdate",
                "canViewProjectMembers",
                "canViewProjectBudget",
                "canManageProjectBudget",
                "canViewRates",
                "canManageRates",
                "canViewSchedule",
                "canManageSchedule",
                "receiveEmailNotifications",
                "isObserving",
                "isArchived",
                "active",
                "canAccess",
                "inOwnerCompany",
                "canManagePeople",
                "canViewProjectTemplates",
                "canManageProjectTemplates"
              ]
            }
          },
          excludeProjectIds: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'exclude people assigned to certain project id'
          },
          excludeIds: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'exclude certain user ids'
          },
          companyIds: {
            type: 'array',
            items: {
              type: 'integer'
            },
            description: 'company ids'
          }
        },
        required: [
          'projectId',
          'personId'
        ]
      },
      annotations: {
        title: "Get a Person(s) on a Project",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      }
    };
  • Registration of the getProjectPerson tool in the toolPairs array, pairing the definition and handler for use in the tools system.
    { definition: getProjectPerson, handler: handleGetProjectPerson },
  • The service function called by the tool handler, which makes the actual API call to retrieve project person data from Teamwork API.
    export async function getProjectPerson(params: GetProjectPersonPathParams & QueryParams) {
      const api = getApiClientForVersion('v3');
      
      const { projectId, personId, ...queryParams } = params;
    
      logger.debug(`Making GET request to /projects/${projectId}/people/${personId}.json with params: ${JSON.stringify(queryParams)}`);
    
      try {
        const response = await api.get(`/projects/${projectId}/people/${personId}.json`, { params: queryParams });
        return response.data;
      } catch (error: any) {
        if (error.response) {
            logger.error(`Error fetching project person: Status ${error.response.status} - ${JSON.stringify(error.response.data)}`);
        } else if (error.request) {
            logger.error(`Error fetching project person: No response received - ${error.request}`);
        } else {
            logger.error(`Error fetching project person: ${error.message}`);
        }
        throw new Error(`Failed to fetch project person from Teamwork API: ${error.message}`);
      }
    }
    
    export default getProjectPerson; 
Behavior3/5

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

Annotations already provide key behavioral hints: readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false. The description adds minimal context beyond this, stating it 'returns' or 'retrieves' people, which aligns with the annotations. However, it does not disclose additional traits like pagination behavior (implied by page/pageSize parameters), rate limits, or authentication needs, leaving gaps in behavioral understanding.

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

Conciseness4/5

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

The description is concise and front-loaded with two clear sentences: 'Returns one or more people on a project. Retrieve a person(s) record.' It avoids unnecessary words and efficiently states the core functionality. However, the second sentence is somewhat redundant with the first, slightly reducing efficiency.

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 the tool's complexity (35 parameters, no output schema) and rich annotations, the description is minimally adequate. It states the purpose but lacks details on return values (no output schema), error conditions, or advanced usage scenarios. While annotations cover safety and idempotency, the description does not fully address the tool's scope and limitations, leaving room for improvement in guiding effective use.

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%, so the schema fully documents all 35 parameters. The description adds no parameter-specific information beyond what the schema provides, such as explaining how parameters interact (e.g., personId for single vs. multiple retrievals) or clarifying ambiguous terms. With high schema coverage, the baseline score of 3 is appropriate, as the description does not compensate but also does not detract.

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 states the tool's purpose clearly: 'Returns one or more people on a project. Retrieve a person(s) record.' It specifies the verb ('returns', 'retrieve'), resource ('people on a project'), and scope ('one or more'), but does not explicitly differentiate it from sibling tools like getPeople or getPersonById, which handle people more broadly rather than specifically on a project.

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. It does not mention sibling tools like getPeople (for general people retrieval) or getProjectPeople (which appears similar), nor does it specify prerequisites such as needing a valid projectId. Usage is implied only by the tool name and description, with no explicit context or exclusions.

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