get_user_followees
Retrieve a user's following list on Qiita to analyze connections and discover content creators within the developer community.
Instructions
指定されたユーザーのフォロー一覧を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ユーザーID | |
| page | No | ページ番号(1-100) | |
| perPage | No | 1ページあたりの件数(1-100) |
Implementation Reference
- src/tools/handlers.ts:80-84 (handler)Defines the handler for the 'get_user_followees' tool, including Zod input schema and async execute function that calls the Qiita API client.get_user_followees: { schema: userIdSchema.merge(paginationSchema), execute: async ({ userId, page, perPage }, client) => client.getUserFollowees(userId, page, perPage), },
- src/tools/definitions.ts:119-142 (schema)MCP protocol tool schema definition for 'get_user_followees', used for listing tools.{ name: 'get_user_followees', description: '指定されたユーザーのフォロー一覧を取得します', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'ユーザーID', }, page: { type: 'number', description: 'ページ番号(1-100)', default: 1, }, perPage: { type: 'number', description: '1ページあたりの件数(1-100)', default: 20, }, }, required: ['userId'], }, },
- src/qiitaApiClient.ts:57-62 (helper)The supporting method in QiitaApiClient that performs the actual HTTP request to fetch the list of users that the specified user is following.async getUserFollowees(userId: string, page = 1, perPage = 20) { const response = await this.client.get(`/users/${userId}/followees`, { params: { page, per_page: perPage }, }); return response.data; }
- src/index.ts:26-28 (registration)Registers the request handler for listing tools, which returns the tools array including 'get_user_followees'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:30-65 (registration)Registers the request handler for calling tools, which uses toolHandlers[name] to execute 'get_user_followees'.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const accessToken = process.env.QIITA_ACCESS_TOKEN; const qiita = new QiitaApiClient(accessToken); const handler = toolHandlers[name]; try { if (!handler) { throw new Error(`未知のツール: ${name}`); } const parsedArgs = handler.schema.parse(args ?? {}); const result = await handler.execute(parsedArgs, qiita); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error: any) { const message = error?.message ?? String(error); return { content: [ { type: 'text', text: `エラーが発生しました: ${message}`, }, ], isError: true, }; } });