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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves multiple profiles but doesn't mention rate limits, authentication requirements, error handling (e.g., if some usernames are invalid), or the response format. For a tool with no annotations, this is a significant gap in transparency about how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get multiple user profiles in a single request for comparative analysis.' It is front-loaded with the core purpose and wastes no words, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (fetching multiple user profiles with optional metrics), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like rate limits or error handling, and without an output schema, it should ideally hint at the return format (e.g., a list of profiles with metrics). This leaves gaps for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for 'usernames,' 'userIds,' and 'includeMetrics.' The description adds no additional parameter semantics beyond what the schema provides, such as explaining how 'usernames' and 'userIds' interact or what 'comparative analysis' entails. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get multiple user profiles in a single request for comparative analysis.' It specifies the verb ('Get'), resource ('multiple user profiles'), and context ('for comparative analysis'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'getUserInfo' or 'getAuthenticatedUser,' which likely fetch single user profiles, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'comparative analysis' as a use case but doesn't specify prerequisites, exclusions, or compare it to sibling tools like 'getUserInfo' (for single profiles) or 'analyzeFollowerDemographics' (for deeper analysis). This leaves the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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