n8n_check_connection
Verify API key validity and test connectivity to the n8n automation platform instance.
Instructions
Test the connection to the n8n instance.
Verifies that the API key is valid and the n8n instance is reachable.
Returns:
connected: Whether connection is successful
error: Error message if connection failed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/api-client.ts:152-161 (handler)The core logic for checking the n8n connection, which attempts to fetch a single workflow to verify API connectivity and credentials.
export const checkConnection = async (): Promise<{ connected: boolean; version?: string; error?: string }> => { try { // Try to get workflows as a connection test await get('/workflows', { limit: 1 }); return { connected: true }; } catch (error) { const message = error instanceof Error ? error.message : 'Unknown error'; return { connected: false, error: message }; } }; - src/tools/audit-utils.ts:72-100 (registration)Registration of the 'n8n_check_connection' tool in the MCP server, which invokes the `checkConnection` service function.
server.registerTool( 'n8n_check_connection', { title: 'Check n8n Connection', description: `Test the connection to the n8n instance. Verifies that the API key is valid and the n8n instance is reachable. Returns: - connected: Whether connection is successful - error: Error message if connection failed`, inputSchema: EmptySchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async () => { const result = await checkConnection(); const text = result.connected ? '✅ Successfully connected to n8n!' : `❌ Connection failed: ${result.error}`; return { content: [{ type: 'text', text }], structuredContent: result