Skip to main content
Glama

webhook_urls

Retrieve webhook URLs for specific workflow nodes to enable external trigger configurations and API integrations within n8n automation workflows.

Instructions

Get webhook URLs for a webhook node in a workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYes
workflowIdYes

Implementation Reference

  • MCP server tool handler for 'webhook_urls' that resolves the workflow ID alias and delegates to N8nClient.getWebhookUrls
    private async handleWebhookUrls(args: { workflowId: string | number; nodeId: string }) { const workflowId = this.resolveWorkflowId(args.workflowId); const urls = await this.n8nClient.getWebhookUrls(workflowId, args.nodeId); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(urls), null, 2) }] }; }
  • src/index.ts:199-199 (registration)
    Registration of the 'webhook_urls' tool in the MCP server's listTools response, including input schema
    { name: 'webhook_urls', description: 'Get webhook URLs for a webhook node in a workflow', inputSchema: { type: 'object', properties: { workflowId: { oneOf: [{ type: 'string' }, { type: 'number' }] }, nodeId: { type: 'string' } }, required: ['workflowId', 'nodeId'] } },
  • Core handler logic in N8nClient that fetches the workflow, validates the webhook node, extracts the path parameter, and constructs testUrl and productionUrl
    async getWebhookUrls(workflowId: string | number, nodeId: string): Promise<N8nWebhookUrls> { const workflow = await this.getWorkflow(workflowId); const webhookNode = workflow.nodes.find((node) => node.id === nodeId); if (!webhookNode) throw new Error(`Node with ID '${nodeId}' not found in workflow ${workflowId}`); if (webhookNode.type !== 'n8n-nodes-base.webhook') { throw new Error(`Node '${nodeId}' is not a webhook node (type: ${webhookNode.type})`); } const path = webhookNode.parameters?.path || ''; if (!path) throw new Error(`Webhook node '${nodeId}' does not have a path configured`); const testUrl = `${this.baseUrl}/webhook-test/${path}`; const productionUrl = `${this.baseUrl}/webhook/${path}`; return { testUrl, productionUrl }; }
  • Type definition for the output of webhook_urls tool
    export interface N8nWebhookUrls { testUrl: string; productionUrl: string; }

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