n8n_update_credential
Update existing credentials in n8n workflows by modifying names, data, or both to maintain secure automation connections.
Instructions
Update an existing credential.
Args:
id (string): Credential ID to update
name (string, optional): New credential name
data (object, optional): Updated credential data
Returns: The updated credential (without sensitive data).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Credential ID to update | |
| name | No | New credential name | |
| data | No | Updated credential data |
Implementation Reference
- src/tools/credentials.ts:151-181 (handler)The registration and handler implementation for the n8n_update_credential tool. It uses a patch request to update the credential.
server.registerTool( 'n8n_update_credential', { title: 'Update n8n Credential', description: `Update an existing credential. Args: - id (string): Credential ID to update - name (string, optional): New credential name - data (object, optional): Updated credential data Returns: The updated credential (without sensitive data).`, inputSchema: UpdateCredentialSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async (params: z.infer<typeof UpdateCredentialSchema>) => { const { id, ...updateData } = params; const credential = await patch<N8nCredential>(`/credentials/${id}`, updateData); return { content: [{ type: 'text', text: `✅ Credential updated!\n\n${formatCredential(credential)}` }], structuredContent: credential }; } ); - src/tools/credentials.ts:7-12 (schema)The schema definition import for the UpdateCredential tool.
UpdateCredentialSchema, ListCredentialsSchema, CredentialSchemaRequestSchema, IdParamSchema, TransferToProjectSchema } from '../schemas/index.js';