Redmine Tools

Demonstrates the Redmine tools for searching, reading, creating, updating, and commenting on issues.

redmine_tools.py
"""
Redmine Tools
=============================

Demonstrates the Redmine tools for searching, reading, creating, updating, and commenting on issues.

Set the following environment variables before running:
- REDMINE_SERVER_URL
- REDMINE_TOKEN (or REDMINE_USERNAME and REDMINE_PASSWORD if you don't have a token)
"""

import os

from agno.agent import Agent
from agno.tools.redmine import RedmineTools

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

# Get Redmine connection details from environment
server_url = os.getenv("REDMINE_SERVER_URL")
token = os.getenv("REDMINE_TOKEN")

agent = Agent(
    name="Redmine agent",
    tools=[RedmineTools(server_url=server_url, token=token)],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    # searching issues by subject
    agent.print_response("Find all issues whose subject contains 'search'")

    # getting issue details
    agent.print_response("Show me the details of issue 1")

    # creating a new issue
    agent.print_response(
        "Create a Bug in project 'website' titled 'Login button unresponsive' "
        "described 'The login button does nothing on click'"
    )

    # adding a comment
    agent.print_response("Add the comment 'Reviewed and confirmed' to issue 1")

Prepare your Redmine project

Use a Redmine server with its REST API enabled and an account that can access the target project. Replace issue 1, project website, and tracker Bug in the prompts with values from that server. Running all four prompts creates an issue and adds a comment to the selected issue.

The credentials below use an API token. For username/password authentication instead, leave REDMINE_TOKEN unset and export both REDMINE_USERNAME and REDMINE_PASSWORD. A configured token takes precedence.

Run the Example

Set up your virtual environment

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

Install dependencies

uv pip install -U agno openai python-redmine

Export environment variables

export OPENAI_API_KEY="your_openai_api_key_here"
export REDMINE_SERVER_URL="your_redmine_server_url_here"
export REDMINE_TOKEN="your_redmine_token_here"

Run the example

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

python redmine_tools.py

Full source: cookbook/91_tools/redmine_tools.py