Skip to main content
Glama

get-user

Retrieve detailed user profile information from Zulip by providing a user ID. Returns role, timezone, avatar, and custom profile fields for comprehensive user lookup.

Instructions

🆔 DETAILED LOOKUP: Get comprehensive user profile when you have their user ID (from search-users results). Returns complete user information including role, timezone, avatar, and custom profile fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUnique user ID to retrieve information for
client_gravatarNoInclude Gravatar URL (default: true)
include_custom_profile_fieldsNoInclude custom profile fields (default: false)

Implementation Reference

  • src/server.ts:852-885 (registration)
    Registration of the 'get-user' MCP tool, including name, description, schema reference, and the complete handler function that executes the tool logic.
    server.tool(
      "get-user",
      "🆔 DETAILED LOOKUP: Get comprehensive user profile when you have their user ID (from search-users results). Returns complete user information including role, timezone, avatar, and custom profile fields.",
      GetUserSchema.shape,
      async ({ user_id, client_gravatar, include_custom_profile_fields }) => {
        try {
          const result = await zulipClient.getUser(user_id, {
            client_gravatar,
            include_custom_profile_fields
          });
          
          return createSuccessResponse(JSON.stringify({
            user: {
              id: result.user.user_id,
              email: result.user.email,
              full_name: result.user.full_name,
              is_active: result.user.is_active,
              is_bot: result.user.is_bot,
              role: result.user.is_owner ? 'owner' : 
                    result.user.is_admin ? 'admin' : 
                    result.user.is_moderator ? 'moderator' : 
                    result.user.is_guest ? 'guest' : 'member',
              date_joined: result.user.date_joined,
              timezone: result.user.timezone,
              avatar_url: result.user.avatar_url,
              profile_data: result.user.profile_data
            }
          }, null, 2));
        } catch (error) {
          return createErrorResponse(`Error getting user: ${error instanceof Error ? error.message : 'Unknown error'}`);
        }
      }
    );
  • Zod input schema for the 'get-user' tool defining parameters: user_id (number, required), client_gravatar (boolean, optional), include_custom_profile_fields (boolean, optional).
    export const GetUserSchema = z.object({
      user_id: z.number().describe("Unique user ID to retrieve information for"),
      client_gravatar: z.boolean().optional().describe("Include Gravatar URL (default: true)"),
      include_custom_profile_fields: z.boolean().optional().describe("Include custom profile fields (default: false)")
    });
  • ZulipClient.getUser method: supporting utility that makes the actual Zulip API GET request to /users/{userId} to fetch user profile data, called by the MCP tool handler.
    async getUser(userId: number, params: {
      client_gravatar?: boolean;
      include_custom_profile_fields?: boolean;
    } = {}): Promise<{ user: ZulipUser }> {
      debugLog('🔍 Debug - getUser called with:', { userId, ...params });
      
      const response = await this.client.get(`/users/${userId}`, { params });
      debugLog('✅ Debug - User retrieved successfully:', response.data);
      return response.data;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns 'complete user information including role, timezone, avatar, and custom profile fields,' which adds value beyond the input schema. However, it doesn't mention behavioral aspects like whether this is a read-only operation, authentication requirements, rate limits, or error conditions, leaving gaps for a mutation-free tool.

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 appropriately sized and front-loaded. The first sentence establishes the core purpose and prerequisite, and the second sentence details the return information. Both sentences earn their place by adding value, with no wasted words or redundancy.

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 moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It explains the purpose and return fields well, but lacks details on behavioral traits (e.g., read-only nature, error handling) and doesn't fully compensate for the missing output schema, making it minimally viable but 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 description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain 'client_gravatar' or 'include_custom_profile_fields' further). This meets the baseline of 3 when schema coverage is high.

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 tool's purpose: 'Get comprehensive user profile when you have their user ID.' It specifies the verb ('Get') and resource ('user profile'), and mentions it requires a user ID from search-users results. However, it doesn't explicitly distinguish this from sibling tools like 'get-user-by-email' or 'get-users,' which would require a 5.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'when you have their user ID (from search-users results).' This gives practical guidance on the prerequisite. However, it doesn't explicitly state when NOT to use it or mention alternatives like 'get-user-by-email' for email-based lookups, preventing a score of 5.

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