create_tag
Create and manage tags in n8n workflows to organize and categorize automation processes. Define tag names and colors for better workflow identification.
Instructions
Create a new tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| color | No |
Implementation Reference
- src/index.ts:204-204 (registration)Tool registration including name, description, and input schema for create_tag{ name: 'create_tag', description: 'Create a new tag', inputSchema: { type: 'object', properties: { name: { type: 'string' }, color: { type: 'string' } }, required: ['name'] } },
- src/index.ts:520-522 (handler)MCP tool handler that receives arguments, calls n8nClient.createTag, and returns formatted JSON responseprivate async handleCreateTag(args: { name: string; color?: string }) { const tag = await this.n8nClient.createTag(args); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(tag), null, 2) }] };
- src/index.ts:304-305 (handler)Switch case dispatching create_tag tool calls to the specific handler methodcase 'create_tag': return await this.handleCreateTag(request.params.arguments as { name: string; color?: string });
- src/n8n-client.ts:633-635 (helper)Core helper method that performs the actual POST request to n8n API endpoint /tags to create the tagasync createTag(tag: Omit<N8nTag, 'id' | 'createdAt' | 'updatedAt'>): Promise<N8nTag> { const response = await this.api.post<N8nApiResponse<N8nTag>>('/tags', tag); return response.data.data;