Skip to main content
Glama

delete_component

Delete a component from your Storyblok space by providing its unique ID. Remove unused or outdated components to keep your content model organized.

Instructions

Deletes a component by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the component to delete

Implementation Reference

  • Main handler for delete_component tool - deletes a component by ID via DELETE /components/{id} API call
      async ({ id }) => {
        try {
          await apiDelete(`/components/${id}`);
          return createJsonResponse({ message: `Component ${id} has been successfully deleted.` });
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Registration of delete_component tool with the MCP server, including name, description, and input schema
    server.tool(
      'delete_component',
      'Deletes a component by ID.',
      {
        id: z.string().describe('ID of the component to delete'),
      },
      async ({ id }) => {
        try {
          await apiDelete(`/components/${id}`);
          return createJsonResponse({ message: `Component ${id} has been successfully deleted.` });
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Input schema for delete_component - requires a single string 'id' parameter
    {
      id: z.string().describe('ID of the component to delete'),
    },
  • The apiDelete helper function used to perform 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 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;
    }
  • The createJsonResponse helper used to format successful JSON responses
    export function createJsonResponse(data: unknown): McpSuccessResponse {
      return {
        content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior1/5

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

Without annotations, the description must disclose behavioral traits. It only states the action without noting irreversibility, permission requirements, cascading effects, or return behavior. This leaves critical gaps for an agent deciding to invoke the tool.

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 one efficient sentence with no wasted words. It front-loads the action and target, making it easy to scan.

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 no output schema and no annotations, the description lacks completeness. It does not explain what happens after deletion (e.g., success indication, irreversible change), leaving an agent without essential operational context.

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?

The input schema has 100% coverage with a description for 'id'. The description repeats 'by ID' but adds no additional semantic value beyond the schema. Baseline 3 is appropriate as schema does the heavy lifting.

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', the resource 'component', and the method 'by ID'. This directly conveys the tool's function and distinguishes it from sibling delete tools operating on other entities.

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 like delete_asset or delete_story. There is no mention of prerequisites, side effects, or scenarios where deletion might be inappropriate.

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