Skip to main content
Glama

getProjectPeople

Retrieve all team members assigned to a project. Filter by user type, name, or company to find specific people.

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 tool handler function that validates input, calls the service, and formats the response for the getProjectPeople tool.
    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 definition including name, description, input schema (projectId required, plus optional filters), and annotations for the getProjectPeople tool.
    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 getProjectPeople in the tools array, pairing its definition with its handler.
    { definition: getProjectPeople, handler: handleGetProjectPeople },
  • Import of getProjectPeopleDefinition (aliased as getProjectPeople) and handleGetProjectPeople from the tool file.
    import { getProjectPeopleDefinition as getProjectPeople, handleGetProjectPeople } from './people/getProjectPeople.js';
  • The underlying service function that calls the Teamwork API to fetch people for a specific project.
    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`);
      }
    };
Behavior1/5

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

The description says 'Get' which implies a read-only operation, but annotations set readOnlyHint to false, indicating potential side effects. This contradiction undermines trust. No additional behavioral context like authentication needs or rate limits is provided.

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?

Single sentence, front-loaded with the main action, no extraneous words. Ideal conciseness.

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

Completeness2/5

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

No output schema is provided, and the description does not hint at return format or pagination. For a tool with 8 parameters including pagination and filters, the description lacks completeness.

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 parameters have clear descriptions in the schema, so the description adds no extra value. Baseline score of 3 is appropriate as schema coverage is 100%.

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

Purpose5/5

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

The description clearly states the tool retrieves all people assigned to a specific project, using specific verb 'Get' and resource 'people' scoped to a project. It distinguishes from sibling tools like getPeople (all people) and getPersonById (single person).

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 versus alternatives such as addPeopleToProject or getPeople. No context on prerequisites or limitations.

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