update-tag
Modify the name of an existing tag using the MCP server to ensure accurate and updated categorization within n8n workflows.
Instructions
Update a tag's name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes | ||
| name | Yes |
Implementation Reference
- src/index.ts:1790-1820 (handler)MCP tool handler for 'update-tag': validates client, calls N8nClient.updateTag(id, name), and returns success/error response with updated tag details.case "update-tag": { const { clientId, id, name } = args as { clientId: string; id: string; name: 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 tag = await client.updateTag(id, name); return { content: [{ type: "text", text: `Successfully updated tag:\n${JSON.stringify(tag, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
- src/index.ts:770-782 (registration)Tool registration in ListToolsRequestHandler: defines name, description, and inputSchema for 'update-tag'.{ name: "update-tag", description: "Update a tag's name.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" }, name: { type: "string" } }, required: ["clientId", "id", "name"] } },
- src/index.ts:773-781 (schema)Input schema definition for the update-tag tool, specifying required parameters: clientId, id, name.inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" }, name: { type: "string" } }, required: ["clientId", "id", "name"] }
- src/index.ts:317-322 (helper)N8nClient helper method implementing the core logic: sends PUT request to n8n API /tags/{id} with new name.async updateTag(id: string, name: string): Promise<N8nTag> { return this.makeRequest<N8nTag>(`/tags/${id}`, { method: 'PUT', body: JSON.stringify({ name }), }); }