Skip to main content
Glama

list-projects

Retrieve all projects from n8n workflow automation platform. Requires Enterprise license with project management features enabled.

Instructions

List all projects from n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The main handler function for the 'list-projects' tool within the CallToolRequestSchema handler. It retrieves the N8nClient instance and calls listProjects() on it.
    case "list-projects": {
      const { clientId } = args as { clientId: string };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const projects = await client.listProjects();
        return {
          content: [{
            type: "text",
            text: JSON.stringify(projects.data, null, 2),
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Supporting method in N8nClient class that performs the API call to list projects.
    async listProjects(): Promise<N8nProjectList> {
      return this.makeRequest<N8nProjectList>('/projects');
    }
  • src/index.ts:508-517 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
      name: "list-projects",
      description: "List all projects from n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" }
        },
        required: ["clientId"]
      }
    },
  • TypeScript interface defining the structure of the projects list response from the n8n API.
    interface N8nProjectList {
      data: N8nProject[];
      nextCursor?: string;
    }
  • Input schema validation for the list-projects tool.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" }
      },
      required: ["clientId"]
    }

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