arcade-mcp/toolkits/jira/arcade_jira/tools/__init__.py
Renato Byrro 30739dc44a
Support for multiple Atlassian Clouds in the Jira Toolkit (#506)
Adds `Jira.GetAvailableAtlassianClouds` tool, which provides a list of
clouds available (checking which Clouds were actually authorized by the
current auth token).

Refactors the interface of every tool to accept an `atlassian_cloud_id`
argument (when not provided, try to get a unique cloud ID - if multiple
are available, raises a Retryable error with the list of Clouds
available instructing to select one).

Gets rid of all caching. Now storing the global semaphore to the context
object. The global semaphore is important because some tools depend on
others, and each tool instantiates its own Jira HTTP client. Storing the
semaphore in the context object ensures that all HTTP clients will
respect the concurrency limit.

Removes from tool responses the Atlassian URLs linking to objects in the
Jira GUI (users, projects, issues, etc. We do not keep track of the
cloud name anymore, which is required to build the objects' URLs.

Extends/refactors unit tests accordingly.

Evals checking LLM behavior when:

- a cloud ID is explicitly mentioned in the prompt;
- no cloud ID is mentioned;
- a "multiple clouds available" error is raised and the user is prompted
to pick one;
- user request triggers another tool call after having previously picked
a cloud ID (in the same chat context);
2025-07-23 18:09:54 -03:00

83 lines
2.4 KiB
Python

from arcade_jira.tools.attachments import (
attach_file_to_issue,
download_attachment,
get_attachment_metadata,
list_issue_attachments_metadata,
)
from arcade_jira.tools.cloud import get_available_atlassian_clouds
from arcade_jira.tools.comments import (
add_comment_to_issue,
get_comment_by_id,
get_issue_comments,
)
from arcade_jira.tools.issues import (
add_labels_to_issue,
create_issue,
get_issue_by_id,
get_issue_type_by_id,
get_issues_without_id,
list_issue_types_by_project,
remove_labels_from_issue,
search_issues_with_jql,
update_issue,
)
from arcade_jira.tools.labels import list_labels
from arcade_jira.tools.priorities import (
get_priority_by_id,
list_priorities_associated_with_a_priority_scheme,
list_priorities_available_to_a_project,
list_priorities_available_to_an_issue,
list_priority_schemes,
list_projects_associated_with_a_priority_scheme,
)
from arcade_jira.tools.projects import get_project_by_id, search_projects
from arcade_jira.tools.transitions import (
get_transition_by_status_name,
get_transitions_available_for_issue,
transition_issue_to_new_status,
)
from arcade_jira.tools.users import get_user_by_id, get_users_without_id, list_users
__all__ = [
# Attachments tools
"attach_file_to_issue",
"download_attachment",
"get_attachment_metadata",
"list_issue_attachments_metadata",
# Cloud tools
"get_available_atlassian_clouds",
# Comments tools
"add_comment_to_issue",
"get_comment_by_id",
"get_issue_comments",
# Issues tools
"add_labels_to_issue",
"create_issue",
"get_issue_by_id",
"get_issue_type_by_id",
"get_issues_without_id",
"list_issue_types_by_project",
"remove_labels_from_issue",
"search_issues_with_jql",
"update_issue",
# Labels tools
"list_labels",
# Priorities tools
"get_priority_by_id",
"list_priority_schemes",
"list_priorities_associated_with_a_priority_scheme",
"list_projects_associated_with_a_priority_scheme",
"list_priorities_available_to_a_project",
"list_priorities_available_to_an_issue",
# Projects tools
"get_project_by_id",
"search_projects",
# Transitions tools
"get_transition_by_status_name",
"get_transitions_available_for_issue",
"transition_issue_to_new_status",
# Users tools
"get_user_by_id",
"get_users_without_id",
"list_users",
]