Skip to main content
Glama

get-user-groups

Retrieve all user groups within a Zulip organization to manage permissions and organize team members effectively.

Instructions

Get all user groups in the organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration and handler function for the 'get-user-groups' tool. This defines the tool, its description, empty input schema, and the execution logic that fetches user groups via ZulipClient and formats the response.
    server.tool(
      "get-user-groups",
      "Get all user groups in the organization.",
      {},
      async () => {
        try {
          const result = await zulipClient.getUserGroups();
          return createSuccessResponse(JSON.stringify({
            group_count: result.user_groups.length,
            user_groups: result.user_groups.map(group => ({
              id: group.id,
              name: group.name,
              description: group.description,
              member_count: group.members.length,
              is_system_group: group.is_system_group
            }))
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error getting user groups: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • Helper method in ZulipClient that makes the HTTP GET request to Zulip API endpoint '/user_groups' to retrieve all user groups.
    async getUserGroups(): Promise<{ user_groups: ZulipUserGroup[] }> {
      const response = await this.client.get('/user_groups');
      return response.data;
    }
  • TypeScript interface defining the structure of Zulip user groups used in the tool's response.
    export interface ZulipUserGroup {
      id: number;
      name: string;
      description: string;
      members: number[];
      direct_subgroup_ids: number[];
      is_system_group: boolean;
      can_manage_group: number;
      can_mention_group: number;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action but doesn't mention whether this requires authentication, returns paginated results, includes nested group details, or has rate limits. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that front-loads the core purpose without any wasted words. It directly communicates what the tool does in a clear and structured manner, making it easy for an agent to parse quickly.

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?

Given the tool's simplicity (0 parameters, no output schema), the description is adequate as a basic read operation. However, without annotations or output schema, it lacks details on return format (e.g., list structure, fields included) and behavioral constraints, which could be important for an agent to use it effectively in complex scenarios.

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?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description doesn't need to add parameter details, and it correctly implies no filtering or options are available by stating 'Get all user groups.' This aligns well with the schema, earning a baseline 4 for zero-parameter tools.

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 ('Get') and resource ('all user groups in the organization'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'get-users' or 'get-user', which might also retrieve organizational data, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get-users' and 'get-user-by-email' available, there's no indication of whether this is for bulk retrieval, administrative purposes, or specific contexts, leaving the agent to guess about appropriate usage scenarios.

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/avisekrath/zulip-mcp-server'

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