Skip to main content
Glama

create_tag

Create a new tag in your Storyblok space and optionally associate it with a story using the Management API.

Instructions

Creates a new tag in a Storyblok space via the Management API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the tag
story_idNoOptional story ID to associate with the tag

Implementation Reference

  • Handler function for the 'create_tag' tool. Accepts 'name' (required) and 'story_id' (optional) parameters, builds a payload, POSTs to Storyblok Management API /tags/ endpoint, and returns the JSON response.
    // Tool: create_tag
    server.tool(
      'create_tag',
      'Creates a new tag in a Storyblok space via the Management API.',
      {
        name: z.string().describe('Name of the tag'),
        story_id: z.number().optional().describe('Optional story ID to associate with the tag'),
      },
      async ({ name, story_id }) => {
        try {
          const payload: { tag: { name: string; story_id?: number } } = {
            tag: { name },
          };
          if (story_id !== undefined) {
            payload.tag.story_id = story_id;
          }
          const data = await apiPost('/tags/', payload);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Input schema for 'create_tag' using Zod: 'name' is a required string, 'story_id' is an optional number.
    {
      name: z.string().describe('Name of the tag'),
      story_id: z.number().optional().describe('Optional story ID to associate with the tag'),
    },
  • Tool registration: registerTags is called from registerAllTools to register all tag tools including 'create_tag' on the MCP server.
    registerTags(server);
    registerInternalTags(server);
  • Helper function apiPost which makes POST requests to the Storyblok Management API. Used by the create_tag handler to send the tag creation request.
    export async function apiPost<T = unknown>(
      path: string,
      body: unknown
    ): Promise<T> {
      const url = buildManagementUrl(path);
      const response = await fetch(url, {
        method: 'POST',
        headers: getManagementHeaders(),
        body: JSON.stringify(body),
      });
      return handleResponse<T>(response, url);
    }
  • Helper function createJsonResponse which serializes data as JSON for the MCP response. Used by the create_tag handler to format the success response.
    export function createJsonResponse(data: unknown): McpSuccessResponse {
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It only states that it creates a tag, but does not mention failure modes, idempotency, required permissions, or whether the tag is created immediately or asynchronously.

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

Conciseness4/5

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

The description is a single, front-loaded sentence that efficiently states the tool's core function. It is concise without being overly sparse, though it could benefit from slightly more context.

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 simplicity of the tool (2 params, no output schema) and the presence of a similar sibling ('create_internal_tag'), the description is incomplete. It lacks details on return values, uniqueness constraints, and distinctions from sibling tools.

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 coverage is 100% with descriptions for both parameters. The tool description adds no additional meaning beyond the schema, so it meets the baseline of 3.

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

Purpose5/5

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

The description clearly states the verb 'Creates', the resource 'tag', and the context 'in a Storyblok space via the Management API'. It is specific and distinguishable from sibling tools like 'create_internal_tag'.

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 (e.g., 'create_internal_tag' vs. 'create_tag'). There is no mention of prerequisites or when-not-to-use.

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/hypescale/storyblok-mcp-server'

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