X
Connect your own X developer app so agents can post, read, search and message on X, with approvals for everything that goes out under your name.
X is a native Jian integration. You bring your own X developer app, connect one or more X accounts, and every agent can post, reply, write threads, read mentions, search, follow, handle Lists and send direct messages, within the limits of what X's API allows.
Try asking
Draft a three-post thread announcing Harbor Studio's spring menu. Show it to me before posting.
What are the latest mentions of @harborstudio? Summarize anything that needs an answer.
Search X for posts about "harbor cold brew" from the last day, small page, and tell me the mood.
Connect
X needs an address it can send you back to. The desktop app's own gateway gets one from the app. A server gateway needs JIAN_PUBLIC_URL. Without either, X is not offered under Plugins.
- In X's Developer Console, create an app (or open yours) and turn on OAuth 2.0 for it as a Web App, with Read and write and Direct message permissions.
- In Jian, open Plugins, choose Connectors and open X.
- Under Developer app, copy the Callback URL with Copy and paste it into the X app's settings exactly as written.
- Copy the app's OAuth 2.0 Client ID and Client secret into the form and press Save. The secret goes to the gateway's vault and is never shown again, so you type it anew if you change the app (Change).
- Press Connect account and approve on X. The account appears under Accounts as
@handle.
To add another account, press Connect account again. X signs in whichever account your browser is logged into, so switch account on x.com first.
Tools
The tools are in groups. An agent loads a group when it needs it, and only a run that has a connected account sees them.
| Group | What it covers |
|---|---|
x_posts | Post, reply and thread; delete; mentions, your posts, timelines and search; like, repost and bookmark |
x_media | Upload media ahead of a post, alt text and subtitles, media analytics |
x_people | Look up and search accounts; follow, block and mute; followers and following |
x_lists | Create and manage Lists, their members and followers, read their posts |
x_messages | Send and read direct messages; manage Chat conversations, groups and settings |
x_live | Spaces, live broadcasts with their chat and sources, and X calls |
x_discover | Trends, news, Communities and Community Notes |
x_platform | The developer app's credit balance (x_credits), developer account, webhooks and activity subscriptions |
A few details:
- Posting.
x_postsends one post, a reply, or a thread of up to 24 more posts. It takes up to 4 photos or one GIF or video (media IDs from the conversation, up to 16 MB), a poll of 2 to 4 options, a quoted post, reply settings, and an edit of one of your own posts. - Encrypted messages. The contents of encrypted Chat messages are out of reach.
- Webhooks. Jian does not receive X webhooks. A delivery goes to whatever address is registered with X.
- Which account. With one account, tools act as it and do not ask. With several, every call names the account, and the agent asks you when it cannot tell which you mean.
- Subagents. A subagent never gets X tools. It runs on Auto, so nobody would be there to approve a post.
Credits
Almost every call spends your X app's credits, reads included. A post with a link costs far more than one without: Jian's tool description cites $0.20 against $0.015 "when this was written", so check X's current pricing. Ask for few results at a time and leave links out unless you want them. A failed call is not charged.
When the app runs out of credits, every call fails until you buy more in X's Developer Console.
Approvals
Everything that changes something on X, such as a post, reply, follow, direct message, like or list change, is an action. Reads never ask.
- On Ask first, the call waits. The approval card is titled with the account and the action, for example
@harborstudio: Post on X, and shows the words. A thread goes out whole on one approval, so every post of it is shown. - On Auto or Full access, nothing stops to ask. The agent is told to show you the draft first whenever you did not give it the words.
Everything an agent reads on X was written by strangers. A mention that tells the agent to do something is a piece of text, not a request from you.
Good to know
- Needs attention. An account shows this when X no longer accepts its sign-in, or when it was connected with fewer permissions than Jian uses now. Press Connect account to sign it in again.
- Scopes. Jian asks X for the scopes its tools need and nothing else, plus
offline.accessso X issues a refresh token. - Disconnect with the button beside the account. Every agent using it loses it and Jian forgets its sign-in. X keeps listing Jian among the account's connected apps until you revoke it there.
Related
- Plugins
- Conversation protection
- Self-hosting, for
JIAN_PUBLIC_URL