Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

replyToTweet

Post a response to a specific tweet on Twitter using the tweet ID and reply text.

Instructions

Reply to a tweet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to reply to
textYesThe text of the reply

Implementation Reference

  • Core handler function that executes the replyToTweet tool by calling Twitter API v2.reply with the provided tweetId and text.
    export async function handleReplyToTweet(
        client: TwitterClient | null,
        { tweetId, text }: { tweetId: string; text: string }
    ): Promise<HandlerResponse> {
        if (!client) {
            return createMissingTwitterApiKeyResponse('Reply to Tweet');
        }
    
        try {
            const tweet = await client.v2.reply(text, tweetId);
            return createResponse(`Successfully replied to tweet: ${tweet.data.id}`);
        } catch (error) {
            if (error instanceof Error) {
                throw new Error(formatTwitterError(error, 'replying to tweet'));
            }
            throw new Error('Failed to reply to tweet: Unknown error occurred');
        }
    }
  • MCP tool schema definition for replyToTweet, specifying input parameters tweetId and text.
    replyToTweet: {
        description: 'Reply to a tweet',
        inputSchema: {
            type: 'object',
            properties: {
                tweetId: {
                    type: 'string',
                    description: 'The ID of the tweet to reply to'
                },
                text: {
                    type: 'string',
                    description: 'The text of the reply'
                }
            },
            required: ['tweetId', 'text']
        }
    },
  • src/index.ts:172-175 (registration)
    Tool call registration and dispatch in the MCP server's CallToolRequestHandler switch case.
    case 'replyToTweet': {
        const { tweetId, text } = request.params.arguments as { tweetId: string; text: string };
        response = await handleReplyToTweet(client, { tweetId, text });
        break;
  • TypeScript interface defining the input arguments for replyToTweet.
    export interface ReplyToTweetArgs {
        tweetId: string;
        text: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Reply to a tweet' implies a write/mutation operation but doesn't disclose any behavioral traits: no mention of authentication requirements, rate limits, whether replies are public/private, character limits, or what happens when the tweet doesn't exist. This leaves significant gaps for a mutation tool.

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 maximally concise with just three words that directly convey the core functionality. There's zero wasted language, and it's perfectly front-loaded with the essential information.

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 a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, authentication requirements, or behavioral constraints. The 100% schema coverage helps with parameters, but the overall context for using this tool remains incomplete.

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 fully documents both parameters (tweetId and text). The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 ('reply to') and resource ('a tweet'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'postTweet' or 'sendDirectMessage' which also involve creating content, missing an opportunity for clearer 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. There's no mention of prerequisites (like authentication), when not to use it, or how it differs from similar tools like 'postTweet' (which creates original tweets) or 'sendDirectMessage' (for private messages).

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