Twitter

Learn how to use Twitter with Composio

Overview

SLUG: TWITTER

Description

Twitter, Inc. was an American social media company based in San Francisco, California, which operated and was named for named for its flagship social media network prior to its rebrand as X.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
full
stringDefaults to https://api.x.comRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to dm.write dm.read mute.read mute.write space.read tweet.write tweet.read tweet.moderate.write users.read follows.read follows.write like.read like.write list.read list.write block.read block.write bookmark.read bookmark.write offline.access
bearer_token
string

Connecting to Twitter

Create an auth config

Use the dashboard to create an auth config for the Twitter toolkit. This allows you to connect multiple Twitter accounts to Composio for agents to use.

1

Select App

Navigate to the Twitter toolkit page and click “Setup Integration”.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Integration”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4twitter_auth_config_id = "ac_YOUR_TWITTER_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate Twitter: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, twitter_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Twitter toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["TWITTER"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create a list

Description

Creates a new, empty list on x (formerly twitter), for which the provided name must be unique for the authenticated user; accounts are added separately.

Action Parameters

description
string
name
stringRequired
private
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create a post

Description

Creates a tweet on twitter; `text` is required unless `card uri`, `media media ids`, `poll options`, or `quote tweet id` is provided.

Action Parameters

card_uri
string
direct_message_deep_link
string
for_super_followers_only
boolean
geo__place__id
string
media__media__ids
array
media__tagged__user__ids
array
nullcast
boolean
poll__duration__minutes
integer
poll__options
array
poll__reply__settings
string
quote_tweet_id
string
reply__exclude__reply__user__ids
array
reply__in__reply__to__tweet__id
string
reply_settings
string
text
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete list

Description

Permanently deletes a specified twitter list using its id, which must be owned by the authenticated user; this action is irreversible and the list must already exist.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Follow a user

Description

Allows an authenticated user (path `id`) to follow another user (`target user id`), which results in a pending request if the target user's tweets are protected.

Action Parameters

id
stringRequired
target_user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get users blocked by user ID

Description

Retrieves user objects for accounts blocked by the specified user id; this is a read-only view of a user's block list.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete tweet

Description

Irreversibly deletes a specific tweet by its id; the tweet may persist in third-party caches after deletion.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unfollow user

Description

Allows the authenticated `source user id` to unfollow an existing twitter user (`target user id`), which removes the follow relationship.

Action Parameters

source_user_id
stringRequired
target_user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up user by username

Description

Fetches public profile information for a valid and existing twitter user by their username, optionally expanding related data like pinned tweets; results may be limited for protected profiles not followed by the authenticated user.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array
username
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get authenticated user

Description

Returns profile information for the currently authenticated x user, customizable via request fields.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Add a list member

Description

Adds a user to a specified twitter list; the list must be owned by the authenticated user.

Action Parameters

id
stringRequired
user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Add post to bookmarks

Description

Adds a specified, existing, and accessible tweet to a user's bookmarks, with success indicated by the 'bookmarked' field in the response.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get bookmarks by user

Description

Retrieves tweets bookmarked by the authenticated user, where the provided user id must match the authenticated user's id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 2
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create group DM conversation

Description

Creates a new group direct message (dm) conversation on twitter with specified participant ids and an initial message, which can include text and media attachments.

Action Parameters

conversation_type
stringRequired
message
objectRequired
participant_ids
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create compliance job

Description

Creates a new compliance job to check the status of tweet or user ids; upload ids as a plain text file (one id per line) to the `upload url` received in the response.

Action Parameters

name
string
resumable
boolean
type
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete direct message

Description

Permanently deletes a specific twitter direct message (dm) event using its `event id` if the authenticated user sent it; this action is irreversible and does not delete entire conversations.

Action Parameters

event_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch list members by id

Description

Fetches members of a specific twitter list, identified by its unique id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch space ticket buyers list

Description

Retrieves a list of users who purchased tickets for a specific, valid, and ticketed twitter space.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get followers by user id

Description

Retrieves a list of users who follow a specified public twitter user id.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get following by user ID

Description

Retrieves users followed by a specific twitter user, allowing pagination and customization of returned user and tweet data fields via expansions.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Follow a list

Description

Allows the authenticated user (`id`) to follow a specific twitter list (`list id`) they are permitted to access, subscribing them to the list's timeline; this does not automatically follow individual list members.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get full archive search counts

Description

Returns a count of tweets from the full archive that match a specified query, aggregated by day, hour, or minute; `start time` must be before `end time` if both are provided, and `since id`/`until id` cannot be used with `start time`/`end time`.

