Confluence Tools

List Confluence spaces, read page content, and create new pages with ConfluenceTools.

confluence_tools.py
"""
Confluence Tools
=============================

Demonstrates confluence tools.
"""

from agno.agent import Agent
from agno.tools.confluence import ConfluenceTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------


agent = Agent(
    name="Confluence agent",
    tools=[ConfluenceTools()],
    markdown=True,
)

## getting space details

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    agent.print_response("How many spaces are there and what are their names?")

    ## getting page_content
    agent.print_response(
        "What is the content present in page 'Large language model in LLM space'"
    )

    ## getting page details in a particular space
    agent.print_response("Can you extract all the page names from 'LLM' space")

    ## creating a new page in a space
    agent.print_response("Can you create a new page named 'TESTING' in 'LLM' space")

For Confluence Cloud, use your account email as CONFLUENCE_USERNAME and an API token as CONFLUENCE_API_KEY. Replace the LLM space and page title with ones available to that account. The final call creates a real TESTING page; use a test space. The space-page listing is one SDK response page, not a complete paginated inventory.

Run the Example

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U agno atlassian-python-api openai requests urllib3

Export environment variables

export CONFLUENCE_API_KEY="your_confluence_api_key_here"
export CONFLUENCE_URL="https://your-site.atlassian.net/wiki"
export CONFLUENCE_USERNAME="your-account@example.com"
export OPENAI_API_KEY="your_openai_api_key_here"

Run the example

Save the code above as confluence_tools.py, then run:

python confluence_tools.py

Full source: cookbook/91_tools/confluence_tools.py