get-credential-schema
Retrieve the schema for a specific credential type to identify required fields for credential creation. Use credential type names like 'cloudflareApi' or 'slackOAuth2Api' found in the n8n UI.
Instructions
Show credential data schema for a specific credential type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). This will show you what fields are required for creating credentials of this type.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| credentialTypeName | Yes |
Implementation Reference
- src/index.ts:1558-1588 (handler)Handler for executing the 'get-credential-schema' tool. Retrieves the credential schema for the given credentialTypeName using the N8nClient instance and returns it as formatted JSON.case "get-credential-schema": { const { clientId, credentialTypeName } = args as { clientId: string; credentialTypeName: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const schema = await client.getCredentialSchema(credentialTypeName); return { content: [{ type: "text", text: JSON.stringify(schema, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:680-687 (schema)Input schema definition for the 'get-credential-schema' tool, specifying clientId and credentialTypeName as required string parameters.inputSchema: { type: "object", properties: { clientId: { type: "string" }, credentialTypeName: { type: "string" } }, required: ["clientId", "credentialTypeName"] }
- src/index.ts:677-688 (registration)Registration of the 'get-credential-schema' tool in the list of available tools returned by ListToolsRequestHandler, including name, description, and input schema.{ name: "get-credential-schema", description: "Show credential data schema for a specific credential type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). This will show you what fields are required for creating credentials of this type.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, credentialTypeName: { type: "string" } }, required: ["clientId", "credentialTypeName"] } },
- src/index.ts:375-377 (helper)N8nClient helper method that makes an API request to retrieve the schema for a specific credential type from the n8n server.async getCredentialSchema(credentialTypeName: string): Promise<any> { return this.makeRequest(`/credentials/schema/${credentialTypeName}`); }