Skip to main content
Glama

search-users

Find Zulip users by partial name or email when exact details are unknown. Use to identify recipients before sending direct messages, returning matching results with basic information.

Instructions

🔍 DISCOVERY: Search for users by partial name or email when you don't know exact details. Use this first to explore and find users before sending direct messages. Returns multiple matching results with basic info (name, email, ID).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesName, email, or partial match to search for users
limitNoMaximum number of results to return (default: 10)

Implementation Reference

  • Handler function for the 'search-users' MCP tool. Fetches all users from Zulip via zulipClient.getUsers(), performs client-side filtering by partial match on full_name or email (case-insensitive), limits results to the specified number, handles no-results case, maps to simplified output format (name, email, id, active), and returns formatted JSON response or error.
    async ({ query, limit }) => {
      try {
        const usersResponse = await zulipClient.getUsers();
        const lowerQuery = query.toLowerCase();
        
        const filtered = usersResponse.members.filter((user: any) => 
          user.full_name.toLowerCase().includes(lowerQuery) ||
          user.email.toLowerCase().includes(lowerQuery)
        ).slice(0, limit);
        
        if (filtered.length === 0) {
          return createSuccessResponse(`No users found matching "${query}". Try a shorter search term or check spelling.`);
        }
        
        const results = filtered.map((user: any) => ({
          name: user.full_name,
          email: user.email,
          id: user.id,
          active: user.is_active
        }));
        
        return createSuccessResponse(JSON.stringify({
          query,
          found: filtered.length,
          users: results
        }, null, 2));
      } catch (error) {
        return createErrorResponse(`Error searching users: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Zod input schema definition for the 'search-users' tool: required 'query' string for search term, optional 'limit' number defaulting to 10.
    {
      query: z.string().describe("Name, email, or partial match to search for users"),
      limit: z.number().default(10).describe("Maximum number of results to return (default: 10)")
    },
  • src/server.ts:330-332 (registration)
    Registration of the 'search-users' tool on the MCP server, including tool name, description, and schema reference.
    server.tool(
      "search-users",
      "🔍 DISCOVERY: Search for users by partial name or email when you don't know exact details. Use this first to explore and find users before sending direct messages. Returns multiple matching results with basic info (name, email, ID).",
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 of behavioral disclosure. It adds value by describing the tool's exploratory nature, partial matching capability, and that it returns multiple results with basic info. However, it lacks details on permissions, rate limits, or error handling, which are important for a search operation. The description doesn't contradict annotations, so no contradiction flag is raised.

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, with every sentence earning its place: the first sentence states the purpose, the second provides usage guidelines, and the third clarifies the return format. It uses emojis and formatting effectively without waste, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 (search operation with 2 parameters), no annotations, and no output schema, the description does a good job of covering purpose, usage, and basic behavior. However, it could be more complete by detailing the exact structure of returned results or any limitations, which would help compensate for the lack of output schema. It's largely adequate but has minor gaps.

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 both parameters ('query' and 'limit') thoroughly. The description adds marginal value by reinforcing that the query is for 'partial name or email' and implying it's for discovery, but it doesn't provide additional syntax or format details beyond what the schema specifies. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with specific verbs ('search for users by partial name or email') and resources ('users'), distinguishing it from siblings like 'get-user' or 'get-user-by-email' by emphasizing discovery when exact details are unknown. It explicitly mentions the exploratory nature and basic info returned, making the purpose distinct and well-defined.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('when you don't know exact details') and when to use alternatives ('Use this first to explore and find users before sending direct messages'), clearly differentiating it from sibling tools like 'get-user' or 'get-user-by-email' that likely require exact identifiers. It effectively sets context for its exploratory role.

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