Skip to main content
Glama

autotask_search_contacts

Search contacts by name, email, or company ID. Optionally filter by active status and page size (max 200).

Instructions

Search contacts by name, email, or company. Max 200/page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchTermNoSearch term for contact name or email
companyIDNoFilter by company ID
isActiveNoFilter by active status (1=active, 0=inactive)
pageNo
pageSizeNoMax 200

Implementation Reference

  • Dispatch handler for 'autotask_search_contacts' - calls searchContacts on the AutotaskService
    ['autotask_search_contacts', async (a) => {
      const r = await s.searchContacts(a); return { result: r, message: `Found ${r.length} contacts` };
    }],
  • Schema/definition for 'autotask_search_contacts' tool with input parameters (searchTerm, companyID, isActive, page, pageSize)
    {
      name: 'autotask_search_contacts',
      description: 'Search contacts by name, email, or company. Max 200/page.',
      inputSchema: {
        type: 'object',
        properties: {
          searchTerm: {
            type: 'string',
            description: 'Search term for contact name or email'
          },
          companyID: {
            type: 'number',
            description: 'Filter by company ID'
          },
          isActive: {
            type: 'number',
            description: 'Filter by active status (1=active, 0=inactive)'
          },
          page: {
            type: 'number',
            
            minimum: 1
          },
          pageSize: {
            type: 'number',
            description: 'Max 200',
            minimum: 1,
            maximum: 200
          }
        },
        required: []
      }
    },
  • The actual service method that performs the Autotask API query to search contacts, building filters for searchTerm (firstName/lastName/email OR), companyID, and isActive
    async searchContacts(options: AutotaskQueryOptions = {}): Promise<AutotaskContact[]> {
      const http = await this.ensureClient();
      try {
        this.logger.debug('Searching contacts with options:', options);
    
        const filters: QueryFilter[] = [];
        if (options.searchTerm) {
          filters.push({
            op: 'or',
            items: [
              { op: 'contains', field: 'firstName', value: options.searchTerm },
              { op: 'contains', field: 'lastName', value: options.searchTerm },
              { op: 'contains', field: 'emailAddress', value: options.searchTerm }
            ]
          });
        }
        if (options.companyID !== undefined) {
          filters.push({ op: 'eq', field: 'companyID', value: options.companyID });
        }
        if (options.isActive !== undefined) {
          filters.push({ op: 'eq', field: 'isActive', value: options.isActive });
        }
    
        const pageSize = Math.min(options.pageSize || 25, 200);
        const contacts = await http.query<AutotaskContact>(
          'Contacts',
          filters.length > 0 ? filters : MATCH_ALL,
          { maxRecords: pageSize }
        );
    
        this.logger.info(`Retrieved ${contacts.length} contacts (pageSize ${pageSize})`);
        return contacts;
      } catch (error) {
        this.logger.error('Failed to search contacts:', error);
        throw error;
      }
    }
  • Type definition for AutotaskContact used by the searchContacts method
    export interface AutotaskContact {
      id?: number;
      companyID?: number;
      firstName?: string;
      lastName?: string;
      emailAddress?: string;
      phone?: string;
      title?: string;
      isActive?: number; // Note: autotask-node uses number, not boolean
      createDate?: string;
      lastModifiedDate?: string;
      [key: string]: any;
  • Registration of tools with the MCP server - calls toolHandler.listTools() and toolHandler.callTool()
    // List available tools
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      try {
        this.logger.debug('Handling list tools request');
        const tools = await toolHandler.listTools();
        return { tools };
      } catch (error) {
        this.logger.error('Failed to list tools:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to list tools: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    });
Behavior3/5

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

Discloses max 200 results per page. However, no info on read-only nature, pagination behavior, or response format. Without annotations, description carries full burden and is basic.

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?

Extremely concise single sentence with no fluff. Front-loads key information.

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?

Minimally adequate for a search tool with 5 params and no output schema. Doesn't specify return type or behavior on no results. Lacks details about pagination continuation or sorting.

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 coverage is 80%. Description adds 'by name, email, or company' but this may confuse since company is a separate parameter. Reinforces pageSize limit already in schema. Adds some context but not significantly beyond schema.

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?

Description clearly states it searches contacts by name, email, or company with a page limit. Verb 'Search' and resource 'contacts' are explicit, distinguishing it from sibling tools for other entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Context is clear: use for searching contacts. The max page size gives usage hint. No explicit alternatives mentioned, but sibling naming implies filtering.

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/wyre-technology/autotask-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server