Skip to main content
Glama
cjkcr

X(Twitter) MCP Server

by cjkcr

quote_tweet

Share a tweet with your own commentary to provide context, add perspective, or engage in discussion on X (Twitter).

Instructions

Quote tweet with comment (retweet with your own comment)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentYesYour comment on the quoted tweet
tweet_idYesThe ID of the tweet to quote

Implementation Reference

  • The main handler function for the 'quote_tweet' tool. It validates the input arguments (tweet_id and comment), uses the Twitter API client to create a quote tweet by calling create_tweet with quote_tweet_id parameter, logs the result, and returns a success message with the new quote tweet ID.
    async def handle_quote_tweet(arguments: Any) -> Sequence[TextContent]:
        if not isinstance(arguments, dict) or "tweet_id" not in arguments or "comment" not in arguments:
            raise ValueError("Invalid arguments for quote_tweet")
        
        tweet_id = arguments["tweet_id"]
        comment = arguments["comment"]
        
        try:
            # Quote tweet with comment
            response = get_write_client().create_tweet(text=comment, quote_tweet_id=tweet_id)
            quote_tweet_id = response.data['id']
            
            logger.info(f"Quote tweeted tweet {tweet_id} with comment. Quote tweet ID: {quote_tweet_id}")
            
            return [
                TextContent(
                    type="text",
                    text=f"Successfully quote tweeted tweet {tweet_id} with comment. Quote tweet ID: {quote_tweet_id}",
                )
            ]
        except tweepy.TweepError as e:
            logger.error(f"Twitter API error quote tweeting tweet {tweet_id}: {e}")
            raise RuntimeError(f"Twitter API error quote tweeting tweet {tweet_id}: {e}")
        except Exception as e:
            logger.error(f"Error quote tweeting tweet {tweet_id}: {str(e)}")
            raise RuntimeError(f"Error quote tweeting tweet {tweet_id}: {str(e)}")
  • Registration of the 'quote_tweet' tool in the list_tools() function decorated with @server.list_tools(). Defines the tool name, description, and input schema for MCP.
        name="quote_tweet",
        description="Quote tweet with comment (retweet with your own comment)",
        inputSchema={
            "type": "object",
            "properties": {
                "tweet_id": {
                    "type": "string",
                    "description": "The ID of the tweet to quote",
                },
                "comment": {
                    "type": "string",
                    "description": "Your comment on the quoted tweet",
                },
            },
            "required": ["tweet_id", "comment"],
        },
    ),
  • Input schema definition for the 'quote_tweet' tool, specifying required string parameters 'tweet_id' and 'comment'.
        "type": "object",
        "properties": {
            "tweet_id": {
                "type": "string",
                "description": "The ID of the tweet to quote",
            },
            "comment": {
                "type": "string",
                "description": "Your comment on the quoted tweet",
            },
        },
        "required": ["tweet_id", "comment"],
    },
  • Dispatch/registration in the call_tool() function that routes calls to the 'quote_tweet' tool to its handler function.
    elif name == "quote_tweet":
        return await handle_quote_tweet(arguments)
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 the action ('quote tweet with comment') but does not disclose critical traits such as whether this is a public post, requires authentication, has rate limits, or what the expected outcome is (e.g., success/failure response). For a mutation tool with zero annotation coverage, this is a significant gap.

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 front-loads the core action ('quote tweet with comment') and includes a clarifying parenthetical. Every word earns its place with no redundancy or unnecessary elaboration.

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 complexity of a mutation tool (posting to a social platform) with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., authentication needs, side effects) and expected outputs, which are crucial for an agent to use the tool correctly and safely.

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%, with clear parameter descriptions in the schema ('Your comment on the quoted tweet' and 'The ID of the tweet to quote'). The description adds no additional meaning beyond what the schema provides, such as format details or constraints. 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.

Purpose5/5

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

The description clearly states the specific action ('quote tweet with comment') and resource ('tweet'), distinguishing it from siblings like 'retweet' (which lacks a comment) and 'reply_to_tweet' (which is a direct reply rather than a quote). The phrase 'retweet with your own comment' further clarifies the purpose by relating it to a familiar Twitter concept.

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

Usage Guidelines3/5

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

The description implies usage by specifying the action, but it does not explicitly state when to use this tool versus alternatives like 'retweet' (for sharing without comment) or 'reply_to_tweet' (for direct replies). No exclusions or prerequisites are mentioned, leaving the agent to infer context from the tool name and description alone.

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/cjkcr/x-mcp'

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