Skip to main content
Glama
rafaljanicki

X (Twitter) MCP server

by rafaljanicki

create_poll_tweet

Generate a tweet with an interactive poll, allowing users to vote on specified choices within a set time frame, using the X (Twitter) MCP server.

Instructions

Create a tweet with a poll

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
choicesYes
duration_minutesYes
textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the create_poll_tweet tool with the FastMCP server.
    @server.tool(name="create_poll_tweet", description="Create a tweet with a poll")
  • The main handler function that performs rate limiting check, initializes Twitter client, constructs poll data, creates the tweet with poll using tweepy.Client.create_tweet, and returns the tweet data.
    async def create_poll_tweet(text: str, choices: List[str], duration_minutes: int) -> Dict:
        """Creates a poll tweet.
    
        Args:
            text (str): The question or text for the poll.
            choices (List[str]): A list of poll choices (2-4 choices, each max 25 characters).
            duration_minutes (int): Duration of the poll in minutes (min 5, max 10080 (7 days)).
        """
        if not check_rate_limit("tweet_actions"):
            raise Exception("Tweet action rate limit exceeded")
        client, _ = initialize_twitter_clients()
        poll_data = {
            "text": text,
            "poll_options": choices,
            "poll_duration_minutes": duration_minutes
        }
        tweet = client.create_tweet(**poll_data)
        return tweet.data
  • Type hints defining the input schema: text (str), choices (List[str]), duration_minutes (int) and output Dict.
    async def create_poll_tweet(text: str, choices: List[str], duration_minutes: int) -> Dict:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'create' implying a write operation, but fails to mention critical aspects like authentication requirements, rate limits, whether the tweet is publicly posted, or what happens on success/failure. This leaves significant gaps in understanding the tool's behavior and risks.

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 extremely concise with a single sentence that directly states the tool's purpose without any fluff or redundancy. It is front-loaded and wastes no words, making it efficient for quick understanding, though this brevity contributes to gaps in other dimensions.

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 (a write operation with 3 parameters), no annotations, and low schema coverage, the description is incomplete. While an output schema exists, the description does not address key contextual elements like behavioral traits, parameter meanings, or usage guidelines, leaving the agent poorly equipped to use the tool effectively.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate but adds no parameter details beyond the tool name. It does not explain what 'choices', 'duration_minutes', or 'text' represent (e.g., poll options, voting time, tweet content), their formats, or constraints (e.g., choice count limits, duration range). This fails to provide meaningful semantic context for the parameters.

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 verb 'create' and the resource 'tweet with a poll', making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'post_tweet' (which creates a regular tweet) or 'vote_on_poll' (which interacts with existing polls), leaving room for ambiguity in distinguishing its unique function.

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, such as 'post_tweet' for non-poll tweets or 'vote_on_poll' for interacting with existing polls. It lacks any context about prerequisites, constraints, or typical scenarios, offering minimal help in decision-making.

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

Related 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/rafaljanicki/x-twitter-mcp-server'

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