Skip to main content
XTools allows an Agent to interact with X, providing functionality for posting, messaging, and searching tweets.

Prerequisites

Install the required library:
Tweepy is a Python library for interacting with the X API.

Setup

  1. Create X Developer Account
    • Visit developer.x.com and apply for developer access
    • Create a new project and app in your developer portal
  2. Generate API Credentials
    • Navigate to your app’s “Keys and tokens” section
    • Generate and copy these credentials:
      • API Key & Secret
      • Bearer Token
      • Access Token & Secret
  3. Configure Environment

Example

cookbook/91_tools/x_tools.py
Check out the Tweet Analysis Agent for a more advanced example.

Toolkit Params

Toolkit Functions

You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Developer Resources