Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • 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) }] };
  • 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 });
  • 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 }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get2knowio/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server