Code

cookbook/tools/webex_tools.py
from agno.agent import Agent
from agno.tools.webex import WebexTools

agent = Agent(
    name="Webex Assistant",
    tools=[WebexTools()],
    description="You are a Webex assistant that can send messages and manage spaces.",
    instructions=[
        "You can help users by:",
        "- Listing available Webex spaces",
        "- Sending messages to spaces",
        "Always confirm the space exists before sending messages.",
    ],
    show_tool_calls=True,
    markdown=True,
)

# List all spaces in Webex
agent.print_response("List all spaces on our Webex", markdown=True)

# Send a message to a Space in Webex
agent.print_response(
    "Send a funny ice-breaking message to the webex Welcome space", markdown=True
)

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.

python3 -m venv .venv
source .venv/bin/activate
2

Set up Webex Bot

  1. Go to Webex Developer Portal
  2. Create a Bot:
    • Navigate to My Webex Apps → Create a Bot
    • Fill in the bot details and click Add Bot
  3. Get your access token:
    • Copy the token shown after bot creation
    • Or regenerate via My Webex Apps → Edit Bot
3

Set your API keys

export WEBEX_ACCESS_TOKEN=xxx
export OPENAI_API_KEY=xxx
4

Install libraries

pip install -U webexpythonsdk openai agno
5

Run Agent

python cookbook/tools/webex_tools.py