x-tools

v0.3.1
io.github.craft-agent/x-tools Checked 8 hours ago Published 1 day ago

Unofficial 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…

ParameterTypeDescription
accountstringThe 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…

ParameterTypeDescription
method *stringWhat 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…
accountstringThe reading account's label, for a post read through it; left out, the only one.
cursorstringMethods `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.
feedstringMethod `search`: `latest` (the default), `top` or `media`.
handlestringMethods `mentions` and `timeline`, required: the account whose mentions or posts to read, with or without `@`.
limitintegerMethods `search`, `quotes`, `mentions` and `timeline`. Most items in the page, 20 by default; a page may hold fewer with more to come.
poststringMethods `quotes`, `conversation` and `thread`, required: the post to read the quotes, the conversation or the thread of, a post id or a post URL.
postsarrayMethod `view`, required: the posts to read, each a post id or a post URL, at most 50; a post named twice is read once.
querystringMethod `search`, required: the search, in X's search syntax and passed as written, at most 500 characters.
sincestringMethod `mentions`: a day, `YYYY-MM-DD`, from which on posts are read; left out, there is no lower bound.
sortstringMethod `conversation`: `top` (the default) puts the most liked replies first, `latest` the newest.
sourcestringWhich 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`…
tabstringMethod `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…

ParameterTypeDescription
method *stringWhat 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…
accountstringThe reading account's label, for a read through it; left out, the only one.
cursorstringMethods `search`, `followers`, `following` and `reposters`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments.
handlestringMethods `view`, `followers` and `following`, required: the account whose profile, followers or following to read, with or without `@`.
limitintegerMethods `search`, `followers`, `following` and `reposters`. Most items in the page, 20 by default; a page may hold fewer with more to come.
poststringMethod `reposters`, required: the post whose reposters to read, a post id or a post URL.
querystringMethod `search`, required: the words to search users for, passed as written, at most 500 characters.
sourcestringWhich 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…

ParameterTypeDescription
method *stringWhat to read: `posts` reads the latest posts of a list; `members` reads the accounts in a list.
accountstringThe reading account's label, for a read through it; left out, the only one.
cursorstringBoth methods. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments.
limitintegerBoth methods. Most items in the page, 20 by default; a page may hold fewer with more to come.
liststringBoth methods, required: the list, its id or its URL (x.com/i/lists/<id>).
sourcestringWhich 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…

ParameterTypeDescription
method *stringWhat to read: `view` reads a community's name, description and rules; `posts` reads its posts; `members` reads the accounts in it.
accountstringThe reading account's label, for a read through it; left out, the only one.
communitystringAll methods, required: the community, its id or its URL (x.com/i/communities/<id>).
cursorstringMethods `posts` and `members`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments.
limitintegerMethods `posts` and `members`. Most items in the page, 20 by default; a page may hold fewer with more to come.
orderstringMethod `posts`: `relevance` (the default) or `recency`, the latest first.
sourcestringWhich 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…

ParameterTypeDescription
method *stringWhat to read: `explore` reads the trends of X's Explore.
accountstringThe reading account's label, for a read through it; left out, the only one.
categorystringMethod `explore`: `trending` (the default), `news`, `sports` or `entertainment`; only `trending` may be read from FxTwitter.
cursorstringMethod `explore`. The `cursor` a previous page returned, to continue it: on the source that gave it, with the same arguments.
limitintegerMethod `explore`. Most items in the page, 20 by default; a page may hold fewer with more to come.
sourcestringWhich 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…

ParameterTypeDescription
post *stringThe post to save the media of: a post id or a post URL.
accountstringThe reading account's label, for a post read through it; left out, the only one.
quotedbooleanAlso save the media of the post it quotes. Default false.
sourcestringWhich 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`…