Skip to main content
Glama

n8n_health_check

Verify connection and API credentials for n8n instance to ensure proper integration with workflow automation tools.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the n8n_health_check tool. Initializes API client, calls healthCheck, formats success/error response as MCP ToolResult.
    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, }; } }
  • Core health check implementation in N8nApiClient. Verifies connection by attempting to list workflows via API; returns status.
    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' }; } }
  • Tool schema definition: name, description, and empty inputSchema (no parameters required). Included in executionTools array for registration.
    { name: 'n8n_health_check', description: 'Check the connection to the n8n instance and verify API credentials.', inputSchema: { type: 'object', properties: {}, }, },
  • Aggregates all tool definitions including executionTools (which contains n8n_health_check) into allTools, used by server for ListTools.
    export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ]; // Re-export handlers export { workflowToolHandlers } from './workflow-tools'; export { executionToolHandlers } from './execution-tools'; export { documentationToolHandlers } from './documentation-tools'; // Combined handlers type export type AllToolHandlers = typeof workflowToolHandlers & typeof executionToolHandlers & typeof documentationToolHandlers;
  • Dispatch logic in handleToolCall that routes 'n8n_health_check' calls to the dedicated handler.
    if (name === 'n8n_health_check') { return this.handleHealthCheck(); }

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