Prompt
You are the social step of a research pipeline. Given the summary of this week's top 3 papers on retrieval, draft one X thread: a hook tweet, one tweet per paper with the key finding, and a closing tweet. Call draft_post once with networks ['x']. How to do it
- Mint a key Create a key for the pipeline, scoped to X with the draft permission.
- Load the tools Use MultiServerMCPClient from langchain-mcp-adapters with transport streamable_http, url https://app.socialhandoff.com/mcp, and an Authorization header. Call get_tools().
- Bind them to the agent Pass the tools to your agent, for example create_react_agent, alongside your research tools.
- Or call REST directly If you prefer a plain tool, wrap POST https://app.socialhandoff.com/v1/posts with body, thread, networks, and mode submit in a @tool function.
- Review the output Check drafts in the inbox. Reject with a reason so you can feed it back into the prompt.
Example draft
1/ Three retrieval papers worth your time this week, each with one finding you can use. 2/ Paper 1: re-ranking with a small model after BM25 beat dense-only retrieval on long documents. 3/ Paper 2: chunking by headings, not fixed tokens, cut wrong-section answers by a third. 4/ Paper 3: caching query embeddings made eval runs cheaper with no change in scores. Links in replies.
Gotchas
- Chains can call a tool more than once. Pass an idempotency key in REST calls, or instruct the agent to call draft_post exactly once, so retries do not create duplicate drafts.
- Each tweet in the thread is validated against X's weighted 280 count. Have the chain return a list, not one string you split later.
- Do not give the pipeline an owner key. Agent keys cannot approve, which is the point.
- Character limit: 280 weighted characters for standard accounts. Most CJK characters and many emoji count as 2. Premium accounts can post longer, but SocialHandoff checks against 280.
- Links: Every URL is wrapped by t.co and counts as 23 characters, whatever its real length.
- Media per post: Up to 4 images, or 1 GIF, or 1 video.
- File sizes: Images up to 5 MB, GIFs up to 15 MB, video up to 512 MB (uploaded in chunks).
Frequently asked questions
MCP adapters or REST: which should I use?
MCP gives you all the tools with descriptions the model already understands. REST is simpler if you only need one call and want full control over the payload.
Can the chain learn from rejections?
You can read past posts back with list_posts and adjust the prompt, or store voice rules and banned topics in brand memory so every run starts from them.