Skip to main content
Use this guide when an agent already calls packaged X/Twitter tools and you want to migrate the workflow to Twexapi MCP.

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
Use 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:
Twexapi MCP task:

Validation checklist

  • Compare row counts before and after migration.
  • Verify all downstream steps use tweet_id instead 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

  1. Run old and new workflows side by side on read-only tasks.
  2. Compare row counts, required fields, and representative URLs.
  3. Switch scheduled jobs to the Twexapi MCP/REST route.
  4. Re-enable write actions only after approval prompts are tested.