Skip to main content
Glama
delano
by delano

get_collection_roles

Retrieves the roles assigned to a Postman collection by providing its collection ID.

Instructions

Get roles for a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionIdYesThe collection ID

Implementation Reference

  • The actual handler function `getCollectionRoles` that executes the tool logic. It validates the collectionId parameter, then makes a GET request to `/collections/{collectionId}/roles` on the Postman API and returns the response data.
    /**
     * Get roles for a collection
     */
    async getCollectionRoles(collectionId: string): Promise<ToolCallResponse> {
      if (!collectionId) {
        throw new McpError(ErrorCode.InvalidParams, 'collectionId is required');
      }
      const response = await this.client.get(`/collections/${collectionId}/roles`);
      return this.createResponse(response.data);
    }
  • The `handleToolCall` dispatcher that routes 'get_collection_roles' tool calls to the `getCollectionRoles` method.
    async handleToolCall(name: string, args: any): Promise<ToolCallResponse> {
      try {
        switch (name) {
          case 'list_collection_access_keys':
            return await this.listCollectionAccessKeys(args);
          case 'delete_collection_access_key':
            return await this.deleteCollectionAccessKey(args.keyId);
          case 'list_workspace_roles':
            return await this.listWorkspaceRoles();
          case 'get_workspace_roles':
            return await this.getWorkspaceRoles(args);
          case 'update_workspace_roles':
            return await this.updateWorkspaceRoles(args);
          case 'get_collection_roles':
            return await this.getCollectionRoles(args.collectionId);
          case 'update_collection_roles':
            return await this.updateCollectionRoles(args);
          case 'get_authenticated_user':
            return await this.getAuthenticatedUser();
          default:
            throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
        }
      } catch (error) {
        // Let base class interceptor handle API errors
        throw error;
      }
    }
  • The tool definition (input schema) for 'get_collection_roles'. Defines the tool name, description, and that it requires a 'collectionId' string parameter.
    {
      name: 'get_collection_roles',
      description: 'Get roles for a collection',
      inputSchema: {
        type: 'object',
        required: ['collectionId'],
        properties: {
          collectionId: {
            type: 'string',
            description: 'The collection ID'
          }
        }
      }
    },
  • The `CollectionRole` TypeScript interface describing the shape of collection role data returned by the API.
    export interface CollectionRole {
      id: string;
      name: string;
      description?: string;
      type: 'user' | 'group' | 'team';
      roleId: 'VIEWER' | 'EDITOR';
      entityId: number;
      entityType: string;
    }
  • The `getToolDefinitions()` method which returns `TOOL_DEFINITIONS` from the definitions file, registering all tools (including 'get_collection_roles') with the framework.
    getToolDefinitions(): ToolDefinition[] {
      return TOOL_DEFINITIONS;
    }
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It only says 'Get roles' implying read-only, but lacks details on return format, permissions, or side effects.

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?

Single sentence with no unnecessary words. Efficient but could benefit from a bit more detail without being verbose.

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?

Simple tool with one parameter and no output schema; description is adequate but lacks detail on what the roles look like or how they are structured.

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% (collectionId described). Description adds no additional meaning beyond what schema provides; baseline 3 is appropriate.

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 'Get roles for a collection' clearly states the verb and resource, but does not differentiate from sibling get_collection which might also imply role retrieval.

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 on when to use this tool versus alternatives like get_collection or update_collection_roles. Missing context on use cases.

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/delano/postman-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server