Skip to main content
Glama

search_invoices

Find and filter invoices in Autotask using criteria like company ID, invoice number, or voided status to manage billing records.

Instructions

Search for invoices in Autotask with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIDNoFilter by company ID
invoiceNumberNoFilter by invoice number
isVoidedNoFilter by voided status
pageSizeNoNumber of results to return (default: 25, max: 500)

Implementation Reference

  • Core handler implementation for the search_invoices tool. Performs the actual API query to list invoices from Autotask using the autotask-node client, with logging and error handling.
    async searchInvoices(options: AutotaskQueryOptions = {}): Promise<AutotaskInvoice[]> { const client = await this.ensureClient(); try { this.logger.debug('Searching invoices with options:', options); const result = await client.invoices.list(options as any); return (result.data as AutotaskInvoice[]) || []; } catch (error) { this.logger.error('Failed to search invoices:', error); throw error; } }
  • Registers the search_invoices tool in the MCP tools list returned by listTools(), including full input schema definition for parameters like companyID, invoiceNumber, isVoided, and pageSize.
    name: 'search_invoices', description: 'Search for invoices in Autotask with optional filters', inputSchema: { type: 'object', properties: { companyID: { type: 'number', description: 'Filter by company ID' }, invoiceNumber: { type: 'string', description: 'Filter by invoice number' }, isVoided: { type: 'boolean', description: 'Filter by voided status' }, pageSize: { type: 'number', description: 'Number of results to return (default: 25, max: 500)', minimum: 1, maximum: 500 } }, required: [] } },
  • Input schema definition for the search_invoices tool, specifying object type with optional properties for filtering invoices.
    name: 'search_invoices', description: 'Search for invoices in Autotask with optional filters', inputSchema: { type: 'object', properties: { companyID: { type: 'number', description: 'Filter by company ID' }, invoiceNumber: { type: 'string', description: 'Filter by invoice number' }, isVoided: { type: 'boolean', description: 'Filter by voided status' }, pageSize: { type: 'number', description: 'Number of results to return (default: 25, max: 500)', minimum: 1, maximum: 500 } }, required: [] } },
  • MCP tool dispatcher in callTool method that handles search_invoices calls by invoking AutotaskService.searchInvoices and formatting the result message.
    case 'search_invoices': result = await this.autotaskService.searchInvoices(args); message = `Found ${result.length} invoices`; break;

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

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