Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

retweet

Share a tweet with your followers by specifying its ID. This tool enables you to amplify content on Twitter through the Twitter MCP Server.

Instructions

Retweet a tweet by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to retweet

Implementation Reference

  • The `handleRetweet` function implements the core logic for the 'retweet' tool. It validates the Twitter client, retrieves the authenticated user ID, performs the retweet using Twitter API v2, and returns a success message or throws a formatted error.
    export const handleRetweet: TwitterHandler<TweetEngagementArgs> = async (
        client: TwitterClient | null,
        { tweetId }: TweetEngagementArgs
    ): Promise<HandlerResponse> => {
        if (!client) {
            return createMissingTwitterApiKeyResponse('retweet');
        }
        
        try {
            const userId = await client.v2.me().then((response: any) => response.data.id);
            await client.v2.retweet(userId, tweetId);
            return createResponse(`Successfully retweeted tweet: ${tweetId}`);
        } catch (error) {
            if (error instanceof Error) {
                throw new Error(formatTwitterError(error, 'retweeting'));
            }
            throw error;
        }
    };
  • Input schema definition for the 'retweet' tool, specifying the required 'tweetId' parameter.
    retweet: {
        description: 'Retweet a tweet by its ID',
        inputSchema: {
            type: 'object',
            properties: {
                tweetId: { type: 'string', description: 'The ID of the tweet to retweet' }
            },
            required: ['tweetId'],
        },
    },
  • src/index.ts:192-195 (registration)
    Dispatch logic in the main tool request handler that routes calls to the 'retweet' tool to the `handleRetweet` function.
    case 'retweet': {
        const { tweetId } = request.params.arguments as { tweetId: string };
        response = await handleRetweet(client, { tweetId });
        break;
  • src/index.ts:104-109 (registration)
    Tool listing registration that includes the 'retweet' tool from the TOOLS object when listing available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: Object.entries(TOOLS).map(([name, tool]) => ({
            name,
            ...tool
        }))
    }));
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. While 'retweet' implies a write/mutation operation, the description doesn't specify authentication requirements, rate limits, whether it's idempotent, what happens on success/failure, or any side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero wasted words. It's appropriately sized for a simple tool with one parameter and gets straight to the point without 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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after retweeting (success response, error conditions), authentication requirements, or how this differs from related operations. The agent would need to guess about important behavioral aspects.

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?

The description mentions 'by its ID' which aligns with the single parameter 'tweetId' in the schema. Since schema description coverage is 100% (the parameter already has a clear description), the description adds minimal value beyond what's in the structured schema, meeting the baseline for high 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 action ('retweet') and target resource ('a tweet by its ID'), providing specific verb+resource combination. However, it doesn't explicitly distinguish this from sibling tools like 'undoRetweet' or 'getRetweets', which would require mentioning it's a creation/action tool rather than a retrieval or undo operation.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (like authentication requirements), when not to use it, or how it differs from similar tools like 'undoRetweet' or 'getRetweets' in the sibling list.

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