Skip to main content
Glama

create-credential

Create credentials for n8n workflow nodes to authenticate with external services like Cloudflare, GitHub, and Slack. Use get-credential-schema first to identify required fields.

Instructions

Create a credential that can be used by nodes of the specified type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). Use get-credential-schema first to see what fields are required for the credential type you want to create.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
nameYes
typeYes
dataYes

Implementation Reference

  • MCP tool handler for 'create-credential' that validates client existence, calls N8nClient.createCredential, and returns success or error response.
    case "create-credential": {
      const { clientId, name, type, data } = args as {
        clientId: string;
        name: string;
        type: string;
        data: Record<string, any>;
      };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const credential = await client.createCredential(name, type, data);
        return {
          content: [{
            type: "text",
            text: `Successfully created credential:\n${JSON.stringify(credential, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
  • N8nClient method that performs the actual POST request to n8n API /credentials endpoint to create a new credential.
    async createCredential(name: string, type: string, data: Record<string, any>): Promise<any> {
      return this.makeRequest('/credentials', {
        method: 'POST',
        body: JSON.stringify({
          name,
          type,
          data
        }),
      });
    }
  • Input schema definition for the create-credential tool, specifying required parameters: clientId, name, type, data.
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          name: { type: "string" },
          type: { type: "string" },
          data: { type: "object" }
        },
        required: ["clientId", "name", "type", "data"]
      }
    },
  • src/index.ts:652-664 (registration)
    Tool registration in the listTools response, including name, description, and inputSchema for create-credential.
      name: "create-credential",
      description: "Create a credential that can be used by nodes of the specified type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). Use get-credential-schema first to see what fields are required for the credential type you want to create.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          name: { type: "string" },
          type: { type: "string" },
          data: { type: "object" }
        },
        required: ["clientId", "name", "type", "data"]
      }
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that credentials are 'used by nodes of the specified type,' implying integration with workflows, but lacks details on permissions needed, whether creation is idempotent, error handling, or response format. This leaves gaps for a mutation tool.

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 front-loaded with the core purpose in the first sentence, followed by a practical example and a prerequisite step. Each sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness3/5

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

Given no annotations, 0% schema coverage, no output schema, and a mutation tool with nested objects, the description is incomplete. It covers purpose and usage well but lacks details on behavioral traits, full parameter semantics, and expected outcomes, leaving significant gaps for effective tool invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It explains 'type' with examples (e.g., 'cloudflareApi') and hints that 'data' contains required fields from get-credential-schema, but does not clarify 'clientId' or 'name' parameters. This partial coverage is insufficient for a tool with 4 required parameters.

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 ('Create a credential') and resource ('that can be used by nodes of the specified type'), distinguishing it from siblings like delete-credential or get-credential-schema. It provides concrete examples of credential types (e.g., 'cloudflareApi', 'githubApi'), making the purpose unambiguous.

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 explicitly states when to use this tool ('Create a credential') and when to use an alternative ('Use get-credential-schema first to see what fields are required'), providing clear guidance on prerequisites and distinguishing it from sibling tools like get-credential-schema.

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

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