get_tag
Retrieve a specific tag by its ID from n8n workflows to organize and categorize automation processes.
Instructions
Get a specific tag by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:515-518 (handler)MCP server handler method for the 'get_tag' tool. Extracts the tag ID from arguments and delegates to N8nClient.getTag, then formats the response.private async handleGetTag(args: { id: string | number }) { const tag = await this.n8nClient.getTag(args.id); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(tag), null, 2) }] }; }
- src/index.ts:302-303 (registration)Dispatch case in CallToolRequestHandler that routes 'get_tag' tool calls to the handleGetTag method.case 'get_tag': return await this.handleGetTag(request.params.arguments as { id: string | number });
- src/index.ts:203-203 (schema)Tool registration in ListToolsResponse including name, description, and input schema requiring an 'id' (string or number).{ name: 'get_tag', description: 'Get a specific tag by ID', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/n8n-client.ts:628-631 (helper)Core N8nClient method implementing the API call to retrieve a specific tag by ID from the n8n /api/v1/tags/{id} endpoint.async getTag(id: string | number): Promise<N8nTag> { const response = await this.api.get<N8nApiResponse<N8nTag>>(`/tags/${id}`); return response.data.data; }