Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

unlikeTweet

Remove your like from a tweet on Twitter. Use this tool to undo a previous like action by providing the tweet ID.

Instructions

Unlike a previously liked tweet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweetIdYesThe ID of the tweet to unlike

Implementation Reference

  • Core handler function that executes the unlikeTweet tool: checks for Twitter client, retrieves authenticated user ID, calls Twitter API v2.unlike(userId, tweetId), and returns success/error response.
    export const handleUnlikeTweet: TwitterHandler<TweetEngagementArgs> = async (
        client: TwitterClient | null,
        { tweetId }: TweetEngagementArgs
    ): Promise<HandlerResponse> => {
        if (!client) {
            return createMissingTwitterApiKeyResponse('unlikeTweet');
        }
        
        try {
            const userId = await client.v2.me().then((response: any) => response.data.id);
            await client.v2.unlike(userId, tweetId);
            return createResponse(`Successfully unliked tweet: ${tweetId}`);
        } catch (error) {
            if (error instanceof Error) {
                throw new Error(formatTwitterError(error, 'unliking tweet'));
            }
            throw error;
        }
    };
  • MCP tool registration with input schema definition for unlikeTweet: requires tweetId string.
    unlikeTweet: {
        description: 'Unlike a previously liked tweet',
        inputSchema: {
            type: 'object',
            properties: {
                tweetId: { type: 'string', description: 'The ID of the tweet to unlike' }
            },
            required: ['tweetId'],
        },
    },
  • TypeScript interface defining input arguments for unlikeTweet handler.
    export interface UnlikeTweetArgs {
        tweetId: string;
    }
  • src/index.ts:187-190 (registration)
    MCP server dispatch/registration: routes 'unlikeTweet' tool calls to the handleUnlikeTweet function.
    case 'unlikeTweet': {
        const { tweetId } = request.params.arguments as { tweetId: string };
        response = await handleUnlikeTweet(client, { tweetId });
        break;
  • Runtime validation function to assert and validate UnlikeTweetArgs input.
    export function assertUnlikeTweetArgs(args: unknown): asserts args is UnlikeTweetArgs {
        if (typeof args !== 'object' || args === null) {
            throw new Error('Invalid arguments: expected object');
        }
        if (!('tweetId' in args) || typeof (args as any).tweetId !== 'string') {
            throw new Error('Invalid arguments: expected tweetId string');
        }
    }
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. It mentions the action ('Unlike') which implies a mutation, but doesn't specify permissions required, rate limits, whether the operation is reversible, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is insufficient.

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 front-loaded with the core action and immediately communicates the tool's purpose 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 incomplete. It doesn't address behavioral aspects like error conditions, authentication requirements, or what the tool returns. The 100% schema coverage helps with parameters, but other critical context is missing.

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%, so the schema already fully documents the single parameter 'tweetId'. The description doesn't add any additional semantic context about the parameter beyond what's in the schema (e.g., format examples, constraints). Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Unlike') and target resource ('a previously liked tweet'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'likeTweet' or 'undoRetweet', but the action is specific enough to imply distinction.

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 like 'undoRetweet' (which might serve a similar function) or prerequisites (e.g., the tweet must be currently liked). It simply states what the tool does without context about appropriate usage scenarios.

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