Skip to main content
Glama

generate-audit

Generate security audits for n8n instances to identify vulnerabilities in credentials, database, nodes, filesystem, and instance configurations.

Instructions

Generate a security audit for your n8n instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
daysAbandonedWorkflowNo
categoriesNo

Implementation Reference

  • Handler function that executes the generate-audit tool by calling N8nClient.generateAudit and returning the audit results.
    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
        };
      }
    }
  • Input schema defining parameters for the generate-audit tool: clientId (required), optional daysAbandonedWorkflow and categories.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" },
        daysAbandonedWorkflow: { type: "number" },
        categories: {
          type: "array",
          items: {
            type: "string",
            enum: ["credentials", "database", "nodes", "filesystem", "instance"]
          }
        }
      },
      required: ["clientId"]
    }
  • src/index.ts:830-848 (registration)
    Registration of the generate-audit tool in the listTools response, including name, description, and inputSchema.
    {
      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 performs the actual API call to generate the audit report via POST /audit.
    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,
          },
        }),
      });
    }

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

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