search_users
Find Jira users by name or email to obtain account IDs needed for assigning issues and managing project tasks.
Instructions
Search for Jira users by name or email to get their account ID. Use this to find account IDs for assigning issues.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | Maximum number of results to return (default: 50) | |
| query | Yes | Search query - can be email, name, or partial match (e.g., "john.doe@company.com" or "John Doe") |
Implementation Reference
- src/handlers/user-handlers.ts:7-64 (handler)The main handler function that executes the search_users tool: searches Jira users via API, handles errors, and formats results as markdown.async handleSearchUsers(args: any) { try { const { query, maxResults = 50 } = args; if (!query) { throw new Error('query is required'); } const params = { query, maxResults, }; const users = await this.apiClient.get('/user/search', params); if (!users || users.length === 0) { return { content: [ { type: 'text', text: `No users found matching "${query}"`, }, ], }; } let response = `# User Search Results\n\n**Query**: ${query}\n**Found**: ${users.length} user(s)\n\n`; users.forEach((user: any) => { response += `## ${user.displayName}\n`; response += `- **Email**: ${user.emailAddress || 'N/A'}\n`; response += `- **Account ID**: \`${user.accountId}\`\n`; response += `- **Active**: ${user.active ? 'Yes' : 'No'}\n`; response += `- **Account Type**: ${user.accountType || 'N/A'}\n\n`; }); response += `\n💡 Use the **Account ID** when assigning issues.`; return { content: [ { type: 'text', text: response, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
- src/tools/definitions.ts:170-187 (schema)Input schema and description for the search_users tool, defining required 'query' parameter and optional 'maxResults'.{ name: 'search_users', description: 'Search for Jira users by name or email to get their account ID. Use this to find account IDs for assigning issues.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query - can be email, name, or partial match (e.g., "john.doe@company.com" or "John Doe")', }, maxResults: { type: 'number', description: 'Maximum number of results to return (default: 50)', }, }, required: ['query'], }, },
- src/index.ts:118-119 (registration)Switch case that registers and dispatches 'search_users' tool calls to the handler method.case 'search_users': return this.userHandlers.handleSearchUsers(request.params.arguments);