delete_variable
Remove variables from n8n workflows by specifying their ID to maintain clean workflow configurations and manage storage efficiently.
Instructions
Delete a variable by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:478-480 (handler)The main handler function for the 'delete_variable' tool. It calls the N8nClient's deleteVariable method with the provided ID and returns a standardized success response.private async handleDeleteVariable(args: { id: string }) { await this.n8nClient.deleteVariable(args.id); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess({ id: args.id }), null, 2) }] };
- src/index.ts:187-187 (schema)JSON schema defining the input for the 'delete_variable' tool, specifying a required 'id' string parameter.{ name: 'delete_variable', description: 'Delete a variable by ID', inputSchema: { type: 'object', properties: { id: { type: 'string' } }, required: ['id'] } },
- src/index.ts:285-286 (registration)Registration in the tool dispatch switch statement that maps 'delete_variable' calls to the handleDeleteVariable method.case 'delete_variable': return await this.handleDeleteVariable(request.params.arguments as { id: string });
- src/n8n-client.ts:728-731 (helper)Helper method in N8nClient that executes the HTTP DELETE request to the n8n API endpoint for deleting a variable by ID.async deleteVariable(id: string): Promise<{ ok: boolean }> { await this.api.delete(`/variables/${id}`); return { ok: true }; }