Skip to main content
Glama

update_collaborator

Update an existing collaborator's roles, permissions, or access paths by providing their ID and new settings.

Instructions

Updates roles, permissions, or access paths for an existing collaborator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collaborator_idYesID of the collaborator to update
roleNoNew role string
user_idNoUser ID
permissionsNoList of permissions
space_role_idNoSingle space role ID
space_role_idsNoList of space role IDs
allowed_pathsNoList of allowed path IDs
field_permissionsNoList of field permissions

Implementation Reference

  • The 'update_collaborator' tool handler registration. Defines schema (collaborator_id, role, user_id, permissions, space_role_id, space_role_ids, allowed_paths, field_permissions), builds a payload object, and sends a PUT request to /collaborators/{collaborator_id} via apiPut().
    // Tool: update_collaborator
    server.tool(
      'update_collaborator',
      'Updates roles, permissions, or access paths for an existing collaborator.',
      {
        collaborator_id: z.number().describe('ID of the collaborator to update'),
        role: z.string().optional().describe('New role string'),
        user_id: z.number().optional().describe('User ID'),
        permissions: z.array(z.string()).optional().describe('List of permissions'),
        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'),
        allowed_paths: z.array(z.number()).optional().describe('List of allowed path IDs'),
        field_permissions: z.array(z.string()).optional().describe('List of field permissions'),
      },
      async ({
        collaborator_id,
        role,
        user_id,
        permissions,
        space_role_id,
        space_role_ids,
        allowed_paths,
        field_permissions,
      }) => {
        try {
          const collaborator: Record<string, unknown> = {};
          if (role !== undefined) collaborator.role = role;
          if (user_id !== undefined) collaborator.user_id = user_id;
          if (permissions !== undefined) collaborator.permissions = permissions;
          if (space_role_id !== undefined) collaborator.space_role_id = space_role_id;
          if (space_role_ids !== undefined) collaborator.space_role_ids = space_role_ids;
          if (allowed_paths !== undefined) collaborator.allowed_paths = allowed_paths;
          if (field_permissions !== undefined) collaborator.field_permissions = field_permissions;
    
          const payload = { collaborator };
          const data = await apiPut(`/collaborators/${collaborator_id}`, payload);
          return createJsonResponse(data);
        } catch (error) {
          if (error instanceof APIError) {
            return createErrorResponse(error);
          }
          throw error;
        }
      }
    );
  • Zod schema definitions for the 'update_collaborator' tool input parameters: collaborator_id (required number), role (optional string), user_id (optional number), permissions (optional string array), space_role_id (optional number), space_role_ids (optional number array), allowed_paths (optional number array), field_permissions (optional string array).
    {
      collaborator_id: z.number().describe('ID of the collaborator to update'),
      role: z.string().optional().describe('New role string'),
      user_id: z.number().optional().describe('User ID'),
      permissions: z.array(z.string()).optional().describe('List of permissions'),
      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'),
      allowed_paths: z.array(z.number()).optional().describe('List of allowed path IDs'),
      field_permissions: z.array(z.string()).optional().describe('List of field permissions'),
    },
  • Registration call: registerCollaborators(server) in the registerAllTools function which registers all collaborators tools including 'update_collaborator'.
    // User management
    registerCollaborators(server);
    registerSpaceRoles(server);
    
    // Data sources
    registerDatasources(server);
  • The registerCollaborators export function that registers all collaborator tools (retrieve_multiple_collaborators, add_collaborator, update_collaborator, delete_collaborator) with the MCP server.
    export function registerCollaborators(server: McpServer): void {
      // Tool: retrieve_multiple_collaborators
      server.tool(
        'retrieve_multiple_collaborators',
        'Retrieves a paginated list of collaborators (users) in a specified Storyblok space.',
        {
          page: z.number().optional().default(1).describe('Page number'),
          per_page: z.number().optional().default(25).describe('Items per page'),
        },
        async ({ page, per_page }) => {
          try {
            const params: Record<string, string> = {
              page: String(page ?? 1),
              per_page: String(per_page ?? 25),
            };
            const data = await apiGet('/collaborators/', params);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
    
      // Tool: add_collaborator
      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;
          }
        }
      );
    
      // Tool: update_collaborator
      server.tool(
        'update_collaborator',
        'Updates roles, permissions, or access paths for an existing collaborator.',
        {
          collaborator_id: z.number().describe('ID of the collaborator to update'),
          role: z.string().optional().describe('New role string'),
          user_id: z.number().optional().describe('User ID'),
          permissions: z.array(z.string()).optional().describe('List of permissions'),
          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'),
          allowed_paths: z.array(z.number()).optional().describe('List of allowed path IDs'),
          field_permissions: z.array(z.string()).optional().describe('List of field permissions'),
        },
        async ({
          collaborator_id,
          role,
          user_id,
          permissions,
          space_role_id,
          space_role_ids,
          allowed_paths,
          field_permissions,
        }) => {
          try {
            const collaborator: Record<string, unknown> = {};
            if (role !== undefined) collaborator.role = role;
            if (user_id !== undefined) collaborator.user_id = user_id;
            if (permissions !== undefined) collaborator.permissions = permissions;
            if (space_role_id !== undefined) collaborator.space_role_id = space_role_id;
            if (space_role_ids !== undefined) collaborator.space_role_ids = space_role_ids;
            if (allowed_paths !== undefined) collaborator.allowed_paths = allowed_paths;
            if (field_permissions !== undefined) collaborator.field_permissions = field_permissions;
    
            const payload = { collaborator };
            const data = await apiPut(`/collaborators/${collaborator_id}`, payload);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
    
      // Tool: delete_collaborator
      server.tool(
        'delete_collaborator',
        'Deletes a collaborator from a specified Storyblok space. Can delete by collaborator_id or sso_id.',
        {
          collaborator_id: z.number().describe('ID of the collaborator to delete'),
          sso_id: z.string().optional().describe('SSO ID for SSO users (alternative to collaborator_id)'),
        },
        async ({ collaborator_id, sso_id }) => {
          try {
            const identifier = sso_id ?? collaborator_id;
            const data = await apiDelete(`/collaborators/${identifier}`);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
    }
  • The apiPut helper function used by the 'update_collaborator' handler to make the PUT HTTP 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);
    }
Behavior2/5

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

No annotations are present, so the description carries full burden. It states that the tool updates roles/permissions/access paths but omits behavioral traits such as side effects, required preconditions (e.g., collaborator must exist), error scenarios, or confirmation of mutation. This is insufficient for a write operation.

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 sentence, front-loaded with the verb and resource. Every word adds value, and no redundant or filler content exists. It is highly efficient.

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?

Despite having 8 parameters and no output schema, the description is minimal. It does not explain return values, error handling, or prerequisites (e.g., collaborator existence). For a mutation tool with moderate complexity, the description is incomplete.

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%, so baseline is 3. The description adds high-level grouping of parameters (roles, permissions, access paths) but does not provide additional meaning beyond the schema's parameter descriptions. It neither clarifies interdependencies nor enriches individual parameter semantics.

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 'updates' and the resource 'collaborator', and specifies the modifiable fields (roles, permissions, access paths). It distinguishes itself from sibling tools like 'add_collaborator' and 'delete_collaborator' by focusing on updates to existing entities.

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

Usage Guidelines3/5

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

The description implies usage for updating an existing collaborator via the word 'existing', but it does not explicitly contrast with alternatives like 'add_collaborator' for creation or 'delete_collaborator' for removal. No when-to-use or when-not-to-use guidance is provided.

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