n8n_delete_variable
Remove a variable from n8n automation workflows. Note: This action breaks any workflows currently using the deleted variable.
Instructions
Delete a variable.
⚠️ WARNING: Workflows using this variable will break!
Args:
id (string): Variable ID to delete
Returns: Confirmation of deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier of the resource |
Implementation Reference
- src/tools/variables.ts:170-199 (handler)The implementation of the 'n8n_delete_variable' tool. It registers the tool with the MCP server, defines its schema, and calls the 'del' service function to delete the variable.
server.registerTool( 'n8n_delete_variable', { title: 'Delete n8n Variable', description: `Delete a variable. ⚠️ WARNING: Workflows using this variable will break! Args: - id (string): Variable ID to delete Returns: Confirmation of deletion.`, inputSchema: IdParamSchema, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false } }, async (params: z.infer<typeof IdParamSchema>) => { await del(`/variables/${params.id}`); return { content: [{ type: 'text', text: `✅ Variable ${params.id} deleted successfully.` }], structuredContent: { deleted: true, id: params.id } }; } );