Skip to main content
Glama

retrieve_multiple_branches

Fetch multiple branches (pipelines) from a Storyblok space, with optional filtering by branch IDs or a name search.

Instructions

Retrieves multiple branches (pipelines) in a Storyblok space via the Management API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
by_idsNoComma-separated list of branch IDs to filter
searchNoFilter term for branch names

Implementation Reference

  • The handler function for the 'retrieve_multiple_branches' tool. It accepts optional 'by_ids' and 'search' parameters, builds query params, makes a GET request to '/branches/', and returns the JSON response or an error.
    // Tool: retrieve_multiple_branches
    server.tool(
      'retrieve_multiple_branches',
      'Retrieves multiple branches (pipelines) in a Storyblok space via the Management API.',
      {
        by_ids: z.string().optional().describe('Comma-separated list of branch IDs to filter'),
        search: z.string().optional().describe('Filter term for branch names'),
      },
      async ({ by_ids, search }) => {
        try {
          const params: Record<string, string> = {};
          if (by_ids) params.by_ids = by_ids;
          if (search) params.search = search;
    
          const data = await apiGet('/branches/', params);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Zod schema definitions for the 'retrieve_multiple_branches' tool input: optional 'by_ids' (comma-separated branch IDs) and 'search' (filter term for branch names).
    {
      by_ids: z.string().optional().describe('Comma-separated list of branch IDs to filter'),
      search: z.string().optional().describe('Filter term for branch names'),
    },
  • The tool is registered via server.tool('retrieve_multiple_branches', ...) inside the registerBranches() function exported from src/tools/pipelines.ts.
    export function registerBranches(server: McpServer): void {
      // Tool: retrieve_multiple_branches
      server.tool(
        'retrieve_multiple_branches',
        'Retrieves multiple branches (pipelines) in a Storyblok space via the Management API.',
        {
          by_ids: z.string().optional().describe('Comma-separated list of branch IDs to filter'),
          search: z.string().optional().describe('Filter term for branch names'),
        },
        async ({ by_ids, search }) => {
          try {
            const params: Record<string, string> = {};
            if (by_ids) params.by_ids = by_ids;
            if (search) params.search = search;
    
            const data = await apiGet('/branches/', params);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • The registerBranches function is called from registerAllTools() in the aggregator module, which registers all tools with the MCP server.
    // Branch/Pipeline management
    registerBranches(server);
  • The apiGet helper function that performs the actual HTTP GET request to the Storyblok Management API, used by the retrieve_multiple_branches handler.
    export async function apiGet<T = unknown>(
      path: string,
      params: Record<string, string> = {}
    ): Promise<T> {
      const url = buildUrlWithParams(buildManagementUrl(path), params);
      const response = await fetch(url, {
        method: 'GET',
        headers: getManagementHeaders(),
      });
      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 convey behavioral traits. It only states it's a retrieval operation, but omits details like pagination, rate limiting, or required permissions. The agent lacks context on how the tool behaves beyond being read-only.

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 concise sentence that front-loads the core purpose. It is efficient but could include more context without becoming verbose.

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 absence of annotations and output schema, the description is too sparse. It does not specify return format, filtering behavior, or any limitations, leaving the agent underinformed for a tool with two parameters.

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% (both parameters have descriptions). The description adds no additional meaning beyond what the schema provides, thus achieving baseline score.

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 tool retrieves multiple branches in a Storyblok space via the Management API. It uses a specific verb (retrieves) and resource (branches), and is distinct from sibling tools like retrieve_single_branch and other retrieve_multiple_* tools.

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 given on when to use this tool versus alternatives. It does not mention when to use retrieve_single_branch for a single branch or other filtering methods. The description is silent on when not to use it.

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