Action Parameters

end_time
string
granularity
stringDefaults to hour
next_token
string
pagination_token
string
query
stringRequired
search__count__fields
array
since_id
string
start_time
string
until_id
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get a user’s list memberships

Description

Retrieves all twitter lists a specified user is a member of, including public lists and private lists the authenticated user is authorized to view.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get a user’s owned lists

Description

Call this action to retrieve lists created (owned) by a specific twitter user, not lists they follow or are subscribed to.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get a user’s pinned lists

Description

Retrieves the lists a specific, existing twitter user has pinned to their profile to highlight them.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get DM events by ID

Description

Fetches a specific direct message (dm) event by its unique id, allowing optional expansion of related data like users or tweets; ensure the `event id` refers to an existing dm event accessible to the authenticated user.

Action Parameters

dm__event__fields
array
event_id
stringRequired
expansions
array
media__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get DM events for a DM conversation

Description

Fetches direct message (dm) events for a one-on-one conversation with a specified participant id, ordered chronologically newest to oldest; does not support group dms.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
participant_id
stringRequired
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get list followers

Description

Fetches a list of users who follow a specific twitter list, identified by its id; ensure the authenticated user has access if the list is private.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get muted users

Description

Returns user objects muted by the x user identified by the `id` path parameter.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get post retweeters

Description

Retrieves users who publicly retweeted a specified public post id, excluding quote tweets and retweets from private accounts.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get recent direct message events

Description

Returns recent direct message events for the authenticated user, such as new messages or changes in conversation participants.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get user’s followed lists

Description

Returns metadata (not tweets) for lists a specific twitter user follows, optionally including expanded owner details.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Set reply visibility

Description

Hides or unhides an existing reply tweet.

Action Parameters

hidden
booleanRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Lookup list by ID

Description

Returns metadata for a specific twitter list, identified by its id; does not return list members but can expand the owner's user object via the `expansions` parameter.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List posts timeline by list ID

Description

Fetches the most recent tweets posted by members of a specified twitter list.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List post likers

Description

Retrieves users who have liked the post (tweet) identified by the provided id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Mute user by ID

Description

Mutes a target user on behalf of an authenticated user, preventing the target's tweets and retweets from appearing in the authenticated user's home timeline without notifying the target.

Action Parameters

id
stringRequired
target_user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Pin a list

Description

Pins a specified list to the authenticated user's profile, provided the list exists, the user has access rights, and the pin limit (typically 5 lists) is not exceeded.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get tweets label stream

Description

Establishes a persistent stream of real-time events for when tweet labels are applied or removed, offering insights into content categorization.

Action Parameters

backfill_minutes
integer
end_time
string
start_time
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up post by id

Description

Fetches comprehensive details for a single tweet by its unique id, provided the tweet exists and is accessible.

Action Parameters

expansions
array
id
stringRequired
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get tweets by IDs

Description

Retrieves detailed information for one or more posts (tweets) identified by their unique ids, allowing selection of specific fields and expansions.

Action Parameters

expansions
array
ids
arrayRequired
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch tweet usage data

Description

Fetches tweet usage statistics for a project (e.g., consumption, caps, daily breakdowns for project & client apps) to monitor api limits; data can be retrieved for 1 to 90 days.

Action Parameters

days
integerDefaults to 7
usage__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch recent tweet counts

Description

Retrieves the count of tweets matching a specified search query within the last 7 days, aggregated by 'minute', 'hour', or 'day'.

Action Parameters

end_time
string
granularity
stringDefaults to hour
next_token
string
pagination_token
string
query
stringRequired
search__count__fields
array
since_id
string
start_time
string
until_id
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove a bookmarked post

Description

Removes a tweet, specified by `tweet id`, from the authenticated user's bookmarks; the tweet must have been previously bookmarked by the user for the action to have an effect.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Remove a list member

Description

Removes a user from a twitter list; the response `is member` field will be `false` if removal was successful or the user was not a member, and the updated list of members is not returned.

Action Parameters

id
stringRequired
user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve compliance jobs

Description

Returns a list of recent compliance jobs, filtered by type (tweets or users) and optionally by status.

Action Parameters

compliance__job__fields
array
status
string
type
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve compliance job by id

Description

Retrieves status, download/upload urls, and other details for an existing twitter compliance job specified by its unique id.

Action Parameters

compliance__job__fields
array
id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve DM conversation events

Description

Retrieves direct message (dm) events for a specific conversation id on twitter, useful for analyzing messages and participant activities.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve posts from a space

Description

Retrieves tweets from a specified twitter space id; the space must be accessible and results are batched (not streamed).

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve posts that quote a post

