Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

bulkUserProfiles

Retrieve and compare multiple Twitter user profiles in a single request, including detailed metrics and analytics, for comprehensive analysis on the Twitter MCP Server.

Instructions

Get multiple user profiles in a single request for comparative analysis

Input Schema

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

Implementation Reference

  • Main handler function implementing the bulkUserProfiles tool: fetches profiles for multiple usernames and user IDs using socialDataClient, handles errors per user, and formats the response.
    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')); } };
  • MCP tool schema definition for bulkUserProfiles, including description and input schema with properties for usernames, userIds, and includeMetrics.
    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 input arguments for BulkUserProfilesArgs used in the handler.
    export interface BulkUserProfilesArgs { usernames?: string[]; userIds?: string[]; includeMetrics?: boolean; }
  • src/index.ts:441-444 (registration)
    Registration in the main CallToolRequestHandler switch statement: routes 'bulkUserProfiles' tool calls to handleBulkUserProfiles.
    case 'bulkUserProfiles': { const args = request.params.arguments as any; response = await handleBulkUserProfiles(client, args); break;
  • src/index.ts:71-83 (registration)
    Import statement in src/index.ts that brings in handleBulkUserProfiles from the socialdata handlers index.
    handleBulkUserProfiles, handleUserGrowthAnalytics, handleUserInfluenceMetrics, handleGetFullThread, handleGetConversationTree, handleGetThreadMetrics, handleFindMutualConnections, handleAnalyzeFollowerDemographics, handleMapInfluenceNetwork, handleGetHashtagTrends, handleAnalyzeSentiment, handleTrackVirality } from './handlers/socialdata/index.js';

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