Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Get n8n Credential

n8n_get_credential
Read-onlyIdempotent

Retrieve metadata for a specific credential in n8n workflow automation, including ID, name, type, and timestamps, without exposing sensitive data.

Instructions

Get details of a specific credential (without sensitive data).

Args:

  • id (string): Credential ID

Returns: Credential metadata (id, name, type, timestamps). ⚠️ Credential data/secrets are NOT returned for security.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the resource

Implementation Reference

  • Implementation of the 'n8n_get_credential' tool handler.
      // ============ Get Credential ============
      server.registerTool(
        'n8n_get_credential',
        {
          title: 'Get n8n Credential',
          description: `Get details of a specific credential (without sensitive data).
    
    Args:
      - id (string): Credential ID
    
    Returns:
      Credential metadata (id, name, type, timestamps).
      ⚠️ Credential data/secrets are NOT returned for security.`,
          inputSchema: IdParamSchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },
        async (params: z.infer<typeof IdParamSchema>) => {
          const credential = await get<N8nCredential>(`/credentials/${params.id}`);
          
          return {
            content: [{ type: 'text', text: formatCredential(credential) }],
            structuredContent: credential
          };
        }
      );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this as read-only, non-destructive, and idempotent. The description adds valuable context beyond annotations by explicitly stating that 'Credential data/secrets are NOT returned for security' and specifying the returned metadata fields (id, name, type, timestamps). This provides important behavioral details about data filtering and response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement, parameter documentation in bullet points, and return value explanation with important security warning. Every sentence serves a distinct purpose with zero wasted words, and the security warning is appropriately emphasized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation with comprehensive annotations (readOnlyHint, idempotentHint, etc.), 100% schema coverage, and no output schema, the description provides complete context. It clearly explains what the tool does, what it returns (including specific fields and exclusions), and has appropriate security warnings - everything needed for an agent to use this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage (the 'id' parameter is fully documented in the schema), the baseline is 3. The description doesn't add any parameter-specific information beyond what's in the schema, but it doesn't need to since the schema already provides complete parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get details of a specific credential') and resource ('credential'), distinguishing it from sibling tools like 'n8n_list_credentials' (which lists multiple) and 'n8n_get_credential_schema' (which gets schema information). It explicitly notes the limitation 'without sensitive data' which further clarifies scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'a specific credential' and mentioning what data is excluded, but doesn't explicitly state when to use this versus alternatives like 'n8n_list_credentials' for browsing or 'n8n_get_credential_schema' for schema details. It provides clear context but lacks explicit comparison guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/DrBalls/n8n-mcp-server-v2'

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