Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

bulkUserProfiles

Retrieve multiple Twitter user profiles simultaneously for comparison and analysis, supporting up to 20 users per request with optional detailed metrics.

Instructions

Get multiple user profiles in a single request for comparative analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernamesNoArray of usernames to analyze (e.g., ["elonmusk", "sundarpichai"])
userIdsNoArray of user IDs to analyze
includeMetricsNoInclude detailed metrics and analytics (default: true)

Implementation Reference

  • Core handler function implementing bulkUserProfiles tool: fetches and aggregates user profiles for multiple usernames or user IDs using SocialData client.
    export const handleBulkUserProfiles: SocialDataHandler<BulkUserProfilesArgs> = async ( _client: any, { usernames = [], userIds = [], includeMetrics = true }: BulkUserProfilesArgs ) => { try { const socialClient = getSocialDataClient(); if (!socialClient) { return createMissingApiKeyResponse('Bulk User Profiles'); } const profiles = []; // Process usernames for (const username of usernames) { try { const profile = await socialClient.getUserProfile({ username, includeMetrics }); profiles.push(profile.data); } catch (error) { console.warn(`Failed to get profile for username: ${username}`, error); } } // Process user IDs for (const userId of userIds) { try { const profile = await socialClient.getUserProfile({ userId, includeMetrics }); profiles.push(profile.data); } catch (error) { console.warn(`Failed to get profile for userId: ${userId}`, error); } } if (profiles.length === 0) { return createSocialDataResponse('No user profiles retrieved'); } return createSocialDataResponse( formatUserList(profiles, `Bulk User Profiles (${profiles.length} users)`) ); } catch (error) { throw new Error(formatSocialDataError(error as Error, 'bulk user profiles')); } };
  • JSON Schema and description for the bulkUserProfiles tool input, used for MCP tool registration.
    bulkUserProfiles: { description: 'Get multiple user profiles in a single request for comparative analysis', inputSchema: { type: 'object', properties: { usernames: { type: 'array', items: { type: 'string' }, description: 'Array of usernames to analyze (e.g., ["elonmusk", "sundarpichai"])', maxItems: 20 }, userIds: { type: 'array', items: { type: 'string' }, description: 'Array of user IDs to analyze', maxItems: 20 }, includeMetrics: { type: 'boolean', description: 'Include detailed metrics and analytics (default: true)' } }, required: [] } },
  • TypeScript interface defining the BulkUserProfilesArgs used by the handler.
    export interface BulkUserProfilesArgs { usernames?: string[]; userIds?: string[]; includeMetrics?: boolean; }
  • src/index.ts:441-444 (registration)
    Tool dispatch/registration in the main CallToolRequestSchema switch statement, calling the handler.
    case 'bulkUserProfiles': { const args = request.params.arguments as any; response = await handleBulkUserProfiles(client, args); break;
  • src/index.ts:71-72 (registration)
    Import of the handleBulkUserProfiles function from socialdata handlers for use in tool dispatching.
    handleBulkUserProfiles, handleUserGrowthAnalytics,

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/crazyrabbitLTC/mcp-twitter-server'

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