Skip to content

Commit 49c6b23

Browse files
committed
Fix Twitter responses
1 parent f3e3499 commit 49c6b23

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ build/
1818
uv.lock
1919

2020
# IDE
21-
.idea
21+
.idea
22+
23+
.DS_Store

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ packages = ["src/x_twitter_mcp"]
55

66
[project]
77
name = "x-twitter-mcp"
8-
version = "0.1.7"
8+
version = "0.1.8"
99
description = "Twitter search tool for FastMCP using Tweepy"
1010
readme = "README.md"
1111
requires-python = ">=3.10"

src/x_twitter_mcp/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ async def post_tweet(text: str, media_paths: Optional[List[str]] = None, reply_t
169169
media_ids.append(media.media_id_string)
170170
tweet_data["media_ids"] = media_ids
171171
tweet = client.create_tweet(**tweet_data)
172-
return tweet.data.data
172+
logger.info(f"Response from client.create_tweet: {tweet}")
173+
return tweet.get("data", {})
173174

174175
@server.tool(name="delete_tweet", description="Delete a tweet by its ID")
175176
async def delete_tweet(tweet_id: str) -> Dict:
@@ -291,7 +292,7 @@ async def get_trends(category: Optional[str] = None, count: Optional[int] = 50)
291292
trends = [t for t in trends if t.get("category") == category]
292293
return trends[:count]
293294

294-
@server.tool(name="get_highlights_tweets", description="Retrieves highlighted tweets from a users timeline")
295+
@server.tool(name="get_highlights_tweets", description="Retrieves highlighted tweets from a user's timeline")
295296
async def get_highlights_tweets(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]:
296297
"""Fetches highlighted tweets."""
297298
client, _ = initialize_twitter_clients()

0 commit comments

Comments
 (0)