delete-credential
Remove stored credentials from the n8n automation platform by ID to manage access control and maintain security.
Instructions
Delete a credential by ID. You must be the owner of the credentials.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes |
Implementation Reference
- src/index.ts:1526-1556 (handler)MCP server tool handler for 'delete-credential'. Validates client, calls N8nClient.deleteCredential(id), and returns success or error response.case "delete-credential": { const { clientId, id } = args as { clientId: string; id: 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 result = await client.deleteCredential(id); return { content: [{ type: "text", text: `Successfully deleted credential:\n${JSON.stringify(result, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:369-373 (helper)N8nClient method implementing the delete credential API call via DELETE /credentials/{id}.async deleteCredential(id: string): Promise<any> { return this.makeRequest(`/credentials/${id}`, { method: 'DELETE', }); }
- src/index.ts:665-676 (registration)Tool registration in the ListTools response, defining name, description, and input schema requiring clientId and id.{ name: "delete-credential", description: "Delete a credential by ID. You must be the owner of the credentials.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] } },
- src/index.ts:668-675 (schema)Input schema for delete-credential tool, specifying clientId and credential id as required string parameters.inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] }