Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

deleteTweet

Remove a tweet from Twitter using its unique ID to manage content or correct errors.

Instructions

Delete a tweet by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to delete

Implementation Reference

  • The main handler function that executes the deleteTweet tool logic. It validates the Twitter client, calls the Twitter API v2 deleteTweet method, 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');
        }
    }
  • The tool schema definition including description and input validation schema for the deleteTweet tool, used for MCP tool listing and validation.
    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)
    The switch case in the main tool call handler that routes 'deleteTweet' calls to the handleDeleteTweet function.
    case 'deleteTweet': {
        const { tweetId } = request.params.arguments as { tweetId: string };
        response = await handleDeleteTweet(client, { tweetId });
        break;
  • src/index.ts:17-21 (registration)
    Import statement that brings the handleDeleteTweet handler into the main index file for use in tool dispatching.
    handlePostTweet,
    handlePostTweetWithMedia,
    handleGetTweetById,
    handleReplyToTweet,
    handleDeleteTweet,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the destructive action ('Delete') but lacks critical details: whether deletion is permanent, if it requires specific permissions (e.g., user authentication), rate limits, or error conditions (e.g., invalid tweet ID). 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, direct sentence with zero wasted words, front-loading the core action and resource. It efficiently communicates the essential purpose without unnecessary elaboration, making it easy for an agent to parse quickly.

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 destructive tool with no annotations and no output schema, the description is insufficient. It doesn't address behavioral risks (e.g., irreversibility), success/error responses, or integration with sibling tools (e.g., 'getTweetById' for validation). Given the complexity of tweet deletion in a social media context, more contextual guidance is needed.

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%, with the single parameter 'tweetId' clearly documented in the schema. The description adds no additional semantic context beyond implying the parameter is required for deletion, meeting the baseline score when the schema handles parameter documentation effectively.

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 ('Delete') and target resource ('a tweet by its ID'), making the purpose immediately understandable. However, it doesn't differentiate itself from sibling tools like 'unlikeTweet' or 'undoRetweet' that might also remove tweet-related content, leaving some ambiguity about its specific role in the toolset.

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., needing ownership of the tweet), exclusions (e.g., cannot delete retweets), or related tools like 'getTweetById' for verification, leaving the agent to infer usage context from the tool name alone.

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