test_connection
Verify connectivity to the Autotask API to ensure data access for contract analysis, ticket tracking, and project monitoring.
Instructions
Test the connection to Autotask API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/tool.handler.ts:42-50 (schema)Schema definition for the 'test_connection' tool, including name, description, and empty input schema (no parameters required). This is returned by listTools().{ name: 'test_connection', description: 'Test the connection to Autotask API', inputSchema: { type: 'object', properties: {}, required: [] } },
- src/handlers/tool.handler.ts:1068-1074 (handler)Handler dispatch in callTool() method: calls autotaskService.testConnection(), sets result and success message based on boolean return.case 'test_connection': const connectionResult = await this.autotaskService.testConnection(); result = { success: connectionResult }; message = connectionResult ? 'Successfully connected to Autotask API' : 'Connection failed: Unable to connect to Autotask API'; break;
- Core implementation of testConnection(): ensures client is initialized, attempts to fetch accounts.get(0) as connectivity test, returns true on success, false on failure with logging.async testConnection(): Promise<boolean> { try { const client = await this.ensureClient(); // Try to get account with ID 0 as a connection test const result = await client.accounts.get(0); this.logger.info('Connection test successful:', { hasData: !!result.data, resultType: typeof result }); return true; } catch (error) { this.logger.error('Connection test failed:', error); return false; } }