Skip to main content
Glama

get-users

Retrieve a complete list of all users in your Zulip organization with their profile information to access the full user directory.

Instructions

šŸ‘„ ALL USERS: Get complete list of all users in the organization with their profile information. Use this to see everyone at once or when you need the full user directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_gravatarNoInclude Gravatar URLs for users (default: true)
include_custom_profile_fieldsNoInclude custom profile fields (default: false)

Implementation Reference

  • Primary handler and registration for the 'get-users' tool. Registers the tool with MCP server, defines input schema reference, and implements the execution logic which calls ZulipClient.getUsers() and formats the response as JSON.
    server.tool( "get-users", "šŸ‘„ ALL USERS: Get complete list of all users in the organization with their profile information. Use this to see everyone at once or when you need the full user directory.", ListUsersSchema.shape, async ({ client_gravatar, include_custom_profile_fields }) => { try { const result = await zulipClient.getUsers({ client_gravatar, include_custom_profile_fields }); return createSuccessResponse(JSON.stringify({ user_count: result.members.length, users: result.members.map(user => ({ id: user.user_id, email: user.email, full_name: user.full_name, is_active: user.is_active, is_bot: user.is_bot, role: user.is_owner ? 'owner' : user.is_admin ? 'admin' : user.is_moderator ? 'moderator' : user.is_guest ? 'guest' : 'member', date_joined: user.date_joined, timezone: user.timezone, avatar_url: user.avatar_url })) }, null, 2)); } catch (error) { return createErrorResponse(`Error listing users: ${error instanceof Error ? error.message : 'Unknown error'}`); } } );
  • Zod input schema definition for the get-users tool, defining optional parameters for Gravatar inclusion and custom profile fields.
    export const ListUsersSchema = z.object({ client_gravatar: z.boolean().optional().describe("Include Gravatar URLs for users (default: true)"), include_custom_profile_fields: z.boolean().optional().describe("Include custom profile fields (default: false)") });
  • ZulipClient helper method getUsers() that performs the actual API request to Zulip's /users endpoint, filtering undefined params before the GET request.
    async getUsers(params: { client_gravatar?: boolean; include_custom_profile_fields?: boolean; } = {}): Promise<{ members: ZulipUser[] }> { // Filter out undefined values const filteredParams = Object.fromEntries( Object.entries(params).filter(([, value]) => value !== undefined) ); const response = await this.client.get('/users', { params: filteredParams }); return response.data; }

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