get_highlights_tweets
Retrieve highlighted tweets from a specific user's timeline using their user ID. Customize results by setting the count and cursor for targeted data extraction.
Instructions
Retrieves highlighted tweets from a user's timeline (simulated)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| cursor | No | ||
| user_id | Yes |
Implementation Reference
- src/x_twitter_mcp/server.py:409-409 (registration)Registers the 'get_highlights_tweets' tool with FastMCP server using the @server.tool decorator.@server.tool(name="get_highlights_tweets", description="Retrieves highlighted tweets from a user's timeline (simulated)")
- src/x_twitter_mcp/server.py:410-421 (handler)The handler function that implements the tool logic by initializing the Twitter client and fetching the user's recent tweets using `get_users_tweets` as a proxy for 'highlights', since no direct endpoint exists.async def get_highlights_tweets(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]: """Fetches highlighted tweets from a user's timeline. (Simulated using user's timeline as Twitter API v2 doesn't have a direct 'highlights' endpoint). Args: user_id (str): The ID of the user whose highlights are to be fetched. count (Optional[int]): Number of tweets to retrieve. Default 100. Min 5, Max 100 for get_users_tweets. cursor (Optional[str]): Pagination token for fetching the next set of results. """ client, _ = initialize_twitter_clients() # Twitter API v2 doesn't have highlights; use user timeline tweets = client.get_users_tweets(id=user_id, max_results=count, pagination_token=cursor, tweet_fields=["id", "text", "created_at"]) return [tweet.data for tweet in tweets.data]
- src/x_twitter_mcp/server.py:410-410 (schema)Function signature defining input parameters (user_id: str, count: Optional[int], cursor: Optional[str]) and output type (List[Dict]) for schema inference.async def get_highlights_tweets(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]: