Driftglass
← All integrations

X

Social media

Let agents use X as the connected account: post and reply, write threads, search recent posts, read timelines and mentions, like, repost, follow and send direct messages. X charges per API call, so these actions are billed from credits at X's price plus 20%.

Actions

22 actions. Call one with POST /v1/tools/{name}/execute or through /mcp.

Get connected account

read$0.012/callx.get_memcp: x_get_me

Get the connected X account with follower counts. $0.012 per call.

No arguments.

curl -X POST https://driftglass.io/v1/tools/x.get_me/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

Get user

read$0.012/callx.get_usermcp: x_get_user

Look up an X user by username. $0.012 per call.

ArgumentTypeDescription
usernamerequiredstringUsername without @.
curl -X POST https://driftglass.io/v1/tools/x.get_user/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"username":"<username>"}}'

Get post

read$0.006/callx.get_postmcp: x_get_post

Get one post by id with its metrics. $0.006 per call.

ArgumentTypeDescription
post_idrequiredstringPost id (the number in its URL).
curl -X POST https://driftglass.io/v1/tools/x.get_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Search recent posts

read$0.006 per post requestedx.search_recent_postsmcp: x_search_recent_posts

Search posts from the last 7 days with X search operators (from:, to:, -is:retweet, lang:, …). Billed $0.006 per post requested (max_results).

ArgumentTypeDescription
queryrequiredstringSearch query.
max_resultsintegerPosts to return (10-100). Default: 10
sort_orderstring
recency | relevancy
Order. Default: recency
next_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.search_recent_posts/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"query":"<query>"}}'

Get a user's posts

read$0.006 per post requestedx.get_user_postsmcp: x_get_user_posts

Get a user's latest posts (the connected account's by default). Billed $0.006 per post requested (max_results).

ArgumentTypeDescription
user_idstringUser id; the connected account when omitted (use get_user to find ids).
max_resultsintegerPosts to return (5-100). Default: 10
exclude_repliesbooleanLeave out replies. Default: false
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.get_user_posts/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

Get home timeline

read$0.006 per post requestedx.get_home_timelinemcp: x_get_home_timeline

Get the connected account's home timeline, newest first. Billed $0.006 per post requested (max_results).

ArgumentTypeDescription
max_resultsintegerPosts to return (1-100). Default: 10
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.get_home_timeline/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

Get mentions

read$0.006 per post requestedx.get_mentionsmcp: x_get_mentions

Get recent posts that mention the connected account. Billed $0.006 per post requested (max_results).

ArgumentTypeDescription
max_resultsintegerPosts to return (5-100). Default: 10
since_idstringOnly mentions newer than this post id.
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.get_mentions/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

List followers

read$0.012 per user requestedx.list_followersmcp: x_list_followers

List an account's followers (the connected account's by default). Billed $0.012 per user requested.

ArgumentTypeDescription
user_idstringUser id; the connected account when omitted.
max_resultsintegerUsers to return (1-1000). Default: 20
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.list_followers/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

List following

read$0.012 per user requestedx.list_followingmcp: x_list_following

