Skip to main content
Glama

get_user_followers

Retrieve follower lists for WebSim users to analyze community connections and engagement patterns.

Instructions

Get followers of a specific WebSim user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userYesUsername
limitNoNumber of users to return (default: 20)
offsetNoNumber of users to skip (default: 0)

Implementation Reference

  • The MCP tool handler for 'get_user_followers' that validates arguments using UserParamsSchema, fetches data via apiClient, and returns a standardized JSON response.
    handler: async (args) => {
      const { user, limit = 20, offset = 0 } = UserParamsSchema.parse(args);
      const result = await apiClient.getUserFollowers(user, limit, offset);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            success: true,
            data: result,
            message: `Successfully retrieved ${result.items?.length || 0} followers of ${user}`
          }, null, 2)
        }]
      };
  • Input schema definition for the 'get_user_followers' tool, specifying parameters user (required), limit, and offset with descriptions and defaults.
    inputSchema: {
      type: "object",
      properties: {
        user: {
          type: "string",
          description: "Username"
        },
        limit: {
          type: "number",
          description: "Number of users to return (default: 20)",
          default: 20
        },
        offset: {
          type: "number",
          description: "Number of users to skip (default: 0)",
          default: 0
        }
      },
      required: ["user"]
  • Helper method in WebSimAPIClient class that constructs and sends HTTP request to retrieve followers for a given user from the WebSim API.
    async getUserFollowers(user, limit = 20, offset = 0) {
      const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() });
      return this.makeRequest(`/api/v1/users/${user}/followers?${params}`);
    }
  • Zod schema used for input validation in the 'get_user_followers' handler (and other user-related tools), requiring a 'user' string.
    const UserParamsSchema = z.object({
      user: z.string().describe('Username')
    });
  • server.js:606-642 (registration)
    Full tool registration object added to the 'tools' array, which is used by the MCP server for tool listing and execution.
    {
      name: "get_user_followers",
      description: "Get followers of a specific WebSim user",
      inputSchema: {
        type: "object",
        properties: {
          user: {
            type: "string",
            description: "Username"
          },
          limit: {
            type: "number",
            description: "Number of users to return (default: 20)",
            default: 20
          },
          offset: {
            type: "number",
            description: "Number of users to skip (default: 0)",
            default: 0
          }
        },
        required: ["user"]
      },
      handler: async (args) => {
        const { user, limit = 20, offset = 0 } = UserParamsSchema.parse(args);
        const result = await apiClient.getUserFollowers(user, limit, offset);
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              success: true,
              data: result,
              message: `Successfully retrieved ${result.items?.length || 0} followers of ${user}`
            }, null, 2)
          }]
        };
      }

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/gigachadtrey/websimm'

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