Skip to main content
Glama

delete_branch

Delete a branch from a Storyblok space by providing its numeric ID, removing the pipeline permanently.

Instructions

Deletes a branch (pipeline) by its ID in a Storyblok space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_idYesNumeric ID of the branch to delete

Implementation Reference

  • The delete_branch tool handler: calls apiDelete on /branches/{branch_id} to delete a branch by its numeric ID, then returns the JSON response.
    // Tool: delete_branch
    server.tool(
      'delete_branch',
      'Deletes a branch (pipeline) by its ID in a Storyblok space.',
      {
        branch_id: z.number().describe('Numeric ID of the branch to delete'),
      },
      async ({ branch_id }) => {
        try {
          const data = await apiDelete(`/branches/${branch_id}`);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Input schema for delete_branch: requires a numeric branch_id.
    {
      branch_id: z.number().describe('Numeric ID of the branch to delete'),
    },
  • Registration: registerBranches is imported from pipelines.ts and called in registerAllTools to register all branch tools including delete_branch.
    import { registerBranches } from './pipelines.js';
    import { registerPresets } from './presets.js';
    import { registerReleases } from './releases.js';
    import { registerSchedulingStories } from './scheduling-stories.js';
    import { registerSpace } from './space.js';
    import { registerSpaceRoles } from './space-roles.js';
    import { registerTasks } from './tasks.js';
    import { registerWebhooks } from './webhooks.js';
    import { registerWorkflows } from './workflows.js';
    import { registerWorkflowStages } from './workflow-stage.js';
    import { registerWorkflowStageChanges } from './workflow-stage-changes.js';
    import { registerComponents } from './components.js';
    import { registerComponentsFolder } from './components-folder.js';
    import { registerAssets } from './assets.js';
    import { registerAssetsFolders } from './assets-folder.js';
    import { registerStories } from './stories.js';
    import { registerDiscussions } from './discussions.js';
    import { registerExtensions } from './extensions.js';
    import { registerFieldPlugins } from './field-plugins.js';
    
    /**
     * Registers all tools with the MCP server
     */
    export function registerAllTools(server: McpServer): void {
      // Simple tools
      registerPing(server);
      registerMeta(server);
    
      // Tag management
      registerTags(server);
      registerInternalTags(server);
    
      // Access and authentication
      registerAccessTokens(server);
    
      // Activity tracking
      registerActivities(server);
    
      // Workflow management
      registerApprovals(server);
      registerWorkflows(server);
      registerWorkflowStages(server);
      registerWorkflowStageChanges(server);
    
      // Branch/Pipeline management
      registerBranches(server);
  • The apiDelete helper function used by delete_branch to make the DELETE HTTP request to the Storyblok Management API.
    export async function apiDelete<T = unknown>(path: string): Promise<T> {
      const url = buildManagementUrl(path);
      const response = await fetch(url, {
        method: 'DELETE',
        headers: getManagementHeaders(),
      });
      return handleResponse<T>(response, url);
    }
  • The createErrorResponse helper used by delete_branch to format error responses.
    export function createErrorResponse(
      error: unknown,
      errorCode?: string
    ): McpErrorResponse {
      const message = error instanceof Error ? error.message : String(error);
      const response: McpErrorResponse = {
        isError: true,
        content: [{ type: 'text', text: message }],
      };
    
      if (errorCode) {
        response.errorCode = errorCode;
        response.errorMessage = message;
      }
    
      return response;
    }
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 the action without disclosing side effects, required permissions, or what happens to associated data (e.g., stories, releases). This is insufficient for a destructive operation.

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, focused sentence with no redundant information. It is concise and front-loaded with the key action.

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

Completeness3/5

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

For a simple one-parameter tool with no output schema, the description provides the essential purpose. However, it lacks context on return values, error conditions, or safety checks, leaving some gaps for an agent.

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% for the single parameter 'branch_id', and the description adds 'by its ID' but does not provide additional semantics beyond what the schema already describes (numeric ID). Baseline 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 verb 'deletes' and the resource 'branch (pipeline)' and specifies the scope 'by its ID in a Storyblok space'. It effectively distinguishes from sibling tools like create_branch or update_branch.

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 when not to delete a branch (e.g., if it has active deployments) or any prerequisites like permissions. The description lacks usage context.

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