List the accounts an account follows (the connected account's by default). Billed $0.012 per user requested.

ArgumentTypeDescription
user_idstringUser id; the connected account when omitted.
max_resultsintegerUsers to return (1-1000). Default: 20
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.list_following/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

List bookmarks

read$0.006 per post requestedx.list_bookmarksmcp: x_list_bookmarks

List the connected account's bookmarked posts. Billed $0.006 per post requested (max_results).

ArgumentTypeDescription
max_resultsintegerPosts to return (1-100). Default: 10
pagination_tokenstringnext_token from the previous page.
curl -X POST https://driftglass.io/v1/tools/x.list_bookmarks/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{}}'

Post

write$0.018 per post, $0.240 when it contains a linkx.create_postmcp: x_create_post

Publish a post, reply or quote, optionally with media (from upload_media) or a poll. $0.018 per post; X charges much more for posts containing a link ($0.240).

ArgumentTypeDescription
textrequiredstringPost text (280 characters for most accounts).
reply_to_post_idstringReply to this post.
quote_post_idstringQuote this post.
media_idsstring[]Media ids from upload_media (up to 4).
poll_optionsstring[]2-4 poll options.
poll_duration_minutesintegerPoll length in minutes. Default: 1440
curl -X POST https://driftglass.io/v1/tools/x.create_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"text":"<text>"}}'

Post a thread

write$0.018 per post in the thread, $0.240 for posts with a linkx.create_threadmcp: x_create_thread

Publish a thread: each text becomes a post replying to the previous one. Billed per post ($0.018, or $0.240 for posts with a link).

ArgumentTypeDescription
postsrequiredstring[]Texts of the posts, in order (2-25).
curl -X POST https://driftglass.io/v1/tools/x.create_thread/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"posts":[]}}'

Delete post

write$0.012/callx.delete_postmcp: x_delete_post

Delete one of the connected account's posts. $0.012 per call.

ArgumentTypeDescription
post_idrequiredstringPost id.
curl -X POST https://driftglass.io/v1/tools/x.delete_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Upload image

write$0.006/callx.upload_mediamcp: x_upload_media

Upload an image (JPEG, PNG, WebP or GIF up to 5 MB) from a public URL; pass the returned media_id to create_post. $0.006 per call.

ArgumentTypeDescription
image_urlrequiredstringPublic image URL.
alt_textstringAccessibility text.
curl -X POST https://driftglass.io/v1/tools/x.upload_media/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"image_url":"<image_url>"}}'

Like post

write$0.018/callx.like_postmcp: x_like_post

Like a post. $0.018 per call.

ArgumentTypeDescription
post_idrequiredstringPost id.
curl -X POST https://driftglass.io/v1/tools/x.like_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Unlike post

write$0.012/callx.unlike_postmcp: x_unlike_post

Remove a like. $0.012 per call.

ArgumentTypeDescription
post_idrequiredstringPost id.
curl -X POST https://driftglass.io/v1/tools/x.unlike_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Repost

write$0.018/callx.repostmcp: x_repost

Repost a post. $0.018 per call.

ArgumentTypeDescription
post_idrequiredstringPost id.
curl -X POST https://driftglass.io/v1/tools/x.repost/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Undo repost

write$0.012/callx.undo_repostmcp: x_undo_repost

Undo a repost. $0.012 per call.

ArgumentTypeDescription
post_idrequiredstringId of the original post.
curl -X POST https://driftglass.io/v1/tools/x.undo_repost/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Follow user

write$0.018/callx.follow_usermcp: x_follow_user

Follow a user by id (get_user finds ids). $0.018 per call.

ArgumentTypeDescription
user_idrequiredstringUser id to follow.
curl -X POST https://driftglass.io/v1/tools/x.follow_user/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"user_id":"<user_id>"}}'

Unfollow user

write$0.012/callx.unfollow_usermcp: x_unfollow_user

Unfollow a user by id. $0.012 per call.

ArgumentTypeDescription
user_idrequiredstringUser id to unfollow.
curl -X POST https://driftglass.io/v1/tools/x.unfollow_user/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"user_id":"<user_id>"}}'

Bookmark post

write$0.006/callx.bookmark_postmcp: x_bookmark_post

Bookmark a post. $0.006 per call.

ArgumentTypeDescription
post_idrequiredstringPost id.
curl -X POST https://driftglass.io/v1/tools/x.bookmark_post/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"post_id":"<post_id>"}}'

Send direct message

write$0.018/callx.send_dmmcp: x_send_dm

Send a direct message to a user by id. $0.018 per call.

ArgumentTypeDescription
user_idrequiredstringRecipient user id.
textrequiredstringMessage text.
curl -X POST https://driftglass.io/v1/tools/x.send_dm/execute \
  -H "Authorization: Bearer $DRIFTGLASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entity_id":"default","arguments":{"user_id":"<user_id>","text":"<text>"}}'