update_collection_roles
Assign VIEWER or EDITOR roles to users, groups, or teams for a Postman collection. Requires EDITOR role on the collection.
Instructions
Update collection roles (requires EDITOR role)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes | The collection ID | |
| operations | Yes |
Implementation Reference
- src/tools/api/auth/index.ts:178-201 (handler)The handler function that executes the 'update_collection_roles' tool logic. Validates inputs (collectionId and operations), then sends a PATCH request to /collections/{collectionId}/roles with the operations payload.
async updateCollectionRoles(args: { collectionId: string; operations: Array<{ op: 'update'; path: '/user' | '/group' | '/team'; value: Array<{ id: number; role: 'VIEWER' | 'EDITOR'; }>; }>; }): Promise<ToolCallResponse> { if (!args.collectionId) { throw new McpError(ErrorCode.InvalidParams, 'collectionId is required'); } if (!args.operations || !Array.isArray(args.operations)) { throw new McpError(ErrorCode.InvalidParams, 'operations array is required'); } const response = await this.client.patch( `/collections/${args.collectionId}/roles`, { roles: args.operations } ); return this.createResponse(response.data); } - src/tools/api/auth/index.ts:47-48 (registration)Registration of the tool in the handleToolCall switch statement, routing 'update_collection_roles' to the updateCollectionRoles handler method.
case 'update_collection_roles': return await this.updateCollectionRoles(args); - The schema definition for the 'update_collection_roles' tool, specifying its name, description, and input validation schema (required fields, types, enums).
{ name: 'update_collection_roles', description: 'Update collection roles (requires EDITOR role)', inputSchema: { type: 'object', required: ['collectionId', 'operations'], properties: { collectionId: { type: 'string', description: 'The collection ID' }, operations: { type: 'array', items: { type: 'object', required: ['op', 'path', 'value'], properties: { op: { type: 'string', enum: ['update'], description: 'Operation type' }, path: { type: 'string', enum: ['/user', '/group', '/team'], description: 'Resource path' }, value: { type: 'array', items: { type: 'object', required: ['id', 'role'], properties: { id: { type: 'number', description: 'User/group/team ID' }, role: { type: 'string', enum: ['VIEWER', 'EDITOR'], description: 'Role to assign' } } } } } } } } } }, - src/tools/api/auth/index.ts:22-24 (registration)The AuthTools class returns TOOL_DEFINITIONS (including update_collection_roles) via getToolDefinitions(), used by the MCP tool registry.
getToolDefinitions(): ToolDefinition[] { return TOOL_DEFINITIONS; }