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")
Run the Example
1
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
2
Install dependencies
uv pip install -U agno atlassian atlassian-python-api openai requests urllib3
3
Export environment variables
export CONFLUENCE_API_KEY="your_confluence_api_key_here"
export CONFLUENCE_PASSWORD="your_confluence_password_here"
export OPENAI_API_KEY="your_openai_api_key_here"
$Env:CONFLUENCE_API_KEY="your_confluence_api_key_here"
$Env:CONFLUENCE_PASSWORD="your_confluence_password_here"
$Env:OPENAI_API_KEY="your_openai_api_key_here"
4
Run the example
Save the code above as
confluence_tools.py, then run:python confluence_tools.py