Description

Retrieves tweets that quote a specified tweet, requiring a valid tweet id.

Action Parameters

exclude
array
expansions
array
id
stringRequired
max_results
integerDefaults to 10
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve retweets of a post

Description

Retrieves tweets that retweeted a specified public or authenticated-user-accessible tweet id, optionally customizing the response with fields and expansions.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve liked tweets by user ID

Description

Retrieves tweets liked by a specified twitter user, provided their liked tweets are public or accessible.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Fetch OpenAPI specification

Description

Fetches the openapi specification (json) for twitter's api v2, used to programmatically understand the api's structure for developing client libraries or tools.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retweet post

Description

Retweets a tweet (`tweet id`) for a given user (`id`), provided the tweet is public (or user follows if protected), not already retweeted by the user, and its author has not blocked the user.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Search for spaces

Description

Searches for twitter spaces by a textual query, optionally filtering by state (live, scheduled, all) to discover audio conversations.

Action Parameters

expansions
array
max_results
integerDefaults to 100
query
stringRequired
space__fields
array
state
stringDefaults to all
topic__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Send a new message to a DM conversation

Description

Sends a message, with optional text and/or media attachments (using pre-uploaded `media id`s), to a specified twitter direct message conversation.

Action Parameters

attachments
array
dm_conversation_id
stringRequired
text
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Send a new message to a user

Description

Sends a new direct message with text and/or media (media id for attachments must be pre-uploaded) to a specified twitter user; this creates a new dm and does not modify existing messages.

Action Parameters

attachments
array
participant_id
stringRequired
text
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up space by ID

Description

Retrieves details for a twitter space by its id, allowing for customization and expansion of related data, provided the space id is valid and accessible.

Action Parameters

expansions
array
id
stringRequired
space__fields
array
topic__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get spaces by creator IDs

Description

Retrieves twitter spaces created by a list of specified user ids, with options to customize returned data fields.

Action Parameters

expansions
array
space__fields
array
topic__fields
array
user__fields
array
user_ids
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get space information by IDs

Description

Fetches detailed information for one or more twitter spaces (live, scheduled, or ended) by their unique ids; at least one space id must be provided.

Action Parameters

expansions
array
ids
arrayRequired
space__fields
array
topic__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unfollow a list

Description

Enables a user (via `id`) to unfollow a specific twitter list (via `list id`), which removes its tweets from their timeline and stops related notifications; the action reports `following: false` on success, even if the user was not initially following the list.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unlike post

Description

Allows an authenticated user (`id`) to remove their like from a specific post (`tweet id`); the action is idempotent and completes successfully even if the post was not liked.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unmute a user by user ID

Description

Unmutes a `target user id` for the `source user id` (authenticated user), allowing the source user to see tweets and notifications from the target user again.

Action Parameters

source_user_id
stringRequired
target_user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unpin a list

Description

Unpins a list (specified by list id) from a user's profile (specified by id), provided the list is currently pinned by that user.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Unretweet post

Description

Removes a user's retweet of a specified post, if the user had previously retweeted it.

Action Parameters

id
stringRequired
source_tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update list attributes

Description

Updates an existing twitter list's name, description, or privacy status, requiring the list id and at least one mutable property.

Action Parameters

description
string
id
stringRequired
name
string
private
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get user reverse chronological timeline

Description

Retrieves the most recent tweets and retweets posted by a specified twitter user in reverse chronological order, excluding replies/mentions unless part of self-threads/retweets; useful for showing latest activity without algorithmic sorting.

Action Parameters

end_time
string
exclude
array
expansions
array
id
stringRequired
max_results
integer
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
since_id
string
start_time
string
tweet__fields
array
until_id
string
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Like a tweet

Description

Allows the authenticated user (`id`) to like a specific, accessible tweet (`tweet id`), provided neither user has blocked the other and the authenticated user is not restricted from liking.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up user by ID

Description

Retrieves detailed public information for a twitter user by their id, optionally expanding related data (e.g., pinned tweets) and specifying particular user or tweet fields to return.

Action Parameters

expansions
array
id
stringRequired
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up users by IDs

Description

Retrieves detailed information for specified x (formerly twitter) user ids, optionally customizing returned fields and expanding related entities.

Action Parameters

expansions
array
ids
arrayRequired
tweet__fields
array
user__fields
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Look up users by username

Description

Retrieves detailed information for 1 to 100 twitter users by their usernames (each 1-15 alphanumeric characters/underscores), allowing customizable user/tweet fields and expansion of related data like pinned tweets.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array
usernames
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired