Skip to main content
Glama

resolve_credential_alias

Convert credential aliases to their corresponding IDs for use in n8n workflow automation and credential management operations.

Instructions

Resolve a credential alias to its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesThe credential alias/name to resolve

Implementation Reference

  • MCP tool handler method that takes an alias, calls N8nClient.resolveCredentialAlias, and returns the resolved credential ID in the standard MCP response format.
    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 the listTools response, including name, description, and input schema definition.
    { 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'], }, },
  • Input schema definition for the resolve_credential_alias tool, specifying the 'alias' parameter.
    { 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'], }, },
  • Core helper method in N8nClient that implements the resolution logic: lists all credentials, filters by name matching the alias, handles no-match or multiple-match errors, and returns the credential 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(); }

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