Skip to main content
Glama
Selenium39

Qiita API MCP Server

get_user_followers

Retrieve a list of followers for a specific Qiita user. Use this tool to access user follower data with pagination controls for efficient browsing.

Instructions

指定されたユーザーのフォロワー一覧を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesユーザーID
pageNoページ番号(1-100)
perPageNo1ページあたりの件数(1-100)

Implementation Reference

  • The handler definition for the 'get_user_followers' tool, including Zod schema for input validation and the execute function that delegates to the QiitaApiClient.
    get_user_followers: {
      schema: userIdSchema.merge(paginationSchema),
      execute: async ({ userId, page, perPage }, client) =>
        client.getUserFollowers(userId, page, perPage),
    },
  • The MCP tool schema definition for 'get_user_followers', including name, description, and input schema used for listing tools.
    {
      name: 'get_user_followers',
      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/index.ts:30-65 (registration)
    The MCP server registration for tool calls, where toolHandlers[name] is retrieved, input is parsed with the handler's schema, and the execute function is invoked with the Qiita client.
    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,
        };
      }
    });
  • The helper method in QiitaApiClient that performs the actual HTTP request to fetch the user's followers from the Qiita API.
    async getUserFollowers(userId: string, page = 1, perPage = 20) {
      const response = await this.client.get(`/users/${userId}/followers`, {
        params: { page, per_page: perPage },
      });
      return response.data;
    }

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/Selenium39/mcp-server-qiita'

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