Skip to main content
Glama

add_collaborator

Add a collaborator to a Storyblok space by email, with optional role or role IDs.

Instructions

Adds a collaborator to a space in Storyblok. Use either role (string) OR space_role_id (int) OR space_role_ids (list).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail of the collaborator to add
roleNoRole string
space_role_idNoSingle space role ID
space_role_idsNoList of space role IDs
permissionsNoList of permissions
allow_multiple_roles_creationNoAllow multiple roles creation

Implementation Reference

  • The add_collaborator tool handler: accepts email (required), role, space_role_id, space_role_ids, permissions, and allow_multiple_roles_creation. Builds a payload and POSTs to /collaborators/ via the API utility.
    server.tool(
      'add_collaborator',
      'Adds a collaborator to a space in Storyblok. Use either role (string) OR space_role_id (int) OR space_role_ids (list).',
      {
        email: z.string().describe('Email of the collaborator to add'),
        role: z.string().optional().describe('Role string'),
        space_role_id: z.number().optional().describe('Single space role ID'),
        space_role_ids: z.array(z.number()).optional().describe('List of space role IDs'),
        permissions: z.array(z.string()).optional().describe('List of permissions'),
        allow_multiple_roles_creation: z
          .boolean()
          .optional()
          .describe('Allow multiple roles creation'),
      },
      async ({ email, role, space_role_id, space_role_ids, permissions, allow_multiple_roles_creation }) => {
        try {
          const collaborator: Record<string, unknown> = { email };
          if (role) collaborator.role = role;
          if (space_role_id) collaborator.space_role_id = space_role_id;
          if (space_role_ids) collaborator.space_role_ids = space_role_ids;
          if (permissions) collaborator.permissions = permissions;
          if (allow_multiple_roles_creation !== undefined) {
            collaborator.allow_multiple_roles_creation = allow_multiple_roles_creation;
          }
    
          const payload = { collaborator };
          const data = await apiPost('/collaborators/', payload);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Zod schema defining the input parameters for add_collaborator: email (required string), role (optional string), space_role_id (optional number), space_role_ids (optional array of numbers), permissions (optional array of strings), allow_multiple_roles_creation (optional boolean).
    {
      email: z.string().describe('Email of the collaborator to add'),
      role: z.string().optional().describe('Role string'),
      space_role_id: z.number().optional().describe('Single space role ID'),
      space_role_ids: z.array(z.number()).optional().describe('List of space role IDs'),
      permissions: z.array(z.string()).optional().describe('List of permissions'),
      allow_multiple_roles_creation: z
        .boolean()
        .optional()
        .describe('Allow multiple roles creation'),
    },
  • Registration call in the main tool aggregator that registers all collaborator tools (including add_collaborator) with the MCP server.
    registerCollaborators(server);
  • The registerCollaborators function that registers the add_collaborator tool (and others) by calling server.tool().
    export function registerCollaborators(server: McpServer): void {
  • The apiPost helper used by the add_collaborator handler to POST the collaborator payload to the Storyblok Management API.
    export async function apiPost<T = unknown>(
      path: string,
      body: unknown
    ): Promise<T> {
      const url = buildManagementUrl(path);
      const response = await fetch(url, {
        method: 'POST',
        headers: getManagementHeaders(),
        body: JSON.stringify(body),
      });
      return handleResponse<T>(response, url);
    }
Behavior2/5

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

No annotations are provided, and the description only says 'Adds a collaborator', implying mutation. It lacks disclosure of side effects, permissions required, or what happens on duplicate emails.

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?

Two concise sentences: first states purpose, second provides usage guidance. No wasted words and information is front-loaded.

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?

The description is brief and does not explain the return value, differentiate from update_collaborator, or cover parameters like permissions or allow_multiple_roles_creation, though these are described in the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the description adds value beyond the schema by clarifying the mutual exclusivity of role parameters, preventing incorrect multiple usage.

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 'Adds' and the resource 'collaborator to a space', distinguishing it from siblings like update_collaborator or delete_collaborator.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises using either 'role', 'space_role_id', or 'space_role_ids', indicating mutual exclusivity. It does not mention when to use each option, but provides clear alternative selection.

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