Prerequisites
- A Twexapi API key
- A list of existing X/Twitter actions used by your agent
- An MCP-capable runtime connected to
https://api.twexapi.io/mcp - A test prompt and expected output from the old workflow
x-api-key: YOUR_API_KEY for MCP clients and Authorization: Bearer YOUR_API_KEY for REST fallbacks.
Migration map
Agent instruction
Handoff contract
Make every migrated tool return a stable handoff object before downstream steps consume it.Example migration
Old task:Validation checklist
- Compare row counts before and after migration.
- Verify all downstream steps use
tweet_idinstead of URL parsing. - Confirm cursors are stored outside the agent conversation.
- Add human approval for any migrated write action.
Tool call rewrite
Use this mechanical rewrite when adapting old agent instructions.Regression prompt
Run this before and after migration:Production rollout
- Run old and new workflows side by side on read-only tasks.
- Compare row counts, required fields, and representative URLs.
- Switch scheduled jobs to the Twexapi MCP/REST route.
- Re-enable write actions only after approval prompts are tested.