Skip to main content
Glama

generate-audit

Perform a security audit for your n8n instance by analyzing credentials, database, nodes, filesystem, and instance configurations to identify potential vulnerabilities.

Instructions

Generate a security audit for your n8n instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoriesNo
clientIdYes
daysAbandonedWorkflowNo

Implementation Reference

  • MCP tool handler for 'generate-audit': retrieves the N8nClient instance and calls its generateAudit method with the provided options, returning the audit result as JSON or an error.
    case "generate-audit": {
      const { clientId, daysAbandonedWorkflow, categories } = args as {
        clientId: string;
        daysAbandonedWorkflow?: number;
        categories?: Array<'credentials' | 'database' | 'nodes' | 'filesystem' | 'instance'>;
      };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const audit = await client.generateAudit({ daysAbandonedWorkflow, categories });
        return {
          content: [{
            type: "text",
            text: JSON.stringify(audit, null, 2),
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • src/index.ts:831-848 (registration)
    Tool registration in the listTools response, defining name, description, and input schema for 'generate-audit'.
      name: "generate-audit",
      description: "Generate a security audit for your n8n instance.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          daysAbandonedWorkflow: { type: "number" },
          categories: {
            type: "array",
            items: {
              type: "string",
              enum: ["credentials", "database", "nodes", "filesystem", "instance"]
            }
          }
        },
        required: ["clientId"]
      }
    }
  • N8nClient method that implements the core logic: POST request to n8n's /audit endpoint with options to generate the security audit report.
    async generateAudit(options: {
      daysAbandonedWorkflow?: number;
      categories?: Array<'credentials' | 'database' | 'nodes' | 'filesystem' | 'instance'>;
    } = {}): Promise<N8nAuditResult> {
      return this.makeRequest<N8nAuditResult>('/audit', {
        method: 'POST',
        body: JSON.stringify({
          additionalOptions: {
            daysAbandonedWorkflow: options.daysAbandonedWorkflow,
            categories: options.categories,
          },
        }),
      });
    }
  • TypeScript interface defining the expected structure of the audit result object returned by the n8n /audit API.
    interface N8nAuditResult {
      'Credentials Risk Report'?: any;
      'Database Risk Report'?: any;
      'Filesystem Risk Report'?: any;
      'Nodes Risk Report'?: any;
      'Instance Risk Report'?: any;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool generates an audit but doesn't describe what the output looks like (e.g., report format, data included), whether it's a read-only operation, if it requires specific permissions, or any side effects (e.g., logging, notifications). This leaves significant gaps for an agent to understand how to use it effectively.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence contributes to understanding the tool's function.

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

Completeness2/5

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

Given the complexity of a security audit tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't address key aspects like what the audit checks, how results are returned, or the meaning of parameters. For a tool that likely produces detailed security insights, this minimal description leaves too much undefined for effective use.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the three parameters (categories, clientId, daysAbandonedWorkflow) are documented in the schema. The description adds no information about these parameters—it doesn't explain what 'categories' includes, what 'clientId' refers to, or how 'daysAbandonedWorkflow' affects the audit. With low coverage, the description fails to compensate, leaving parameters largely unexplained.

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

Purpose4/5

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

The description clearly states the action ('generate') and the resource ('security audit for your n8n instance'), providing a specific purpose. It distinguishes itself from sibling tools which focus on CRUD operations for workflows, credentials, users, etc., rather than security auditing. However, it doesn't explicitly mention what the audit entails or its scope beyond 'security'.

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, frequency, or typical use cases (e.g., compliance checks, security reviews). With many sibling tools for managing n8n resources, there's no indication of how this tool fits into broader workflows or when it should be invoked.

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

Related 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/fellipesaraiva88/n8n-mcp-server'

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