Skip to main content
Glama

list_workflows

Retrieve and display all available n8n workflows for management through the MCP server interface.

Instructions

List all n8n workflows

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo

Implementation Reference

  • The primary handler method for the 'list_workflows' tool. It invokes the N8nClient.listWorkflows method, attaches numeric ID aliases to workflows for client convenience, and returns a formatted JSON response via the MCP content protocol.
    private async handleListWorkflows(args?: { limit?: number; cursor?: string }) { const workflows = await this.n8nClient.listWorkflows(args?.limit, args?.cursor); // attach aliases for each workflow in the list this.withAlias(workflows.data); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflows), null, 2) }] };
  • src/index.ts:69-69 (registration)
    Registration of the 'list_workflows' tool within the ListToolsRequestSchema response. Includes the tool name, description, and input schema definition.
    { name: 'list_workflows', description: 'List all n8n workflows', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
  • Input schema definition for the 'list_workflows' tool, specifying optional limit (number) and cursor (string) parameters.
    { name: 'list_workflows', description: 'List all n8n workflows', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
  • Supporting method in N8nClient that makes the actual HTTP GET request to the n8n /api/v1/workflows endpoint with optional pagination parameters, returning the list response.
    async listWorkflows(limit?: number, cursor?: string): Promise<N8nWorkflowsListResponse> { const params = new URLSearchParams(); if (limit) params.append('limit', limit.toString()); if (cursor) params.append('cursor', cursor); const url = params.toString() ? `/workflows?${params.toString()}` : '/workflows'; const response = await this.api.get<N8nWorkflowsListResponse>(url); return response.data; }

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

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