search_users
Find Mattermost users by name, username, or nickname to quickly locate team members and connect with the right people.
Instructions
사용자를 이름, username, 닉네임으로 검색합니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_term | Yes | 검색할 이름, username 또는 닉네임 |
Implementation Reference
- src/index.ts:508-528 (handler)The handler function for the 'search_users' MCP tool. It extracts the search term from arguments, calls the Mattermost client's searchUsers method, formats the results, and returns a JSON response.case "search_users": { const searchTerm = args.search_term as string; const users = await client.searchUsers(searchTerm); return { content: [ { type: "text", text: JSON.stringify({ total_count: users.length, users: users.map(u => ({ id: u.id, username: u.username, name: `${u.first_name} ${u.last_name}`.trim() || u.nickname, nickname: u.nickname, })), }, null, 2), }, ], }; }
- src/index.ts:243-256 (registration)Registration of the 'search_users' tool in the ListTools response, including name, description, and input schema.{ name: "search_users", description: "사용자를 이름, username, 닉네임으로 검색합니다.", inputSchema: { type: "object", properties: { search_term: { type: "string", description: "검색할 이름, username 또는 닉네임", }, }, required: ["search_term"], }, },
- src/index.ts:37-44 (schema)TypeScript interface defining the structure of a MattermostUser, used in the searchUsers response.interface MattermostUser { id: string; username: string; first_name: string; last_name: string; nickname: string; email?: string; }
- src/index.ts:88-96 (helper)Helper method in MattermostClient that performs the actual API call to search users by term.async searchUsers(term: string): Promise<MattermostUser[]> { return await this.request("/users/search", { method: "POST", body: JSON.stringify({ term, allow_inactive: false, }), }) as MattermostUser[]; }