x-tools
v0.3.1Unofficial X tools for coding agents: read posts and profiles, save post media, never write to X.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
x_account_read Read X reading accounts
Report the engine's state and each reading account's local state, from files alone: it never contacts X or FxTwitter, starts no program and costs no read. `fxtwitter` says whether FxTwitter is on (off under the `account_only` setting), its requests used in the last day against its daily cap and a running cooldown. Per account: where its cookies come from and whether they are usable (never the cookies), whether X refused the current session and what it said, a running X rate limit, the reads used against the hourly and daily caps, and one next step (`action`, `hint`, `recovery_command`). `ready…
| Parameter | Type | Description |
|---|---|---|
account | string | The reading account's label. Left out, every account is reported, sorted by label. |
x_post_read Read X posts
Read X posts; `method` picks the read. `view`: posts by URL or id (`posts`, up to 50 per call, a post named twice read once), each with a status (`ok`, `not_found`, `protected`, `unavailable`, or `not_read` when no source could be asked; ask it again after its `retry_at` when it has one) and the source that answered; `handle_mismatch` is true when a URL named another author than the post's. `search`: `query` in X's search syntax, passed as written (at most 500 characters), in `feed` `latest` (the default), `top` or `media`. `quotes`: the posts quoting `post` (an id or URL), newest first. `ment…
| Parameter | Type | Description |
|---|---|---|
method * | string | What to read: `view` reads posts by URL or id; `search` searches posts; `quotes` reads the posts quoting a post; `mentions` reads the posts mentioning an account; `conversation` reads a post with the… |
account | string | The reading account's label, for a post read through it; left out, the only one. |
cursor | string | Methods `search`, `quotes`, `mentions`, `conversation` and `timeline`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments. |
feed | string | Method `search`: `latest` (the default), `top` or `media`. |
handle | string | Methods `mentions` and `timeline`, required: the account whose mentions or posts to read, with or without `@`. |
limit | integer | Methods `search`, `quotes`, `mentions` and `timeline`. Most items in the page, 20 by default; a page may hold fewer with more to come. |
post | string | Methods `quotes`, `conversation` and `thread`, required: the post to read the quotes, the conversation or the thread of, a post id or a post URL. |
posts | array | Method `view`, required: the posts to read, each a post id or a post URL, at most 50; a post named twice is read once. |
query | string | Method `search`, required: the search, in X's search syntax and passed as written, at most 500 characters. |
since | string | Method `mentions`: a day, `YYYY-MM-DD`, from which on posts are read; left out, there is no lower bound. |
sort | string | Method `conversation`: `top` (the default) puts the most liked replies first, `latest` the newest. |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |
tab | string | Method `timeline`: `posts` (the default) are the account's own posts, `replies` add its replies, `media` are its posts with media. |
x_user_read Read X users
Read X users; `method` picks the read. `view`: the profile of the account `handle` (name, bio, links, location, `joined`, `counts`, `protected`, `verified` with its kind in `verified_type`), with a status (`ok`, `not_found`, `protected`, `unavailable`) and `reason`; `user` is null unless the status is `ok`. `search`: users matching the words in `query` (at most 500 characters). `followers` and `following`: the accounts that follow `handle` or that it follows, with a status and `reason` as `view`. `reposters`: the accounts that reposted `post` (an id or a URL). These four return a page in `resu…
| Parameter | Type | Description |
|---|---|---|
method * | string | What to read: `view` reads one profile by handle; `search` searches users by words; `followers` reads the accounts that follow an account; `following` reads the accounts an account follows; `reposters… |
account | string | The reading account's label, for a read through it; left out, the only one. |
cursor | string | Methods `search`, `followers`, `following` and `reposters`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments. |
handle | string | Methods `view`, `followers` and `following`, required: the account whose profile, followers or following to read, with or without `@`. |
limit | integer | Methods `search`, `followers`, `following` and `reposters`. Most items in the page, 20 by default; a page may hold fewer with more to come. |
post | string | Method `reposters`, required: the post whose reposters to read, a post id or a post URL. |
query | string | Method `search`, required: the words to search users for, passed as written, at most 500 characters. |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |
x_list_read Read X lists
Read an X list; `method` picks the read. `list` is the list's id or its URL (x.com/i/lists/<id>). `posts`: the latest posts of the list, in `posts`. `members`: the accounts in the list, in `users`. Both return a page and a `cursor`: `limit` is an upper bound (20 by default, 50 at most) and a page may hold fewer with more to come, so follow `cursor`, which continues only the same read and list. Lists are read only through the reading account: FxTwitter offers no list read, so `source` `fxtwitter` is refused and `auto` reads the account; the `account_only` setting changes nothing for lists, sinc…
| Parameter | Type | Description |
|---|---|---|
method * | string | What to read: `posts` reads the latest posts of a list; `members` reads the accounts in a list. |
account | string | The reading account's label, for a read through it; left out, the only one. |
cursor | string | Both methods. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments. |
limit | integer | Both methods. Most items in the page, 20 by default; a page may hold fewer with more to come. |
list | string | Both methods, required: the list, its id or its URL (x.com/i/lists/<id>). |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |
x_community_read Read X communities
Read an X community; `method` picks the read. `community` is the community's id or its URL (x.com/i/communities/<id>). `view`: the community's name, description, rules, member count, join policy, topic and creation time, in `community`; its `is_member` is the reading account's own membership. `posts`: the community's posts, in `posts`, in `order` `relevance` (the default) or `recency`. `members`: the accounts in the community, in `users`. `posts` and `members` return a page and a `cursor`: `limit` is an upper bound (20 by default, 50 at most) and a page may hold fewer with more to come, so fol…
| Parameter | Type | Description |
|---|---|---|
method * | string | What to read: `view` reads a community's name, description and rules; `posts` reads its posts; `members` reads the accounts in it. |
account | string | The reading account's label, for a read through it; left out, the only one. |
community | string | All methods, required: the community, its id or its URL (x.com/i/communities/<id>). |
cursor | string | Methods `posts` and `members`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments. |
limit | integer | Methods `posts` and `members`. Most items in the page, 20 by default; a page may hold fewer with more to come. |
order | string | Method `posts`: `relevance` (the default) or `recency`, the latest first. |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |
x_trend_read Read X trends
Read the trends of X's Explore; `method` `explore` reads a page of them, in `trends`, in `category` `trending` (the default), `news`, `sports` or `entertainment`. Each trend has its `name`, `rank`, `context` (such as its domain), the topics X groups under it (`grouped`), and `query`, what to pass to `x_post_read` `search` as `query` to read its posts. A story, X's written summary of a topic, has a headline for a name, `story` true, a `query` of null and its page as `url`; `story` is null from FxTwitter, which does not tell. There is no post count: neither source reports one as a value. `trendi…
| Parameter | Type | Description |
|---|---|---|
method * | string | What to read: `explore` reads the trends of X's Explore. |
account | string | The reading account's label, for a read through it; left out, the only one. |
category | string | Method `explore`: `trending` (the default), `news`, `sports` or `entertainment`; only `trending` may be read from FxTwitter. |
cursor | string | Method `explore`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments. |
limit | integer | Method `explore`. Most items in the page, 20 by default; a page may hold fewer with more to come. |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |
x_media_download Save X media
Save the photos, videos and GIFs of one X post to this machine: `post` is a post id or URL, and with `quoted` the media of the post it quotes are saved too. Files go to `<download_dir>/<post id>/` (the `download_dir` setting, never the state or install directory) as `<post id>-<n>.<ext>`, `n` counting the post's media in order, a quoted post's named with its own id; a photo is saved at its original size, a video or GIF as MP4. The post is read once as `x_post_read` `view` reads it: `source` `auto` (the default) reads FxTwitter, a third party that reads X itself, first and the reading account o…
| Parameter | Type | Description |
|---|---|---|
post * | string | The post to save the media of: a post id or a post URL. |
account | string | The reading account's label, for a post read through it; left out, the only one. |
quoted | boolean | Also save the media of the post it quotes. Default false. |
source | string | Which source reads. `auto` (the default) reads FxTwitter first and the reading account only when FxTwitter cannot answer; `fxtwitter` reads only FxTwitter, a third party that reads X itself; `account`… |