Skip to main content
Glama

update_workflow

Update an existing workflow's name and content types in your Storyblok space.

Instructions

Updates an existing workflow in a Storyblok space via the Management API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesID of the workflow to update
nameYesNew name for the workflow
content_typesYesNew list of content types

Implementation Reference

  • The async handler function that executes the 'update_workflow' tool logic. It accepts workflow_id, name, and content_types, constructs a payload, and calls apiPut to the Storyblok Management API.
    async ({ workflow_id, name, content_types }) => {
      try {
        const payload = {
          workflow: {
            name,
            content_types,
          },
        };
    
        const data = await apiPut(`/workflows/${workflow_id}`, payload);
        return createJsonResponse(data);
      } catch (error) {
        if (error instanceof APIError) {
          return createErrorResponse(error);
        }
        throw error;
      }
    }
  • Zod schemas defining the input parameters for the 'update_workflow' tool: workflow_id (number), name (string), and content_types (array of strings).
    {
      workflow_id: z.number().describe('ID of the workflow to update'),
      name: z.string().describe('New name for the workflow'),
      content_types: z.array(z.string()).describe('New list of content types'),
    },
  • The MCP tool registration call using server.tool() with the name 'update_workflow' and a description.
    // Tool: update_workflow
    server.tool(
      'update_workflow',
      'Updates an existing workflow in a Storyblok space via the Management API.',
      {
        workflow_id: z.number().describe('ID of the workflow to update'),
        name: z.string().describe('New name for the workflow'),
        content_types: z.array(z.string()).describe('New list of content types'),
      },
      async ({ workflow_id, name, content_types }) => {
        try {
          const payload = {
            workflow: {
              name,
              content_types,
            },
          };
    
          const data = await apiPut(`/workflows/${workflow_id}`, payload);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • The apiPut helper function used by the handler to make a PUT request to the Storyblok Management API.
    export async function apiPut<T = unknown>(
      path: string,
      body: unknown
    ): Promise<T> {
      const url = buildManagementUrl(path);
      const response = await fetch(url, {
        method: 'PUT',
        headers: getManagementHeaders(),
        body: JSON.stringify(body),
      });
      return handleResponse<T>(response, url);
    }
  • The registerWorkflows function is called from the central tool aggregator to register all workflow tools including 'update_workflow'.
    registerWorkflows(server);
    registerWorkflowStages(server);
    registerWorkflowStageChanges(server);
Behavior2/5

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

With no annotations, the description carries full burden. It mentions 'via the Management API' hinting at authentication but lacks specifics on side effects, error conditions, or whether the operation is idempotent. No behavioral details beyond the basic action.

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, well-structured sentence with no wasted words. It is front-loaded with the core purpose and immediately readable.

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 update tool with 3 parameters and no output schema, the description is adequate but minimal. It lacks context on return values (even if not required), potential errors, and prerequisites. Could be more helpful.

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% (all parameters have descriptions). The description adds no additional meaning or context for parameters beyond what's already in the schema. 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 action ('Updates'), the resource ('existing workflow'), and the context ('Storyblok space via the Management API'). It effectively distinguishes from sibling tools like create_workflow and delete_workflow.

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 to update a workflow versus creating or deleting one. No prerequisites or exclusions are mentioned.

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