Twitter/X Automation via Rube MCP
Selective Reading Rule
Start with:
references/senior-master-standard.md
references/usage-routing.md
references/quality-checklist.md
Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.
Automate Twitter/X operations through Composio's Twitter toolkit via Rube MCP.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Twitter connection via
RUBE_MANAGE_CONNECTIONS with toolkit twitter
- Always call
RUBE_SEARCH_TOOLS first to get current tool schemas
Setup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming
RUBE_SEARCH_TOOLS responds
- Call
RUBE_MANAGE_CONNECTIONS with toolkit twitter
- If connection is not ACTIVE, follow the returned auth link to complete Twitter OAuth
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Create and Manage Posts
When to use: User wants to create, delete, or look up tweets/posts
Tool sequence:
TWITTER_USER_LOOKUP_ME - Get authenticated user info [Prerequisite]
TWITTER_UPLOAD_MEDIA / TWITTER_UPLOAD_LARGE_MEDIA - Upload media [Optional]
TWITTER_CREATION_OF_A_POST - Create a new post [Required]
TWITTER_POST_LOOKUP_BY_POST_ID - Look up a specific post [Optional]
TWITTER_POST_DELETE_BY_POST_ID - Delete a post [Optional]
Key parameters:
text: Post text content (max 280 weighted characters)
media__media_ids: Array of media ID strings for attachments
reply__in_reply_to_tweet_id: Tweet ID to reply to
quote_tweet_id: Tweet ID to quote
id: Post ID for lookup/delete
Pitfalls:
- Post text is limited to 280 weighted characters; some characters count as more than one
- Posting is NOT idempotent; retrying on timeout will create duplicate posts
- Media IDs must be numeric strings, not integers
- UPLOAD_LARGE_MEDIA is for videos/GIFs; UPLOAD_MEDIA for images
- Always call USER_LOOKUP_ME first to get the authenticated user's ID
2. Search Posts
When to use: User wants to find tweets matching specific criteria
Tool sequence:
TWITTER_RECENT_SEARCH - Search recent tweets (last 7 days) [Required]
TWITTER_FULL_ARCHIVE_SEARCH - Search full archive (Academic access) [Optional]
TWITTER_RECENT_SEARCH_COUNTS - Get tweet count matching query [Optional]
Key parameters:
query: Search query using Twitter search operators
max_results: Results per page (10-100)
next_token: Pagination token
start_time/end_time: ISO 8601 time range
tweet__fields: Comma-separated fields to include
expansions: Related objects to expand
Pitfalls:
- RECENT_SEARCH covers only the last 7 days; use FULL_ARCHIVE_SEARCH for older tweets
- FULL_ARCHIVE_SEARCH requires Academic Research or Enterprise access
- Query operators:
from:username, to:username, is:retweet, has:media, -is:retweet
- Empty results return
meta.result_count: 0 with no data field
- Rate limits vary by endpoint and access level; check response headers
3. Look Up Users
When to use: User wants to find or inspect Twitter user profiles
Tool sequence:
TWITTER_USER_LOOKUP_ME - Get authenticated user [Optional]
TWITTER_USER_LOOKUP_BY_USERNAME - Look up by username [Optional]
TWITTER_USER_LOOKUP_BY_ID - Look up by user ID [Optional]
TWITTER_USER_LOOKUP_BY_IDS - Batch look up multiple users [Optional]
Key parameters:
username: Twitter handle without @ prefix
id: Numeric user ID string
ids: Comma-separated user IDs for batch lookup
user__fields: Fields to return (description, public_metrics, etc.)
Pitfalls:
- Usernames are case-insensitive but must not include the @ prefix
- User IDs are numeric strings, not integers
- Suspended or deleted accounts return errors, not empty results
- LOOKUP_BY_IDS accepts max 100 IDs per request
4. Manage Bookmarks
When to use: User wants to save, view, or remove bookmarked tweets
Tool sequence:
TWITTER_USER_LOOKUP_ME - Get authenticated user ID [Prerequisite]
TWITTER_BOOKMARKS_BY_USER - List bookmarked posts [Required]
TWITTER_ADD_POST_TO_BOOKMARKS - Bookmark a post [Optional]
TWITTER_REMOVE_A_BOOKMARKED_POST - Remove bookmark [Optional]
Key parameters:
id: User ID (from USER_LOOKUP_ME) for listing bookmarks
tweet_id: Tweet ID to bookmark or unbookmark
max_results: Results per page
pagination_token: Token for next page
Pitfalls:
- Bookmarks require the authenticated user's ID, not username
- Bookmarks are private; only the authenticated user can see their own
- Pagination uses
pagination_token, not next_token
5. Manage Lists
When to use: User wants to view or manage Twitter lists
Tool sequence:
TWITTER_USER_LOOKUP_ME - Get authenticated user ID [Prerequisite]
TWITTER_GET_A_USER_S_OWNED_LISTS - List owned lists [Optional]
TWITTER_GET_A_USER_S_LIST_MEMBERSHIPS - List memberships [Optional]
TWITTER_GET_A_USER_S_PINNED_LISTS - Get pinned lists [Optional]
TWITTER_GET_USER_S_FOLLOWED_LISTS - Get followed lists [Optional]
TWITTER_LIST_LOOKUP_BY_LIST_ID - Get list details [Optional]
Key parameters:
id: User ID for listing owned/member/followed lists
list_id: List ID for specific list lookup
max_results: Results per page (1-100)
Pitfalls:
- List IDs and User IDs are numeric strings
- Lists endpoints require the user's numeric ID, not username
6. Interact with Posts
When to use: User wants to like, unlike, or view liked posts
Tool sequence:
TWITTER_USER_LOOKUP_ME - Get authenticated user ID [Prerequisite]
TWITTER_RETURNS_POST_OBJECTS_LIKED_BY_THE_PROVIDED_USER_ID - Get liked posts [Optional]
TWITTER_UNLIKE_POST - Unlike a post [Optional]
Key parameters:
id: User ID for listing liked posts
tweet_id: Tweet ID to unlike
Pitfalls:
- Like/unlike endpoints require user ID from USER_LOOKUP_ME
- Liked posts pagination may be slow for users with many likes
Common Patterns
Search Query Syntax
Operators:
from:username - Posts by user
to:username - Replies to user
@username - Mentions user
#hashtag - Contains hashtag
"exact phrase" - Exact match
has:media - Contains media
has:links - Contains links
is:retweet / -is:retweet - Include/exclude retweets
is:reply / -is:reply - Include/exclude replies
lang:en - Language filter
Combinators:
- Space for AND
OR for either condition
- prefix for NOT
- Parentheses for grouping
Media Upload Flow
1. Upload media with TWITTER_UPLOAD_MEDIA (images) or TWITTER_UPLOAD_LARGE_MEDIA (video/GIF)
2. Get media_id from response
3. Pass media_id as string in media__media_ids array to TWITTER_CREATION_OF_A_POST
Known Pitfalls
Character Limits:
- Standard posts: 280 weighted characters
- Some Unicode characters count as more than 1
- URLs are shortened and count as fixed length (23 characters)
Rate Limits:
- Vary significantly by access tier (Free, Basic, Pro, Enterprise)
- Free tier: very limited (e.g., 1,500 posts/month)
- Check
x-rate-limit-remaining header in responses
Idempotency:
- Post creation is NOT idempotent; duplicate posts will be created on retry
- Implement deduplication logic for automated posting
Quick Reference
| Task |
Tool Slug |
Key Params |
| Create post |
TWITTER_CREATION_OF_A_POST |
text |
| Delete post |
TWITTER_POST_DELETE_BY_POST_ID |
id |
| Look up post |
TWITTER_POST_LOOKUP_BY_POST_ID |
id |
| Recent search |
TWITTER_RECENT_SEARCH |
query |
| Archive search |
TWITTER_FULL_ARCHIVE_SEARCH |
query |
| Search counts |
TWITTER_RECENT_SEARCH_COUNTS |
query |
| My profile |
TWITTER_USER_LOOKUP_ME |
(none) |
| User by name |
TWITTER_USER_LOOKUP_BY_USERNAME |
username |
| User by ID |
TWITTER_USER_LOOKUP_BY_ID |
id |
| Users by IDs |
TWITTER_USER_LOOKUP_BY_IDS |
ids |
| Upload media |
TWITTER_UPLOAD_MEDIA |
media |
| Upload video |
TWITTER_UPLOAD_LARGE_MEDIA |
media |
| List bookmarks |
TWITTER_BOOKMARKS_BY_USER |
id |
| Add bookmark |
TWITTER_ADD_POST_TO_BOOKMARKS |
tweet_id |
| Remove bookmark |
TWITTER_REMOVE_A_BOOKMARKED_POST |
tweet_id |
| Unlike post |
TWITTER_UNLIKE_POST |
tweet_id |
| Liked posts |
TWITTER_RETURNS_POST_OBJECTS_LIKED_BY_THE_PROVIDED_USER_ID |
id |
| Owned lists |
TWITTER_GET_A_USER_S_OWNED_LISTS |
id |
| List memberships |
TWITTER_GET_A_USER_S_LIST_MEMBERSHIPS |
id |
| Pinned lists |
TWITTER_GET_A_USER_S_PINNED_LISTS |
id |
| Followed lists |
TWITTER_GET_USER_S_FOLLOWED_LISTS |
id |
| List details |
TWITTER_LIST_LOOKUP_BY_LIST_ID |
list_id |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: twitter-automation3description: ALWAYS use this when the request matches Twitter Automation: Automate Twitter/X tasks via Rube MCP (Composio): posts, search, users, bookmarks, lists, media.4---56# Twitter/X Automation via Rube MCP78## Selective Reading Rule910Start with:1112- `references/senior-master-standard.md`13- `references/usage-routing.md`14- `references/quality-checklist.md`1516Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.1718Automate Twitter/X operations through Composio's Twitter toolkit via Rube MCP.1920## Prerequisites2122- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)23- Active Twitter connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `twitter`24- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas2526## Setup2728**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2930311. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds322. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `twitter`333. If connection is not ACTIVE, follow the returned auth link to complete Twitter OAuth344. Confirm connection status shows ACTIVE before running any workflows3536## Core Workflows3738### 1. Create and Manage Posts3940**When to use**: User wants to create, delete, or look up tweets/posts4142**Tool sequence**:431. `TWITTER_USER_LOOKUP_ME` - Get authenticated user info [Prerequisite]442. `TWITTER_UPLOAD_MEDIA` / `TWITTER_UPLOAD_LARGE_MEDIA` - Upload media [Optional]453. `TWITTER_CREATION_OF_A_POST` - Create a new post [Required]464. `TWITTER_POST_LOOKUP_BY_POST_ID` - Look up a specific post [Optional]475. `TWITTER_POST_DELETE_BY_POST_ID` - Delete a post [Optional]4849**Key parameters**:50- `text`: Post text content (max 280 weighted characters)51- `media__media_ids`: Array of media ID strings for attachments52- `reply__in_reply_to_tweet_id`: Tweet ID to reply to53- `quote_tweet_id`: Tweet ID to quote54- `id`: Post ID for lookup/delete5556**Pitfalls**:57- Post text is limited to 280 weighted characters; some characters count as more than one58- Posting is NOT idempotent; retrying on timeout will create duplicate posts59- Media IDs must be numeric strings, not integers60- UPLOAD_LARGE_MEDIA is for videos/GIFs; UPLOAD_MEDIA for images61- Always call USER_LOOKUP_ME first to get the authenticated user's ID6263### 2. Search Posts6465**When to use**: User wants to find tweets matching specific criteria6667**Tool sequence**:681. `TWITTER_RECENT_SEARCH` - Search recent tweets (last 7 days) [Required]692. `TWITTER_FULL_ARCHIVE_SEARCH` - Search full archive (Academic access) [Optional]703. `TWITTER_RECENT_SEARCH_COUNTS` - Get tweet count matching query [Optional]7172**Key parameters**:73- `query`: Search query using Twitter search operators74- `max_results`: Results per page (10-100)75- `next_token`: Pagination token76- `start_time`/`end_time`: ISO 8601 time range77- `tweet__fields`: Comma-separated fields to include78- `expansions`: Related objects to expand7980**Pitfalls**:81- RECENT_SEARCH covers only the last 7 days; use FULL_ARCHIVE_SEARCH for older tweets82- FULL_ARCHIVE_SEARCH requires Academic Research or Enterprise access83- Query operators: `from:username`, `to:username`, `is:retweet`, `has:media`, `-is:retweet`84- Empty results return `meta.result_count: 0` with no `data` field85- Rate limits vary by endpoint and access level; check response headers8687### 3. Look Up Users8889**When to use**: User wants to find or inspect Twitter user profiles9091**Tool sequence**:921. `TWITTER_USER_LOOKUP_ME` - Get authenticated user [Optional]932. `TWITTER_USER_LOOKUP_BY_USERNAME` - Look up by username [Optional]943. `TWITTER_USER_LOOKUP_BY_ID` - Look up by user ID [Optional]954. `TWITTER_USER_LOOKUP_BY_IDS` - Batch look up multiple users [Optional]9697**Key parameters**:98- `username`: Twitter handle without @ prefix99- `id`: Numeric user ID string100- `ids`: Comma-separated user IDs for batch lookup101- `user__fields`: Fields to return (description, public_metrics, etc.)102103**Pitfalls**:104- Usernames are case-insensitive but must not include the @ prefix105- User IDs are numeric strings, not integers106- Suspended or deleted accounts return errors, not empty results107- LOOKUP_BY_IDS accepts max 100 IDs per request108109### 4. Manage Bookmarks110111**When to use**: User wants to save, view, or remove bookmarked tweets112113**Tool sequence**:1141. `TWITTER_USER_LOOKUP_ME` - Get authenticated user ID [Prerequisite]1152. `TWITTER_BOOKMARKS_BY_USER` - List bookmarked posts [Required]1163. `TWITTER_ADD_POST_TO_BOOKMARKS` - Bookmark a post [Optional]1174. `TWITTER_REMOVE_A_BOOKMARKED_POST` - Remove bookmark [Optional]118119**Key parameters**:120- `id`: User ID (from USER_LOOKUP_ME) for listing bookmarks121- `tweet_id`: Tweet ID to bookmark or unbookmark122- `max_results`: Results per page123- `pagination_token`: Token for next page124125**Pitfalls**:126- Bookmarks require the authenticated user's ID, not username127- Bookmarks are private; only the authenticated user can see their own128- Pagination uses `pagination_token`, not `next_token`129130### 5. Manage Lists131132**When to use**: User wants to view or manage Twitter lists133134**Tool sequence**:1351. `TWITTER_USER_LOOKUP_ME` - Get authenticated user ID [Prerequisite]1362. `TWITTER_GET_A_USER_S_OWNED_LISTS` - List owned lists [Optional]1373. `TWITTER_GET_A_USER_S_LIST_MEMBERSHIPS` - List memberships [Optional]1384. `TWITTER_GET_A_USER_S_PINNED_LISTS` - Get pinned lists [Optional]1395. `TWITTER_GET_USER_S_FOLLOWED_LISTS` - Get followed lists [Optional]1406. `TWITTER_LIST_LOOKUP_BY_LIST_ID` - Get list details [Optional]141142**Key parameters**:143- `id`: User ID for listing owned/member/followed lists144- `list_id`: List ID for specific list lookup145- `max_results`: Results per page (1-100)146147**Pitfalls**:148- List IDs and User IDs are numeric strings149- Lists endpoints require the user's numeric ID, not username150151### 6. Interact with Posts152153**When to use**: User wants to like, unlike, or view liked posts154155**Tool sequence**:1561. `TWITTER_USER_LOOKUP_ME` - Get authenticated user ID [Prerequisite]1572. `TWITTER_RETURNS_POST_OBJECTS_LIKED_BY_THE_PROVIDED_USER_ID` - Get liked posts [Optional]1583. `TWITTER_UNLIKE_POST` - Unlike a post [Optional]159160**Key parameters**:161- `id`: User ID for listing liked posts162- `tweet_id`: Tweet ID to unlike163164**Pitfalls**:165- Like/unlike endpoints require user ID from USER_LOOKUP_ME166- Liked posts pagination may be slow for users with many likes167168## Common Patterns169170### Search Query Syntax171172**Operators**:173- `from:username` - Posts by user174- `to:username` - Replies to user175- `@username` - Mentions user176- `#hashtag` - Contains hashtag177- `"exact phrase"` - Exact match178- `has:media` - Contains media179- `has:links` - Contains links180- `is:retweet` / `-is:retweet` - Include/exclude retweets181- `is:reply` / `-is:reply` - Include/exclude replies182- `lang:en` - Language filter183184**Combinators**:185- Space for AND186- `OR` for either condition187- `-` prefix for NOT188- Parentheses for grouping189190### Media Upload Flow191192```1931. Upload media with TWITTER_UPLOAD_MEDIA (images) or TWITTER_UPLOAD_LARGE_MEDIA (video/GIF)1942. Get media_id from response1953. Pass media_id as string in media__media_ids array to TWITTER_CREATION_OF_A_POST196```197198## Known Pitfalls199200**Character Limits**:201- Standard posts: 280 weighted characters202- Some Unicode characters count as more than 1203- URLs are shortened and count as fixed length (23 characters)204205**Rate Limits**:206- Vary significantly by access tier (Free, Basic, Pro, Enterprise)207- Free tier: very limited (e.g., 1,500 posts/month)208- Check `x-rate-limit-remaining` header in responses209210**Idempotency**:211- Post creation is NOT idempotent; duplicate posts will be created on retry212- Implement deduplication logic for automated posting213214## Quick Reference215216| Task | Tool Slug | Key Params |217|------|-----------|------------|218| Create post | TWITTER_CREATION_OF_A_POST | text |219| Delete post | TWITTER_POST_DELETE_BY_POST_ID | id |220| Look up post | TWITTER_POST_LOOKUP_BY_POST_ID | id |221| Recent search | TWITTER_RECENT_SEARCH | query |222| Archive search | TWITTER_FULL_ARCHIVE_SEARCH | query |223| Search counts | TWITTER_RECENT_SEARCH_COUNTS | query |224| My profile | TWITTER_USER_LOOKUP_ME | (none) |225| User by name | TWITTER_USER_LOOKUP_BY_USERNAME | username |226| User by ID | TWITTER_USER_LOOKUP_BY_ID | id |227| Users by IDs | TWITTER_USER_LOOKUP_BY_IDS | ids |228| Upload media | TWITTER_UPLOAD_MEDIA | media |229| Upload video | TWITTER_UPLOAD_LARGE_MEDIA | media |230| List bookmarks | TWITTER_BOOKMARKS_BY_USER | id |231| Add bookmark | TWITTER_ADD_POST_TO_BOOKMARKS | tweet_id |232| Remove bookmark | TWITTER_REMOVE_A_BOOKMARKED_POST | tweet_id |233| Unlike post | TWITTER_UNLIKE_POST | tweet_id |234| Liked posts | TWITTER_RETURNS_POST_OBJECTS_LIKED_BY_THE_PROVIDED_USER_ID | id |235| Owned lists | TWITTER_GET_A_USER_S_OWNED_LISTS | id |236| List memberships | TWITTER_GET_A_USER_S_LIST_MEMBERSHIPS | id |237| Pinned lists | TWITTER_GET_A_USER_S_PINNED_LISTS | id |238| Followed lists | TWITTER_GET_USER_S_FOLLOWED_LISTS | id |239| List details | TWITTER_LIST_LOOKUP_BY_LIST_ID | list_id |240241## When to Use242This skill is applicable to execute the workflow or actions described in the overview.243244## Limitations245- Use this skill only when the task clearly matches the scope described above.246- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.247- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.