get_credential_schema
Retrieve the JSON schema for a specific credential type to understand required fields and structure when configuring n8n workflow authentication.
Instructions
Get JSON schema for a credential type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| credentialTypeName | Yes | The name of the credential type |
Implementation Reference
- src/index.ts:434-437 (handler)MCP server handler function for the 'get_credential_schema' tool. Extracts credentialTypeName from arguments, calls N8nClient.getCredentialSchema, and returns JSON-formatted success response.private async handleGetCredentialSchema(args: { credentialTypeName: string }) { const schema = await this.n8nClient.getCredentialSchema(args.credentialTypeName); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(schema), null, 2) }] }; }
- src/index.ts:182-182 (registration)Registration of the 'get_credential_schema' tool in the MCP ListTools response, including name, description, and input schema definition.{ name: 'get_credential_schema', description: 'Get JSON schema for a credential type', inputSchema: { type: 'object', properties: { credentialTypeName: { type: 'string', description: 'The name of the credential type' } }, required: ['credentialTypeName'] } },
- src/n8n-client.ts:498-501 (helper)N8nClient helper method that performs the actual API call to retrieve the credential schema from the n8n server via GET /api/v1/credential-types/{credentialTypeName}.async getCredentialSchema(credentialTypeName: string): Promise<N8nCredentialSchema> { const response = await this.api.get<N8nApiResponse<N8nCredentialSchema>>(`/credential-types/${credentialTypeName}`); return response.data.data; }
- src/index.ts:182-182 (schema)Input schema definition for the 'get_credential_schema' tool, specifying a required 'credentialTypeName' string parameter.{ name: 'get_credential_schema', description: 'Get JSON schema for a credential type', inputSchema: { type: 'object', properties: { credentialTypeName: { type: 'string', description: 'The name of the credential type' } }, required: ['credentialTypeName'] } },