Skip to main content
Glama
olamide-olaniyan

SociaVault MCP Server

get_twitter_profile

Retrieve Twitter/X profile information including user data and engagement metrics by providing a username handle.

Instructions

Get Twitter/X profile data

Input Schema

NameRequiredDescriptionDefault
handleYesTwitter username

Input Schema (JSON Schema)

{ "properties": { "handle": { "description": "Twitter username", "type": "string" } }, "required": [ "handle" ], "type": "object" }

Implementation Reference

  • Handler logic for the 'get_twitter_profile' tool. Makes an API call to Sociavault's twitter/profile endpoint with the provided handle, extracts the profile data using extractTwitterProfile helper, and returns the JSON stringified result.
    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)
    Registration of the 'get_twitter_profile' tool in the tools array, including name, description, and input schema. This is used by the ListToolsRequestHandler.
    { name: "get_twitter_profile", description: "Get Twitter/X profile data", inputSchema: { type: "object", properties: { handle: { type: "string", description: "Twitter username" }, }, required: ["handle"], }, },
  • Input schema definition for the 'get_twitter_profile' tool, specifying the required 'handle' parameter.
    inputSchema: { type: "object", properties: { handle: { type: "string", description: "Twitter username" }, }, required: ["handle"], },
  • Helper function to extract and normalize Twitter profile data from the API response.
    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