Skip to main content
Glama

getPeople

Retrieve and filter people from Teamwork projects with options for user type, search terms, date ranges, and team or company filtering.

Instructions

Get all people from Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userTypeNoFilter by user type
updatedAfterNoFilter by users updated after this date-time (format: ISO 8601)
searchTermNoFilter by name or email
orderModeNoOrder mode
orderByNoOrder by field
lastLoginAfterNoFilter by users who logged in after this date-time
pageSizeNoNumber of items per page
pageNoPage number
includeCollaboratorsNoInclude collaborator users
includeClientsNoInclude client users
teamIdsNoFilter by team IDs
projectIdsNoFilter by project IDs
companyIdsNoFilter by company IDs

Implementation Reference

  • Handler function that executes the getPeople tool logic: logs input, calls teamworkService.getPeople, handles response by JSON stringifying it or error handling.
    export async function handleGetPeople(input: any) {
      logger.info('=== getPeople tool called ===');
      logger.info(`Query parameters: ${JSON.stringify(input || {})}`);
      
      try {
        logger.info('Calling teamworkService.getPeople()');
        const people = await teamworkService.getPeople(input);
        
        // Debug the response
        logger.info(`People response type: ${typeof people}`);
        
        if (people === null || people === undefined) {
          logger.warn('People response is null or undefined');
          return {
            content: [{
              type: "text",
              text: "No people found or API returned empty response."
            }]
          };
        }
        
        try {
          const jsonString = JSON.stringify(people, null, 2);
          logger.info(`Successfully stringified people response`);
          logger.info('=== getPeople 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 people');
      }
    } 
  • Tool definition including name, description, inputSchema with parameters for filtering people, and annotations.
    export const getPeopleDefinition = {
      name: "getPeople",
      description: "Get all people from Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          userType: {
            type: "string",
            enum: ["account", "collaborator", "contact"],
            description: "Filter by user type"
          },
          updatedAfter: {
            type: "string",
            description: "Filter by users updated after this date-time (format: ISO 8601)"
          },
          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"
          },
          lastLoginAfter: {
            type: "string",
            description: "Filter by users who logged in after this date-time"
          },
          pageSize: {
            type: "integer",
            description: "Number of items per page"
          },
          page: {
            type: "integer",
            description: "Page number"
          },
          includeCollaborators: {
            type: "boolean",
            description: "Include collaborator users"
          },
          includeClients: {
            type: "boolean",
            description: "Include client users"
          },
          teamIds: {
            type: "array",
            items: {
              type: "integer"
            },
            description: "Filter by team IDs"
          },
          projectIds: {
            type: "array",
            items: {
              type: "integer"
            },
            description: "Filter by project IDs"
          },
          companyIds: {
            type: "array",
            items: {
              type: "integer"
            },
            description: "Filter by company IDs"
          }
        }
      },
      annotations: {
        title: "Get People",
        readOnlyHint: false,
        destructiveHint: false,
        openWorldHint: false
      }
    };
  • Registration of the getPeople tool in the toolPairs array, associating definition and handler.
    { definition: getPeople, handler: handleGetPeople },
  • Import of getPeopleDefinition (as getPeople) and handleGetPeople from the people tool file.
    import { getPeopleDefinition as getPeople, handleGetPeople } from './people/getPeople.js';
  • Business logic helper function that makes the API call to Teamwork /people.json endpoint, used by the tool handler via teamworkService.
    export const getPeople = async (params?: PeopleQueryParams) => {
      try {
        logger.info('Fetching people from Teamwork API');
        
        const api = ensureApiClient();
        const response = await api.get('/people.json', { params });
        logger.info('Successfully fetched people');
        return response.data;
      } catch (error: any) {
        logger.error(`Teamwork API error: ${error.message}`);
        throw new Error('Failed to fetch people from Teamwork API');
      }
    };
Behavior3/5

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

Annotations already indicate this is non-destructive (destructiveHint: false) and not read-only (readOnlyHint: false), but the description adds no behavioral context beyond the basic 'Get' action. It doesn't mention pagination behavior (implied by page/pageSize parameters), rate limits, authentication requirements, or what 'all people' means in practice (e.g., across entire account vs. accessible subset).

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 immediately communicates the core functionality without unnecessary words. It's appropriately sized for a tool with comprehensive schema documentation and clear annotations.

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 tool with 13 parameters, no output schema, and only basic annotations, the description is minimal. While the schema handles parameter documentation well, the description doesn't address important contextual aspects like return format, pagination behavior, error conditions, or how this comprehensive people listing relates to more specific sibling tools.

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?

With 100% schema description coverage, all 13 parameters are well-documented in the schema itself. The description adds no parameter information beyond what's already in the structured fields - it doesn't explain how filters combine, default behaviors, or practical usage of the extensive filtering options.

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 ('Get') and resource ('all people from Teamwork'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'getPersonById' or 'getProjectPeople' which also retrieve people data with different scopes or filters.

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 'getPersonById' (for specific individuals) or 'getProjectPeople' (for people within projects). There's no mention of prerequisites, limitations, or typical use cases for this comprehensive people listing tool.

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