resolve_credential_alias
Convert credential aliases to their corresponding IDs for use in n8n workflow operations and API calls.
Instructions
Resolve a credential alias to its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alias | Yes | The credential alias/name to resolve |
Implementation Reference
- src/index.ts:577-587 (handler)MCP server handler for the resolve_credential_alias tool. Delegates to N8nClient and formats the JSON response.private async handleResolveCredentialAlias(args: { alias: string }) { const credentialId = await this.n8nClient.resolveCredentialAlias(args.alias); return { content: [ { type: 'text', text: JSON.stringify(jsonSuccess({ alias: args.alias, id: credentialId }), null, 2), }, ], }; }
- src/index.ts:168-181 (registration)Tool registration in ListToolsResponse including name, description, and input schema.{ name: 'resolve_credential_alias', description: 'Resolve a credential alias to its ID', inputSchema: { type: 'object', properties: { alias: { type: 'string', description: 'The credential alias/name to resolve', }, }, required: ['alias'], }, },
- src/index.ts:244-245 (handler)Dispatch handler in CallToolRequestHandler switch statement.case 'resolve_credential_alias': return await this.handleResolveCredentialAlias(request.params.arguments as { alias: string });
- src/n8n-client.ts:238-251 (helper)Core implementation that lists credentials and finds the one matching the alias by name, returning its ID.async resolveCredentialAlias(alias: string): Promise<string> { const credentials = await this.listCredentials(); const matches = credentials.filter(cred => cred.name === alias); if (matches.length === 0) { throw new Error(`No credential found with alias: ${alias}`); } if (matches.length > 1) { throw new Error(`Multiple credentials found with alias: ${alias}. Found ${matches.length} matches.`); } return matches[0].id!.toString(); }