get_credential_schema
Retrieve JSON schema for specific credential types to understand required fields and structure when configuring n8n workflow credentials.
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)The main handler function for the MCP 'get_credential_schema' tool. It extracts the credentialTypeName from arguments, calls the N8nClient's getCredentialSchema method, and returns the result as a formatted JSON 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 server's tool list, including its 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)Helper method in N8nClient that performs the actual API call to retrieve the credential schema from n8n's /credential-types/{type} endpoint.async getCredentialSchema(credentialTypeName: string): Promise<N8nCredentialSchema> { const response = await this.api.get<N8nApiResponse<N8nCredentialSchema>>(`/credential-types/${credentialTypeName}`); return response.data.data; }
- src/index.ts:266-267 (registration)Dispatch case in the MCP CallToolRequest handler that routes 'get_credential_schema' calls to the specific handler method.case 'get_credential_schema': return await this.handleGetCredentialSchema(request.params.arguments as { credentialTypeName: string });