Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

n8n_get_credential_schema

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
          }
        },

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