Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

undoRetweet

Remove a retweet from your Twitter timeline by providing the tweet ID. This action reverses sharing while keeping the original tweet intact.

Instructions

Undo a retweet by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to un-retweet

Implementation Reference

  • Main handler function that performs the undoRetweet operation using Twitter API v2.unretweet after getting the authenticated user ID.
    export const handleUndoRetweet: TwitterHandler<TweetEngagementArgs> = async (
        client: TwitterClient | null,
        { tweetId }: TweetEngagementArgs
    ): Promise<HandlerResponse> => {
        if (!client) {
            return createMissingTwitterApiKeyResponse('undoRetweet');
        }
        
        try {
            const userId = await client.v2.me().then((response: any) => response.data.id);
            await client.v2.unretweet(userId, tweetId);
            return createResponse(`Successfully undid retweet: ${tweetId}`);
        } catch (error) {
            if (error instanceof Error) {
                throw new Error(formatTwitterError(error, 'undoing retweet'));
            }
            throw error;
        }
    };
  • MCP tool schema definition for undoRetweet, specifying the input schema requiring tweetId.
    undoRetweet: {
        description: 'Undo a retweet by its ID',
        inputSchema: {
            type: 'object',
            properties: {
                tweetId: { type: 'string', description: 'The ID of the tweet to un-retweet' }
            },
            required: ['tweetId'],
        },
    },
  • src/index.ts:197-200 (registration)
    Registration in the main CallToolRequestSchema handler switch statement, dispatching to handleUndoRetweet.
    case 'undoRetweet': {
        const { tweetId } = request.params.arguments as { tweetId: string };
        response = await handleUndoRetweet(client, { tweetId });
        break;
  • TypeScript interface defining the input arguments for undoRetweet.
    export interface UndoRetweetArgs {
        tweetId: string;
    }
  • src/index.ts:104-109 (registration)
    Registration of all tools including undoRetweet via the TOOLS object for the ListToolsRequestSchema.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Undo a retweet' implies a mutation/deletion action, but it doesn't specify permissions required, whether it's reversible, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unaddressed.

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, direct sentence with zero wasted words. It's front-loaded with the core action and efficiently conveys the purpose without unnecessary elaboration, making it highly concise and well-structured.

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 mutation operation), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like error conditions, side effects, or return values, leaving gaps that could hinder an AI agent's correct invocation.

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 input schema has 100% description coverage, with the parameter 'tweetId' documented as 'The ID of the tweet to un-retweet'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without extra value.

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 'Undo a retweet by its ID' clearly states the action (undo/remove) and the resource (retweet), using a specific verb that distinguishes it from sibling tools like 'retweet', 'unlikeTweet', or 'deleteTweet'. It precisely communicates what the tool does without ambiguity.

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 doesn't mention prerequisites (e.g., must have retweeted the tweet first), exclusions, or compare it to similar tools like 'deleteTweet' (for original tweets) or 'unlikeTweet' (for likes). Usage is implied but not explicitly stated.

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