Skip to main content
Glama
rafaljanicki

X (Twitter) MCP server

by rafaljanicki

unfavorite_tweet

Remove a tweet from your favorites list on X (Twitter) by specifying its tweet ID. Simplify cleanup and manage your saved tweets with ease.

Instructions

Unfavorites a tweet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tweet_idYes

Implementation Reference

  • Handler function that executes the unfavorite_tweet tool logic: performs rate limiting check, initializes Twitter API client, calls unlike method, and returns confirmation.
    async def unfavorite_tweet(tweet_id: str) -> Dict:
        """Unfavorites a tweet.
    
        Args:
            tweet_id (str): The ID of the tweet to unfavorite (unlike).
        """
        if not check_rate_limit("like_actions"):
            raise Exception("Like action rate limit exceeded")
        client, _ = initialize_twitter_clients()
        result = client.unlike(tweet_id=tweet_id)
        return {"tweet_id": tweet_id, "liked": not result.data["liked"]}
  • Registers the unfavorite_tweet tool with the FastMCP server using the @server.tool decorator, specifying the name and description.
    @server.tool(name="unfavorite_tweet", description="Unfavorites a tweet")

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/rafaljanicki/x-twitter-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server