Confluence

ConfluenceTools enable an Agent to retrieve, create, and update pages in Confluence. They also allow you to explore spaces and page details.

Prerequisites

The following example requires the atlassian-python-api library and Confluence credentials. You can obtain an API token by going here.

1uv pip install atlassian-python-api
1export CONFLUENCE_URL="https://your-confluence-instance"
2export CONFLUENCE_USERNAME="your-username"
3export CONFLUENCE_PASSWORD="your-password"
4# or
5export CONFLUENCE_API_KEY="your-api-key"

Example

The following agent will retrieve the number of spaces and their names.

1from kern.agent import Agent
2from kern.tools.confluence import ConfluenceTools
3
4agent = Agent(
5 name="Confluence agent",
6 tools=[ConfluenceTools()],
7 markdown=True,
8)
9
10agent.print_response("How many spaces are there and what are their names?")

Toolkit Params

ParameterTypeDefaultDescription
usernameOptional[str]NoneConfluence username. If not provided, uses CONFLUENCE_USERNAME environment variable.
passwordOptional[str]NoneConfluence password. If not provided, uses CONFLUENCE_PASSWORD environment variable.
urlOptional[str]NoneConfluence instance URL. If not provided, uses CONFLUENCE_URL environment variable.
api_keyOptional[str]NoneConfluence API key (alternative to password). If not provided, uses CONFLUENCE_API_KEY environment variable.
verify_sslboolTrueWhether to verify SSL certificates when making requests.

Toolkit Functions

FunctionDescription
get_page_contentGets the content of a specific page.
get_all_space_detailGets details about all Confluence spaces.
get_space_keyGets the Confluence key for the specified space.
get_all_page_from_spaceGets details of all pages from the specified space.
create_pageCreates a new Confluence page with the provided title and body.
update_pageUpdates an existing Confluence page.

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