Skip to main content
Glama

create_asset_folder

Organize assets by creating a new folder in a Storyblok space; specify a parent folder ID to nest it under an existing folder.

Instructions

Create a new asset folder in the current Storyblok space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the new asset folder
parent_idNoID of the parent folder (if nested)

Implementation Reference

  • Handler function for the 'create_asset_folder' tool. Accepts 'name' (required) and 'parent_id' (optional) parameters. Constructs a payload and POSTs to '/asset_folders/' via apiPost. Returns the API response as JSON.
    // Tool: create_asset_folder
    server.tool(
      'create_asset_folder',
      'Create a new asset folder in the current Storyblok space.',
      {
        name: z.string().describe('Name of the new asset folder'),
        parent_id: z.number().optional().describe('ID of the parent folder (if nested)'),
      },
      async ({ name, parent_id }) => {
        try {
          const payload: { asset_folder: { name: string; parent_id?: number } } = {
            asset_folder: { name },
          };
          if (parent_id !== undefined) {
            payload.asset_folder.parent_id = parent_id;
          }
    
          const data = await apiPost('/asset_folders/', payload);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Input schema for 'create_asset_folder': name (z.string, required) and parent_id (z.number, optional). Defined inline in the server.tool() call using Zod.
    {
      name: z.string().describe('Name of the new asset folder'),
      parent_id: z.number().optional().describe('ID of the parent folder (if nested)'),
    },
  • Registration call: registerAssetsFolders(server) is invoked in the registerAllTools function, which wires up all tools including 'create_asset_folder' to the MCP server.
    registerAssetsFolders(server);
  • Import of the registerAssetsFolders function from './assets-folder.js' in the tool aggregator index.
    import { registerAssetsFolders } from './assets-folder.js';
  • The apiPost helper function used by the handler to make the POST request to the Storyblok Management API.
    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);
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It only states 'create' which implies mutation, but it doesn't disclose idempotency, permissions needed, or side effects. A create operation should at least hint that it changes state, but more context is needed.

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 sentence that is front-loaded with the key information. No unnecessary words or fluff.

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?

For a creation tool with no output schema, the description is incomplete. It doesn't explain the return value (e.g., folder ID), error conditions (e.g., duplicate name), or behavior (e.g., whether it can be done from any subfolder). The agent lacks crucial context for successful invocation.

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%, so the schema already describes both parameters adequately. The description adds no extra meaning beyond what the schema provides. Baseline score of 3 is appropriate.

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 action (create), resource (asset folder), and context (current Storyblok space). It effectively distinguishes from sibling tools like update_asset_folder, delete_asset_folder, and fetch_asset_folder.

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 on when to use this tool versus alternatives. For example, it doesn't mention that folder creation requires an existing space or how it relates to other folder-related tools like bulk_move_assets. No prerequisites or postconditions are stated.

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