Skip to main content
Glama

get-tag

Retrieve a specific tag by ID from n8n workflows using the MCP server for secure integration with Large Language Models.

Instructions

Retrieve a specific tag by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • Executes the 'get-tag' tool by retrieving the N8nClient instance and calling its getTag method to fetch the tag by ID, returning the JSON stringified result.
    case "get-tag": {
      const { clientId, id } = args as { clientId: string; id: 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.getTag(id);
        return {
          content: [{
            type: "text",
            text: 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:759-769 (registration)
    Registers the 'get-tag' tool in the list of available tools, including its name, description, and input schema.
      name: "get-tag",
      description: "Retrieve a specific tag by ID.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "string" }
        },
        required: ["clientId", "id"]
      }
    },
  • Defines the input schema for the 'get-tag' tool, requiring clientId and id.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" },
        id: { type: "string" }
      },
      required: ["clientId", "id"]
    }
  • N8nClient method that makes the API request to retrieve a tag by ID.
    async getTag(id: string): Promise<N8nTag> {
      return this.makeRequest<N8nTag>(`/tags/${id}`);
  • TypeScript interface defining the structure of a N8nTag returned by the getTag method.
    interface N8nTag {
      id: string;
      name: string;
      createdAt?: string;
      updatedAt?: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states it retrieves a tag without disclosing behavioral traits like permissions needed, error handling, or response format. It mentions 'by ID' which adds some context but lacks details on what happens if the ID is invalid or if authentication is required.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key action and resource. There is no wasted text, making it appropriately sized for its purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a read operation with 2 required parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or how parameters interact, leaving significant gaps for an AI agent to understand usage fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but only implies 'ID' as a parameter without explaining 'clientId'. It adds minimal meaning beyond the schema, which documents two required string parameters but without descriptions. Baseline is 3 due to low coverage and partial compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('a specific tag'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'list-tags' or 'get-workflow-tags', which would require specifying it fetches a single tag by ID rather than multiple tags.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'list-tags' for multiple tags or 'get-workflow-tags' for workflow-related tags. The description implies usage by ID but doesn't explicitly state prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/illuminaresolutions/n8n-mcp-server'

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