create-tag
Add a new tag to organize and categorize workflows in your n8n instance. Specify the tag name and client ID to create custom labels for better workflow management.
Instructions
Create a new tag in your instance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| name | Yes |
Implementation Reference
- src/index.ts:1694-1724 (handler)Handler for the 'create-tag' tool execution. Validates client, calls N8nClient.createTag, and returns success or error response.case "create-tag": { const { clientId, name } = args as { clientId: 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.createTag(name); return { content: [{ type: "text", text: `Successfully created 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:737-744 (schema)Input schema definition for the 'create-tag' tool, specifying clientId and name parameters.inputSchema: { type: "object", properties: { clientId: { type: "string" }, name: { type: "string" } }, required: ["clientId", "name"] }
- src/index.ts:735-745 (registration)Registration of the 'create-tag' tool in the tools list returned by ListToolsRequest handler.name: "create-tag", description: "Create a new tag in your instance.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, name: { type: "string" } }, required: ["clientId", "name"] } },
- src/index.ts:299-304 (helper)N8nClient helper method that performs the actual API call to create a tag via POST /tags.async createTag(name: string): Promise<N8nTag> { return this.makeRequest<N8nTag>('/tags', { method: 'POST', body: JSON.stringify({ name }), }); }
- src/index.ts:79-84 (schema)TypeScript interface defining the structure of a N8nTag returned by the createTag API.interface N8nTag { id: string; name: string; createdAt?: string; updatedAt?: string; }