Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

userGrowthAnalytics

Analyze Twitter user growth patterns and engagement trends over time to understand audience expansion and interaction dynamics.

Instructions

Analyze user growth patterns and engagement trends over time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername to analyze growth patterns for
timeframeNoAnalysis timeframe (default: "weekly")
periodNoNumber of periods to analyze (default: 4)

Implementation Reference

  • The core handler function implementing the userGrowthAnalytics tool. It fetches the user's current profile and recent tweets using SocialData client, computes growth metrics like followers, recent activity, and average engagement, then formats and returns the analytics.
    export const handleUserGrowthAnalytics: SocialDataHandler<UserGrowthAnalyticsArgs> = async (
        _client: any,
        { username, timeframe = 'weekly', period = 4 }: UserGrowthAnalyticsArgs
    ) => {
        try {
            const socialClient = getSocialDataClient();
            
            if (!socialClient) {
                return createMissingApiKeyResponse('User Growth Analytics');
            }
            
            // Get current profile
            const currentProfile = await socialClient.getUserProfile({ username, includeMetrics: true });
            
            // Get recent tweets to analyze growth patterns
            const tweets = await socialClient.getUserTweets({ username, maxResults: 50 });
            
            // Calculate basic growth metrics from available data
            const analytics = {
                user: {
                    username: currentProfile.data.username,
                    current_followers: currentProfile.data.public_metrics?.followers_count || 0,
                    current_following: currentProfile.data.public_metrics?.following_count || 0,
                    total_tweets: currentProfile.data.public_metrics?.tweet_count || 0
                },
                timeframe,
                period,
                recent_activity: {
                    recent_tweets_count: tweets.data?.length || 0,
                    avg_engagement: tweets.data ? 
                        tweets.data.reduce((sum: number, tweet: any) => 
                            sum + (tweet.public_metrics?.like_count || 0) + 
                                  (tweet.public_metrics?.retweet_count || 0), 0) / tweets.data.length 
                        : 0
                },
                note: 'Growth analytics based on current snapshot and recent activity patterns'
            };
    
            return createSocialDataResponse(
                formatAnalytics(analytics, `User Growth Analytics for @${username}`)
            );
        } catch (error) {
            throw new Error(formatSocialDataError(error as Error, 'user growth analytics'));
        }
    };
  • Input schema definition for the userGrowthAnalytics tool, specifying parameters like username (required), timeframe, and period with validation rules.
    userGrowthAnalytics: {
        description: 'Analyze user growth patterns and engagement trends over time',
        inputSchema: {
            type: 'object',
            properties: {
                username: {
                    type: 'string',
                    description: 'Username to analyze growth patterns for'
                },
                timeframe: {
                    type: 'string',
                    enum: ['daily', 'weekly', 'monthly'],
                    description: 'Analysis timeframe (default: "weekly")'
                },
                period: {
                    type: 'number',
                    description: 'Number of periods to analyze (default: 4)',
                    minimum: 1,
                    maximum: 12
                }
            },
            required: ['username']
        }
    },
  • src/index.ts:446-449 (registration)
    Tool dispatch/registration in the main CallToolRequestSchema handler switch statement, routing calls to userGrowthAnalytics to the handleUserGrowthAnalytics function.
    case 'userGrowthAnalytics': {
        const args = request.params.arguments as any;
        response = await handleUserGrowthAnalytics(client, args);
        break;
  • TypeScript interface defining the input arguments for userGrowthAnalytics, used for type safety in the handler.
    export interface UserGrowthAnalyticsArgs {
        username: string;
        timeframe: 'daily' | 'weekly' | 'monthly';
        period?: number; // number of days/weeks/months
    }
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. While 'analyze' implies a read-only operation, the description doesn't specify whether this requires authentication, what data sources it uses, whether it has rate limits, or what format the analysis results take. For an analytics tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for what it communicates, though it could be more informative. The structure is simple but effective for conveying the basic purpose.

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?

For an analytics tool with 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what kind of analysis is performed, what metrics are returned, or how the results should be interpreted. With no structured output information and minimal behavioral context, this leaves the agent with inadequate guidance.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain how these parameters interact or what specific analysis they enable. With high schema coverage, baseline 3 is appropriate.

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

Purpose3/5

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

The description states the tool analyzes user growth patterns and engagement trends over time, which provides a general purpose. However, it's somewhat vague about what specific metrics or outputs are involved, and it doesn't clearly distinguish this tool from sibling analytics tools like 'analyzeFollowerDemographics' or 'userInfluenceMetrics' that might also examine user-related data.

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. With multiple sibling tools that analyze user data (e.g., 'analyzeFollowerDemographics', 'userInfluenceMetrics'), there's no indication of what makes this tool unique or when it should be preferred over others. The description only states what it does, not when to use it.

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