Skip to main content
Glama

retrieve_multiple_approvals

Fetch all approvals assigned to a specific approver user in a Storyblok space. Supports pagination to browse through large sets.

Instructions

Retrieves multiple approvals from a specified Storyblok space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
approverYesApprover user ID (required)
pageNoPage number for pagination
per_pageNoNumber of items per page

Implementation Reference

  • Handler function for retrieve_multiple_approvals tool. Validates that approver ID is provided, builds query params, makes a GET request to /approvals/ with approver/page/per_page parameters, and returns the JSON response or an error.
      async ({ approver, page, per_page }) => {
        try {
          if (!approver) {
            return {
              isError: true,
              content: [{ type: 'text' as const, text: 'Error: approver id is required' }],
            };
          }
    
          const params: Record<string, string> = { approver: String(approver) };
          if (page !== undefined) params.page = String(page);
          if (per_page !== undefined) params.per_page = String(per_page);
    
          const data = await apiGet('/approvals/', params);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Zod schema defining the input parameters for retrieve_multiple_approvals: approver (required number), page (optional number), per_page (optional number).
    {
      approver: z.number().describe('Approver user ID (required)'),
      page: z.number().optional().describe('Page number for pagination'),
      per_page: z.number().optional().describe('Number of items per page'),
    },
  • Registration of retrieve_multiple_approvals tool via server.tool() with name, description, schema, and handler. The registerApprovals function is called from src/tools/index.ts line 58.
    // Tool: retrieve_multiple_approvals
    server.tool(
      'retrieve_multiple_approvals',
      'Retrieves multiple approvals from a specified Storyblok space.',
      {
        approver: z.number().describe('Approver user ID (required)'),
        page: z.number().optional().describe('Page number for pagination'),
        per_page: z.number().optional().describe('Number of items per page'),
      },
      async ({ approver, page, per_page }) => {
        try {
          if (!approver) {
            return {
              isError: true,
              content: [{ type: 'text' as const, text: 'Error: approver id is required' }],
            };
          }
    
          const params: Record<string, string> = { approver: String(approver) };
          if (page !== undefined) params.page = String(page);
          if (per_page !== undefined) params.per_page = String(per_page);
    
          const data = await apiGet('/approvals/', params);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Registration call in the aggregator file that registers all approvals tools (including retrieve_multiple_approvals) with the MCP server.
    registerApprovals(server);
  • Helper utility that performs the GET request to /approvals/ with query params (approver, page, per_page). Uses the Storyblok Management API client.
    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);
    }
Behavior1/5

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

No annotations are provided, and the description fails to disclose any behavioral traits such as pagination, return format, rate limits, or authentication requirements. It adds no value beyond the tool's name, which is insufficient for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise. However, it is so minimal that it sacrifices necessary detail. It is front-loaded but lacks the depth required for a retrieval tool, leading to a moderate score for being appropriately sized but insufficient.

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 an output schema and annotations, the description should compensate by explaining return values, pagination behavior, or error handling. It does not, leaving the agent with incomplete information for a tool that retrieves multiple items.

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 provides full coverage of all three parameters (approver, page, per_page) with descriptions. The description adds no additional meaning or context about parameter usage, so it meets the baseline for a schema with high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieves' and the resource 'multiple approvals' from a 'Storyblok space'. It is specific and distinguishes from sibling tools like 'retrieve_single_approval'. However, the mention of 'specified space' is not reflected in the input schema, which lacks a space parameter, slightly reducing clarity.

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 'retrieve_single_approval' or other list tools. There is no mention of use cases, prerequisites, or context, leaving the agent to infer from the name alone.

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