Skip to main content
Glama

n8n_health_check

Verify n8n instance connectivity and validate API credentials to ensure proper integration with Cursor IDE's workflow management capabilities.

Instructions

Check the connection to the n8n instance and verify API credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'n8n_health_check' tool. It initializes the N8nApiClient, performs a health check, and returns a formatted response indicating connection status.
    private async handleHealthCheck(): Promise<ToolResult> { try { const client = this.initializeApiClient(); const result = await client.healthCheck(); return { content: [ { type: 'text' as const, text: JSON.stringify({ status: result.status, apiUrl: process.env.N8N_API_URL, message: result.status === 'connected' ? 'Successfully connected to n8n instance' : `Connection failed: ${result.version}`, }, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text' as const, text: JSON.stringify({ status: 'error', apiUrl: process.env.N8N_API_URL || 'Not configured', message: errorMessage, }, null, 2), }, ], isError: true, }; } }
  • Dispatch logic in handleToolCall method that routes 'n8n_health_check' calls to the dedicated handleHealthCheck function.
    if (name === 'n8n_health_check') { return this.handleHealthCheck(); }
  • Tool schema/definition including name, description, and empty input schema (no parameters required).
    name: 'n8n_health_check', description: 'Check the connection to the n8n instance and verify API credentials.', inputSchema: { type: 'object', properties: {}, }, },
  • Registration of the tool via aggregation into allTools array, which includes executionTools containing 'n8n_health_check'.
    export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];
  • Supporting healthCheck method in N8nApiClient that verifies API connectivity by attempting to list workflows.
    /** * Check n8n API connectivity */ async healthCheck(): Promise<{ status: string; version?: string }> { try { // Try to list workflows with limit 1 to verify connection await this.request<N8nListResponse<N8nWorkflow>>('/workflows?limit=1'); return { status: 'connected' }; } catch (error) { return { status: 'error', version: error instanceof Error ? error.message : 'Unknown error' }; } }

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/alicankiraz1/cursor-n8n-builder'

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