Custom tools created not working

import os
import re
import time
import httpx
from github import Github
from dotenv import load_dotenv
from agno.agent import Agent
from agno.tools import Toolkit
from agno.models.ollama import Ollama
from jira import JIRA, Issue
from agno.utils.log import logger
from typing import cast
import json

GitHub Config

GITHUB_TOKEN = “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”
GITHUB_API_URL = “https://github01.hclpnp.com/api/v3
ORG_REPO = “NandishKu/MLTestingTCoE”

JIRA Config

JIRA_BASE_URL = “https://hclsw-jiracentral.atlassian.net/
JIRA_EMAIL = “”
JIRA_API_TOKEN = “”

Initialize JIRA client

class JiraToolsOwn(Toolkit):
def init(self):
super().init(name=“jira_tools”)
# Initialize JIRA client using API token authentication
self.jira = JIRA(server=JIRA_BASE_URL, basic_auth=(JIRA_EMAIL, JIRA_API_TOKEN))
print(self.jira)
self.register(self.get_issue)

def get_issue(self, issue_key: str) -> str:
    """
    Retrieves issue details from Jira.

    :param issue_key: The key of the issue to retrieve.
    :return: A JSON string containing issue details.
    """
    try:
        issue = self.jira.issue(issue_key)
        issue = cast(Issue, issue)
        issue_details = {
            "key": issue.key,
            "project": issue.fields.project.key,
            "issuetype": issue.fields.issuetype.name,
            "reporter": issue.fields.reporter.displayName if issue.fields.reporter else "N/A",
            "summary": issue.fields.summary,
            "description": issue.fields.description or "",
        }
        logger.debug(f"Issue details retrieved for {issue_key}: {issue_details}")
        return json.dumps(issue_details)
    except Exception as e:
        logger.error(f"Error retrieving issue {issue_key}: {e}")
        return json.dumps({"error": str(e)})

Create PR Review Agent

review_agent = Agent(
name=“JIRA Agent”,
role=“Search the JIRA for information”,
model=Ollama(id=“llama3.2:latest”),
instructions=[
“1. Extract the JIRA issue and from that print title or description.”,
],
tools=[JiraToolsOwn()],
show_tool_calls=True,
structured_outputs=True,
reasoning=True,
stream=True
)

Example query to review a PR

try:
review_agent.print_response(
“Fetch the JIRA Issue CE-677 and print the entire description and Title all the Information available”
)
except Exception as e:
logger.error(f"Agent failed to complete the task: {e}")

The JIRA Tool which is created to understand the custom tool is not hitting the actual URL but gives random issues, whats the option for the, I know there is JIRATools avaliable but would like to create other tools similar but the existing ones is also failing can you guys help?

Hey @nandishku,
I am very sorry - this request was marked by discourse as spam and was stuck for approvals.

I have tag our engineers on this. We will get back to you asap.

Again, I am really sorry about this