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).",

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