Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Check n8n Connection

n8n_check_connection
Read-onlyIdempotent

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 };
      }
    };
  • 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
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this as read-only, non-destructive, and idempotent. The description adds valuable context: it specifies what is being verified (API key validity and instance reachability) and describes the return structure (connected status and error message). This goes beyond the annotations by explaining the actual verification behavior and output format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly front-loaded with the core purpose in the first sentence. The second sentence elaborates on what is verified, and the third clearly outlines the return values. Every sentence adds essential information with zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is nearly complete. It explains the purpose, verification details, and return structure. The only minor gap is the lack of usage guidelines, but for a straightforward connection test, the description provides sufficient context for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are 0 parameters, and schema description coverage is 100% (empty schema). The description correctly indicates no parameters are needed ('Test the connection' implies no inputs). A baseline of 4 is appropriate for zero-parameter tools, as no additional parameter semantics are required.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Test the connection', 'Verifies that the API key is valid and the n8n instance is reachable'), identifies the resource ('n8n instance'), and distinguishes it from all sibling tools which perform CRUD operations on workflows, credentials, executions, etc. This is a distinct diagnostic tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., should this be run before other operations?), typical scenarios (e.g., after configuration changes), or what to do if the check fails. Usage is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/DrBalls/n8n-mcp-server-v2'

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