autotask_test_connection
Tests the API connection to Autotask to confirm that the server can communicate with your Autotask PSA instance.
Instructions
Test Autotask API connection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/tool.handler.ts:769-775 (handler)The main handler for autotask_test_connection. In the dispatch table, it calls AutotaskService.testConnection() and returns success/error.
['autotask_test_connection', async () => { const ok = await s.testConnection(); if (!ok) { throw new Error('Connection to Autotask API failed. Verify AUTOTASK_USERNAME, AUTOTASK_SECRET, and AUTOTASK_INTEGRATION_CODE are configured correctly and that the API user has at least read access to Companies.'); } return { result: { success: true }, message: 'Successfully connected to Autotask API' }; }], - Tool definition and input schema for autotask_test_connection (name, description, empty input schema).
{ name: 'autotask_test_connection', description: 'Test Autotask API connection', inputSchema: { type: 'object', properties: {}, required: [] } }, - src/handlers/tool.definitions.ts:3033-3036 (registration)Category registration - autotask_test_connection listed under the 'utility' category.
export const TOOL_CATEGORIES: Record<string, { description: string; tools: string[] }> = { utility: { description: 'Connection testing and field/picklist discovery', tools: ['autotask_test_connection', 'autotask_list_queues', 'autotask_list_ticket_statuses', 'autotask_list_ticket_priorities', 'autotask_get_field_info'] - The service-layer testConnection() method that performs the actual API probe via http.query.
async testConnection(): Promise<boolean> { try { const http = await this.ensureClient(); // Cheap probe: query Companies with a trivial filter. await http.query<AutotaskCompany>('Companies', MATCH_ALL, { maxRecords: 1 }); this.logger.info('Connection test successful'); return true; } catch (error) { this.logger.error('Connection test failed:', error); return false; } }