Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

historicalTweetSearch

Search historical tweets beyond standard API limitations using date ranges and queries to analyze past Twitter conversations and trends.

Instructions

Search historical tweets beyond standard API limitations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
dateRangeYesDate range for historical search
maxResultsNoMaximum number of results (default: 50, max: 200)

Implementation Reference

  • Core handler function executing the historical tweet search logic using socialClient.searchTweets with query, dateRange, and maxResults. Handles errors and formats response with tweet list.
    export const handleHistoricalTweetSearch: SocialDataHandler<HistoricalSearchArgs> = async (
        _client: any,
        { query, dateRange, maxResults = 50 }: HistoricalSearchArgs
    ) => {
        try {
            const socialClient = getSocialDataClient();
            
            if (!socialClient) {
                return createMissingApiKeyResponse('Historical Tweet Search');
            }
            
            const result = await socialClient.searchTweets({
                query,
                maxResults,
                startTime: dateRange.start,
                endTime: dateRange.end
            });
    
            if (!result.data || result.data.length === 0) {
                return createSocialDataResponse(
                    `No historical tweets found for "${query}" between ${dateRange.start} and ${dateRange.end}`
                );
            }
    
            return createSocialDataResponse(
                formatTweetList(
                    result.data, 
                    `Historical Search Results for "${query}" (${dateRange.start} to ${dateRange.end})`
                )
            );
        } catch (error) {
            throw new Error(formatSocialDataError(error as Error, 'historical tweet search'));
        }
    };
  • Input schema and description for the historicalTweetSearch tool, defining query, dateRange (start/end ISO strings), and optional maxResults.
    historicalTweetSearch: {
        description: 'Search historical tweets beyond standard API limitations',
        inputSchema: {
            type: 'object',
            properties: {
                query: {
                    type: 'string',
                    description: 'Search query string'
                },
                dateRange: {
                    type: 'object',
                    properties: {
                        start: {
                            type: 'string',
                            description: 'Start date in ISO 8601 format'
                        },
                        end: {
                            type: 'string',
                            description: 'End date in ISO 8601 format'
                        }
                    },
                    required: ['start', 'end'],
                    description: 'Date range for historical search'
                },
                maxResults: {
                    type: 'number',
                    description: 'Maximum number of results (default: 50, max: 200)',
                    minimum: 1,
                    maximum: 200
                }
            },
            required: ['query', 'dateRange']
        }
    },
  • src/tools.ts:736-738 (registration)
    Registers historicalTweetSearch (and other SocialData tools) in the main TOOLS export for MCP ListToolsRequest by spreading SOCIALDATA_TOOLS.
        // SocialData.tools enhanced research and analytics
        ...SOCIALDATA_TOOLS
    }; 
  • src/index.ts:431-434 (registration)
    Dispatches tool calls to the handleHistoricalTweetSearch function in the MCP server's CallToolRequest handler switch statement.
    case 'historicalTweetSearch': {
        const args = request.params.arguments as any;
        response = await handleHistoricalTweetSearch(client, args);
        break;
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 mentions 'beyond standard API limitations' but doesn't explain what this entails—whether it involves higher rate limits, access to older data, different authentication requirements, or potential costs. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior and constraints.

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 that directly states the tool's core function without unnecessary words. It's appropriately sized and front-loaded, with every part of the sentence contributing to understanding the tool's purpose.

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

Completeness3/5

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

Given the complexity (search tool with 3 parameters, no output schema, and no annotations), the description is minimally adequate but has clear gaps. It states the purpose but lacks usage guidelines, behavioral details, and output information. For a tool that likely involves significant API limitations or special access, more context would be helpful, though the schema covers parameters well.

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 parameters (query, dateRange, maxResults) with descriptions and constraints. The description adds no additional parameter semantics beyond what's in the schema, such as query syntax examples or date format details. Baseline 3 is appropriate when the schema does the heavy lifting.

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 as 'Search historical tweets beyond standard API limitations', which specifies the verb (search), resource (historical tweets), and key capability (beyond standard API limitations). However, it doesn't explicitly differentiate from sibling tools like 'searchTweets' or 'advancedTweetSearch', which likely handle different search scopes or capabilities.

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 'beyond standard API limitations' but doesn't specify what those limitations are or when this tool is preferable over sibling tools like 'searchTweets' or 'advancedTweetSearch'. No exclusions or prerequisites are mentioned.

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