Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

Get Credential Schema

n8n_get_credential_schema
Read-onlyIdempotent

Retrieve the required and optional fields for a specific credential type in n8n, enabling proper credential setup before automation workflows.

Instructions

Get the schema/fields required for a credential type.

Args:

  • credentialType (string): The credential type (e.g., "slackApi", "httpBasicAuth")

Returns: JSON schema showing required and optional fields for the credential type.

Use this before creating credentials to know what data fields are needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
credentialTypeYesThe credential type to get schema for (e.g., "slackApi")

Implementation Reference

  • The handler function for n8n_get_credential_schema which fetches and formats the credential schema.
      async (params: z.infer<typeof CredentialSchemaRequestSchema>) => {
        const schema = await get<N8nCredentialSchema>(`/credentials/schema/${params.credentialType}`);
        
        const properties = Object.entries(schema.properties || {}).map(([key, value]) => {
          const required = schema.required?.includes(key) ? '(required)' : '(optional)';
          return `  - ${key} ${required}: ${value.type}${value.description ? ` - ${value.description}` : ''}`;
        }).join('\n');
        
        const text = `**Credential Schema: ${params.credentialType}**\n\nFields:\n${properties}`;
        
        return {
          content: [{ type: 'text', text }],
          structuredContent: schema
        };
      }
    );
  • Registration of the n8n_get_credential_schema tool.
      // ============ Get Credential Schema ============
      server.registerTool(
        'n8n_get_credential_schema',
        {
          title: 'Get Credential Schema',
          description: `Get the schema/fields required for a credential type.
    
    Args:
      - credentialType (string): The credential type (e.g., "slackApi", "httpBasicAuth")
    
    Returns:
      JSON schema showing required and optional fields for the credential type.
    
    Use this before creating credentials to know what data fields are needed.`,
          inputSchema: CredentialSchemaRequestSchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },
Behavior4/5

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

Annotations already indicate this is a read-only, idempotent, non-destructive operation. The description adds valuable context by explaining the return value ('JSON schema showing required and optional fields') and the tool's role in the credential creation workflow. It doesn't contradict annotations and provides useful behavioral details beyond what annotations cover.

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 well-structured and front-loaded with the core purpose. It uses three concise sentences: one for the purpose, one for the return value, and one for usage guidance. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's simplicity (one parameter, 100% schema coverage, rich annotations), the description is complete. It explains the purpose, return format, and usage context. While there's no output schema, the description adequately covers what the tool does and when to use it, making it sufficient for an agent to invoke 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?

The input schema has 100% description coverage, fully documenting the single parameter. The description adds minimal semantic value beyond the schema, only restating the parameter name and providing an example ('e.g., "slackApi", "httpBasicAuth"'). This meets the baseline score of 3 for high schema coverage.

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 tool's purpose: 'Get the schema/fields required for a credential type.' It specifies the verb ('Get') and resource ('schema/fields'), and distinguishes it from sibling tools like 'n8n_create_credential' by focusing on schema retrieval rather than creation. The description is specific and avoids tautology.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use this before creating credentials to know what data fields are needed.' This clearly indicates when to use the tool (as a prerequisite for credential creation) and implicitly distinguishes it from alternatives like 'n8n_create_credential' or 'n8n_list_credentials' by focusing on schema discovery.

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