get_user
Retrieve detailed information about a specific user on the Qiita developer community platform by providing their user ID.
Instructions
指定されたユーザーの詳細情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ユーザーID |
Implementation Reference
- src/tools/handlers.ts:57-60 (handler)Handler definition for the 'get_user' MCP tool. Validates input using userIdSchema and executes by calling QiitaApiClient.getUser(userId). This is the core execution logic invoked when the tool is called.get_user: { schema: userIdSchema, execute: async ({ userId }, client) => client.getUser(userId), },
- src/tools/definitions.ts:13-26 (schema)Tool schema definition for 'get_user', including name, description, and JSON input schema. Used for MCP listTools response and tool discovery.{ name: 'get_user', description: '指定されたユーザーの詳細情報を取得します', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'ユーザーID', }, }, required: ['userId'], }, },
- src/qiitaApiClient.ts:24-27 (helper)Supporting method in QiitaApiClient that performs the actual API request to fetch user details from Qiita API. Called by the tool handler.async getUser(userId: string) { const response = await this.client.get(`/users/${userId}`); return response.data; }
- src/tools/handlers.ts:15-17 (schema)Zod schema for userId input validation, used by multiple tools including 'get_user' for runtime parsing in the handler.const userIdSchema = z.object({ userId: z.string(), });
- src/index.ts:26-28 (registration)Registration of listTools handler that returns the tools array containing 'get_user' definition for MCP protocol.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });