Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

undoRetweet

Remove a retweet from your Twitter account by specifying the tweet ID using this tool, allowing you to manage your retweets with precision.

Instructions

Undo a retweet by its ID

Input Schema

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

Implementation Reference

  • Executes the undoRetweet tool: checks for Twitter client, gets authenticated user ID, calls Twitter API v2 unretweet(userId, tweetId), returns success message or formatted error.
    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 in TOOLS object: input requires tweetId string, used for tool listing and validation.
    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)
    Tool dispatch in server.setRequestHandler(CallToolRequestSchema): extracts tweetId arg, calls handleUndoRetweet.
    case 'undoRetweet': { const { tweetId } = request.params.arguments as { tweetId: string }; response = await handleUndoRetweet(client, { tweetId }); break;
  • TypeScript interface for undoRetweet input arguments used by handler.
    export interface UndoRetweetArgs { tweetId: string; }

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