Skip to main content
Glama

getProjectPeople

Retrieve team members assigned to a specific project, with options to filter by role, search names, and organize results.

Instructions

Get all people assigned to a specific project from Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the project to get people from
userTypeNoFilter by user type
searchTermNoFilter by name or email
orderModeNoOrder mode
orderByNoOrder by field
pageSizeNoNumber of items per page
pageNoPage number
includeObserversNoInclude project observers

Implementation Reference

  • The main tool handler function. Validates input (especially projectId), calls the teamworkService.getProjectPeople, handles the response by JSON stringifying it, and returns as text content. Includes logging and error handling.
    export async function handleGetProjectPeople(input: any) {
      logger.info('=== getProjectPeople tool called ===');
      logger.info(`Input parameters: ${JSON.stringify(input || {})}`);
      
      try {
        if (!input.projectId) {
          logger.error('Missing required parameter: projectId');
          return {
            content: [{
              type: "text",
              text: "Error: Missing required parameter 'projectId'"
            }]
          };
        }
        
        const projectId = parseInt(input.projectId, 10);
        if (isNaN(projectId)) {
          logger.error(`Invalid projectId: ${input.projectId}`);
          return {
            content: [{
              type: "text",
              text: `Error: Invalid projectId. Must be a number.`
            }]
          };
        }
        
        // Extract projectId from input and create a new params object without it
        const { projectId: _, ...params } = input;
        
        logger.info(`Calling teamworkService.getProjectPeople(${projectId})`);
        const people = await teamworkService.getProjectPeople(projectId, params);
        
        // Debug the response
        logger.info(`Project people response type: ${typeof people}`);
        
        if (people === null || people === undefined) {
          logger.warn(`No people found for project ID ${projectId} or API returned empty response`);
          return {
            content: [{
              type: "text",
              text: `No people found for project ID ${projectId} or API returned empty response.`
            }]
          };
        }
        
        try {
          const jsonString = JSON.stringify(people, null, 2);
          logger.info(`Successfully stringified project people response`);
          logger.info('=== getProjectPeople 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, 'Retrieving project people');
      }
    } 
  • The tool schema definition, including name, description, detailed inputSchema with properties like projectId (required), userType, searchTerm, pagination, etc., and annotations.
    export const getProjectPeopleDefinition = {
      name: "getProjectPeople",
      description: "Get all people assigned to a specific project from Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "integer",
            description: "The ID of the project to get people from"
          },
          userType: {
            type: "string",
            enum: ["account", "collaborator", "contact"],
            description: "Filter by user type"
          },
          searchTerm: {
            type: "string",
            description: "Filter by name or email"
          },
          orderMode: {
            type: "string",
            enum: ["asc", "desc"],
            description: "Order mode"
          },
          orderBy: {
            type: "string",
            enum: ["name", "namecaseinsensitive", "company"],
            description: "Order by field"
          },
          pageSize: {
            type: "integer",
            description: "Number of items per page"
          },
          page: {
            type: "integer",
            description: "Page number"
          },
          includeObservers: {
            type: "boolean",
            description: "Include project observers"
          }
        },
        required: ["projectId"]
      },
      annotations: {
        title: "Get People in a Project",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of the getProjectPeople tool in the toolPairs array, pairing the definition and handler for inclusion in toolDefinitions and toolHandlersMap.
    { definition: getProjectPeople, handler: handleGetProjectPeople },
  • Helper service function called by the tool handler. Makes the actual API request to Teamwork's /projects/{projectId}/people.json endpoint and returns the data.
    export const getProjectPeople = async (projectId: number, params?: Omit<PeopleQueryParams, 'projectId'>) => {
      try {
        logger.info(`Fetching people for project ID ${projectId} from Teamwork API`);
        
        const api = ensureApiClient();
        const response = await api.get(`/projects/${projectId}/people.json`, { params });
        logger.info(`Successfully fetched people for project ID ${projectId}`);
        return response.data;
      } catch (error: any) {
        logger.error(`Teamwork API error: ${error.message}`);
        throw new Error(`Failed to fetch people for project ID ${projectId} from Teamwork API`);
      }
    };
Behavior3/5

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

Annotations indicate readOnlyHint=false, destructiveHint=false, and openWorldHint=false, covering basic safety and scope. The description adds no behavioral context beyond the purpose—no mention of pagination behavior (implied by page/pageSize), rate limits, authentication needs, or what 'people' includes (e.g., roles, permissions). With annotations present, the bar is lower, but the description adds minimal value beyond them.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. It could be slightly more structured by hinting at filtering options, but it avoids redundancy and stays focused.

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 moderate complexity (8 parameters, filtering, ordering, pagination) and lack of output schema, the description is minimally adequate. It states what the tool does but doesn't cover return values, error cases, or usage nuances. With annotations providing safety context, it meets a basic threshold but leaves gaps for effective agent 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%, with all 8 parameters well-documented in the schema itself. The description adds no parameter-specific information beyond implying filtering by project. Baseline is 3 since the schema does the heavy lifting, and no additional semantics are provided.

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 verb ('Get') and resource ('all people assigned to a specific project from Teamwork'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'getPeople' (which appears to fetch all people) or 'getProjectPerson' (singular), leaving some ambiguity about scope.

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 'getPeople' or 'getProjectPerson'. It mentions no prerequisites, exclusions, or specific contexts, leaving the agent to infer usage from the name and parameters alone.

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