get_user
Retrieve detailed user information from Qiita's developer community platform by providing a user ID to access profile data and activity details.
Instructions
指定されたユーザーの詳細情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ユーザーID |
Implementation Reference
- src/tools/handlers.ts:57-60 (handler)The execute handler for the 'get_user' MCP tool. It validates the input using the userIdSchema (Zod) and delegates execution to the QiitaApiClient's getUser method.get_user: { schema: userIdSchema, execute: async ({ userId }, client) => client.getUser(userId), },
- src/tools/definitions.ts:13-26 (schema)The MCP tool definition for 'get_user', including name, description, and inputSchema (JSON Schema) used for listing tools.{ name: 'get_user', description: '指定されたユーザーの詳細情報を取得します', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'ユーザーID', }, }, required: ['userId'], }, },
- src/index.ts:26-28 (registration)Registration of the listTools capability, which returns the tools array including the 'get_user' tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:35-44 (registration)Part of the CallTool request handler where the tool handler (from toolHandlers[name]) is retrieved, input is parsed, and execute is called for 'get_user'.const handler = toolHandlers[name]; try { if (!handler) { throw new Error(`未知のツール: ${name}`); } const parsedArgs = handler.schema.parse(args ?? {}); const result = await handler.execute(parsedArgs, qiita);
- src/qiitaApiClient.ts:24-27 (helper)The Qiita API client method called by the get_user handler to fetch user details via the Qiita API.async getUser(userId: string) { const response = await this.client.get(`/users/${userId}`); return response.data; }