Skip to main content
Glama
Selenium39

Qiita API MCP Server

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
NameRequiredDescriptionDefault
userIdYesユーザーID
pageNoページ番号(1-100)
perPageNo1ページあたりの件数(1-100)

Implementation Reference

  • 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),
    },
  • 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'],
      },
    },
  • 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,
        };
      }
    });

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