Skip to main content
Glama
jhanglim
by jhanglim

get_user_info

Retrieve detailed user information including username, name, and nickname by providing a user ID to access Mattermost user profiles.

Instructions

사용자 ID로 사용자의 상세 정보를 조회합니다. username, 이름, 닉네임 등을 확인할 수 있습니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYes조회할 사용자의 ID

Implementation Reference

  • Handler for the 'get_user_info' tool. Retrieves user details by ID using MattermostClient.getUser(), handles not found case, and returns formatted JSON response.
    case "get_user_info": { const userId = args.user_id as string; const user = await client.getUser(userId); if (!user) { return { content: [ { type: "text", text: JSON.stringify({ error: "User not found", user_id: userId, }, null, 2), }, ], }; } return { content: [ { type: "text", text: JSON.stringify({ id: user.id, username: user.username, email: user.email || "", first_name: user.first_name || "", last_name: user.last_name || "", nickname: user.nickname || "", full_name: `${user.first_name} ${user.last_name}`.trim() || user.nickname || user.username, }, null, 2), }, ], }; }
  • src/index.ts:192-205 (registration)
    Tool registration in listTools response, defining name, description, and input schema requiring 'user_id'.
    { name: "get_user_info", description: "사용자 ID로 사용자의 상세 정보를 조회합니다. username, 이름, 닉네임 등을 확인할 수 있습니다.", inputSchema: { type: "object", properties: { user_id: { type: "string", description: "조회할 사용자의 ID", }, }, required: ["user_id"], }, },
  • Type definition for MattermostUser, used in tool responses and client methods.
    interface MattermostUser { id: string; username: string; first_name: string; last_name: string; nickname: string; email?: string; }
  • MattermostClient.getUser helper method: fetches user by ID with caching, returns null if not found. Called by the tool handler.
    async getUser(userId: string) { // 캐시 확인 if (this.userCache.has(userId)) { return this.userCache.get(userId); } try { const user = await this.request(`/users/${userId}`); this.userCache.set(userId, user); return user; } catch (e) { return null; } }

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/jhanglim/mattermost-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server