Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

deleteTweet

Remove a specific tweet from Twitter by providing its unique ID using the Twitter MCP Server. Streamline content management and maintain control over your social media presence.

Instructions

Delete a tweet by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to delete

Implementation Reference

  • The core handler function that executes the deleteTweet tool logic. It checks for a valid TwitterClient, calls client.v2.deleteTweet(tweetId), and handles errors with formatted responses.
    export async function handleDeleteTweet( client: TwitterClient | null, { tweetId }: { tweetId: string } ): Promise<HandlerResponse> { if (!client) { return createMissingTwitterApiKeyResponse('Delete Tweet'); } try { await client.v2.deleteTweet(tweetId); return createResponse(`Successfully deleted tweet: ${tweetId}`); } catch (error) { if (error instanceof Error) { throw new Error(formatTwitterError(error, 'deleting tweet')); } throw new Error('Failed to delete tweet: Unknown error occurred'); } }
  • Defines the tool schema including description and input validation schema for deleteTweet, specifying that tweetId is required.
    deleteTweet: { description: 'Delete a tweet by its ID', inputSchema: { type: 'object', properties: { tweetId: { type: 'string', description: 'The ID of the tweet to delete' } }, required: ['tweetId'] } },
  • src/index.ts:177-180 (registration)
    Registers and dispatches the deleteTweet tool in the MCP server's CallToolRequestHandler switch statement by extracting tweetId from arguments and calling the handleDeleteTweet function.
    case 'deleteTweet': { const { tweetId } = request.params.arguments as { tweetId: string }; response = await handleDeleteTweet(client, { tweetId }); break;

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