Skip to main content
Glama
olamide-olaniyan

SociaVault MCP Server

get_twitter_profile

Retrieve Twitter/X profile information by username to access user data and engagement metrics through SociaVault MCP Server.

Instructions

Get Twitter/X profile data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesTwitter username

Implementation Reference

  • Executes the get_twitter_profile tool: calls Sociavault API /twitter/profile endpoint with the handle, extracts profile using helper, and returns JSON stringified content.
    if (name === "get_twitter_profile") {
      const { handle } = args as { handle: string };
      const response = await axios.get(`${BASE_URL}/twitter/profile`, {
        headers: { "X-API-Key": API_KEY },
        params: { handle },
      });
      const extracted = extractTwitterProfile(response.data);
      return {
        content: [{ type: "text", text: JSON.stringify(extracted, null, 2) }],
      };
    }
  • src/index.ts:234-244 (registration)
    Registers the get_twitter_profile tool in the tools list with name, description, and input schema.
    {
      name: "get_twitter_profile",
      description: "Get Twitter/X profile data",
      inputSchema: {
        type: "object",
        properties: {
          handle: { type: "string", description: "Twitter username" },
        },
        required: ["handle"],
      },
    },
  • Helper function extracts and formats essential Twitter profile fields from the API response data.
    function extractTwitterProfile(data: any) {
      const user = data?.data?.user || data?.user || {};
      return {
        username: user.screen_name || user.username,
        name: user.name,
        description: user.description,
        followers: user.followers_count || 0,
        following: user.friends_count || 0,
        tweets: user.statuses_count || 0,
        verified: user.verified,
        profile_image: user.profile_image_url_https,
      };
    }

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/olamide-olaniyan/sociavault-mcp'

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