datarobot-genai 0.2.15__py3-none-any.whl → 0.2.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datarobot_genai/drmcp/tools/clients/jira.py +44 -3
- datarobot_genai/drmcp/tools/jira/tools.py +34 -0
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/METADATA +1 -1
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/RECORD +8 -8
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/WHEEL +0 -0
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/entry_points.txt +0 -0
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/licenses/AUTHORS +0 -0
- {datarobot_genai-0.2.15.dist-info → datarobot_genai-0.2.16.dist-info}/licenses/LICENSE +0 -0
|
@@ -25,6 +25,18 @@ from .atlassian import get_atlassian_cloud_id
|
|
|
25
25
|
|
|
26
26
|
logger = logging.getLogger(__name__)
|
|
27
27
|
|
|
28
|
+
RESPONSE_JIRA_ISSUE_FIELDS = {
|
|
29
|
+
"id",
|
|
30
|
+
"key",
|
|
31
|
+
"summary",
|
|
32
|
+
"status",
|
|
33
|
+
"reporter",
|
|
34
|
+
"assignee",
|
|
35
|
+
"created",
|
|
36
|
+
"updated",
|
|
37
|
+
}
|
|
38
|
+
RESPONSE_JIRA_ISSUE_FIELDS_STR = ",".join(RESPONSE_JIRA_ISSUE_FIELDS)
|
|
39
|
+
|
|
28
40
|
|
|
29
41
|
class _IssuePerson(BaseModel):
|
|
30
42
|
email_address: str = Field(alias="emailAddress")
|
|
@@ -112,6 +124,37 @@ class JiraClient:
|
|
|
112
124
|
cloud_id = await self._get_cloud_id()
|
|
113
125
|
return f"{ATLASSIAN_API_BASE}/ex/jira/{cloud_id}/rest/api/3/{path}"
|
|
114
126
|
|
|
127
|
+
async def search_jira_issues(self, jql_query: str, max_results: int) -> list[Issue]:
|
|
128
|
+
"""
|
|
129
|
+
Search Jira issues using JQL (Jira Query Language).
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
jql_query: JQL Query
|
|
133
|
+
max_results: Maximum number of issues to return
|
|
134
|
+
|
|
135
|
+
Returns
|
|
136
|
+
-------
|
|
137
|
+
List of Jira issues
|
|
138
|
+
|
|
139
|
+
Raises
|
|
140
|
+
------
|
|
141
|
+
httpx.HTTPStatusError: If the API request fails
|
|
142
|
+
"""
|
|
143
|
+
url = await self._get_full_url("search/jql")
|
|
144
|
+
response = await self._client.post(
|
|
145
|
+
url,
|
|
146
|
+
json={
|
|
147
|
+
"jql": jql_query,
|
|
148
|
+
"fields": list(RESPONSE_JIRA_ISSUE_FIELDS),
|
|
149
|
+
"maxResults": max_results,
|
|
150
|
+
},
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
response.raise_for_status()
|
|
154
|
+
raw_issues = response.json().get("issues", [])
|
|
155
|
+
issues = [Issue(**issue) for issue in raw_issues]
|
|
156
|
+
return issues
|
|
157
|
+
|
|
115
158
|
async def get_jira_issue(self, issue_key: str) -> Issue:
|
|
116
159
|
"""
|
|
117
160
|
Get a Jira issue by its key.
|
|
@@ -128,9 +171,7 @@ class JiraClient:
|
|
|
128
171
|
httpx.HTTPStatusError: If the API request fails
|
|
129
172
|
"""
|
|
130
173
|
url = await self._get_full_url(f"issue/{issue_key}")
|
|
131
|
-
response = await self._client.get(
|
|
132
|
-
url, params={"fields": "id,key,summary,status,reporter,assignee,created,updated"}
|
|
133
|
-
)
|
|
174
|
+
response = await self._client.get(url, params={"fields": RESPONSE_JIRA_ISSUE_FIELDS_STR})
|
|
134
175
|
|
|
135
176
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
136
177
|
raise ValueError(f"{issue_key} not found")
|
|
@@ -26,6 +26,40 @@ from datarobot_genai.drmcp.tools.clients.jira import JiraClient
|
|
|
26
26
|
logger = logging.getLogger(__name__)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
@dr_mcp_tool(tags={"jira", "search", "issues"})
|
|
30
|
+
async def jira_search_issues(
|
|
31
|
+
*,
|
|
32
|
+
jql_query: Annotated[
|
|
33
|
+
str, "The JQL (Jira Query Language) string used to filter and search for issues."
|
|
34
|
+
],
|
|
35
|
+
max_results: Annotated[int, "Maximum number of issues to return. Default is 50."] = 50,
|
|
36
|
+
) -> ToolResult:
|
|
37
|
+
"""
|
|
38
|
+
Search for Jira issues using a powerful JQL query string.
|
|
39
|
+
|
|
40
|
+
Refer to JQL documentation for advanced query construction:
|
|
41
|
+
JQL functions: https://support.atlassian.com/jira-service-management-cloud/docs/jql-functions/
|
|
42
|
+
JQL fields: https://support.atlassian.com/jira-service-management-cloud/docs/jql-fields/
|
|
43
|
+
JQL keywords: https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/
|
|
44
|
+
JQL operators: https://support.atlassian.com/jira-service-management-cloud/docs/jql-operators/
|
|
45
|
+
"""
|
|
46
|
+
if not jql_query:
|
|
47
|
+
raise ToolError("Argument validation error: 'jql_query' cannot be empty.")
|
|
48
|
+
|
|
49
|
+
access_token = await get_atlassian_access_token()
|
|
50
|
+
if isinstance(access_token, ToolError):
|
|
51
|
+
raise access_token
|
|
52
|
+
|
|
53
|
+
async with JiraClient(access_token) as client:
|
|
54
|
+
issues = await client.search_jira_issues(jql_query=jql_query, max_results=max_results)
|
|
55
|
+
|
|
56
|
+
n = len(issues)
|
|
57
|
+
return ToolResult(
|
|
58
|
+
content=f"Successfully executed JQL query and retrieved {n} issue(s).",
|
|
59
|
+
structured_content={"data": [issue.as_flat_dict() for issue in issues], "count": n},
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
29
63
|
@dr_mcp_tool(tags={"jira", "read", "get", "issue"})
|
|
30
64
|
async def jira_get_issue(
|
|
31
65
|
*, issue_key: Annotated[str, "The key (ID) of the Jira issue to retrieve, e.g., 'PROJ-123'."]
|
|
@@ -77,12 +77,12 @@ datarobot_genai/drmcp/tools/__init__.py,sha256=0kq9vMkF7EBsS6lkEdiLibmUrghTQqosH
|
|
|
77
77
|
datarobot_genai/drmcp/tools/clients/__init__.py,sha256=0kq9vMkF7EBsS6lkEdiLibmUrghTQqosHbZ5k-V9a5g,578
|
|
78
78
|
datarobot_genai/drmcp/tools/clients/atlassian.py,sha256=__M_uz7FrcbKCYRzeMn24DCEYD6OmFx_LuywHCxgXsA,6472
|
|
79
79
|
datarobot_genai/drmcp/tools/clients/confluence.py,sha256=DF6TIGJfR3Lh-D_x66cDNkvOTS8gxL6bVhHRtcP0LKw,10493
|
|
80
|
-
datarobot_genai/drmcp/tools/clients/jira.py,sha256=
|
|
80
|
+
datarobot_genai/drmcp/tools/clients/jira.py,sha256=Rm91JAyrNIqxu66-9rU1YqoRXVnWbEy-Ahvy6f6HlVg,9823
|
|
81
81
|
datarobot_genai/drmcp/tools/clients/s3.py,sha256=GmwzvurFdNfvxOooA8g5S4osRysHYU0S9ypg_177Glg,953
|
|
82
82
|
datarobot_genai/drmcp/tools/confluence/__init__.py,sha256=0kq9vMkF7EBsS6lkEdiLibmUrghTQqosHbZ5k-V9a5g,578
|
|
83
83
|
datarobot_genai/drmcp/tools/confluence/tools.py,sha256=iqX7CR57WCXsQxHQCsfPL_Q78QjN9YZv3uIQbTMfYAg,5459
|
|
84
84
|
datarobot_genai/drmcp/tools/jira/__init__.py,sha256=0kq9vMkF7EBsS6lkEdiLibmUrghTQqosHbZ5k-V9a5g,578
|
|
85
|
-
datarobot_genai/drmcp/tools/jira/tools.py,sha256=
|
|
85
|
+
datarobot_genai/drmcp/tools/jira/tools.py,sha256=dfkqTU2HH-7n44hX80ODFacKq0p0LOchFcZtIIKFNMM,9687
|
|
86
86
|
datarobot_genai/drmcp/tools/predictive/__init__.py,sha256=WuOHlNNEpEmcF7gVnhckruJRKU2qtmJLE3E7zoCGLDo,1030
|
|
87
87
|
datarobot_genai/drmcp/tools/predictive/data.py,sha256=k4EJxJrl8DYVGVfJ0DM4YTfnZlC_K3OUHZ0eRUzfluI,3165
|
|
88
88
|
datarobot_genai/drmcp/tools/predictive/deployment.py,sha256=lm02Ayuo11L1hP41fgi3QpR1Eyty-Wc16rM0c8SgliM,3277
|
|
@@ -106,9 +106,9 @@ datarobot_genai/nat/datarobot_llm_clients.py,sha256=Yu208Ed_p_4P3HdpuM7fYnKcXtim
|
|
|
106
106
|
datarobot_genai/nat/datarobot_llm_providers.py,sha256=aDoQcTeGI-odqydPXEX9OGGNFbzAtpqzTvHHEkmJuEQ,4963
|
|
107
107
|
datarobot_genai/nat/datarobot_mcp_client.py,sha256=35FzilxNp4VqwBYI0NsOc91-xZm1C-AzWqrOdDy962A,9612
|
|
108
108
|
datarobot_genai/nat/helpers.py,sha256=Q7E3ADZdtFfS8E6OQPyw2wgA6laQ58N3bhLj5CBWwJs,3265
|
|
109
|
-
datarobot_genai-0.2.
|
|
110
|
-
datarobot_genai-0.2.
|
|
111
|
-
datarobot_genai-0.2.
|
|
112
|
-
datarobot_genai-0.2.
|
|
113
|
-
datarobot_genai-0.2.
|
|
114
|
-
datarobot_genai-0.2.
|
|
109
|
+
datarobot_genai-0.2.16.dist-info/METADATA,sha256=lTI4a5PfXD7nIUcmAmzENdRiaIfgdaLoruSwq95NYU8,6301
|
|
110
|
+
datarobot_genai-0.2.16.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
111
|
+
datarobot_genai-0.2.16.dist-info/entry_points.txt,sha256=jEW3WxDZ8XIK9-ISmTyt5DbmBb047rFlzQuhY09rGrM,284
|
|
112
|
+
datarobot_genai-0.2.16.dist-info/licenses/AUTHORS,sha256=isJGUXdjq1U7XZ_B_9AH8Qf0u4eX0XyQifJZ_Sxm4sA,80
|
|
113
|
+
datarobot_genai-0.2.16.dist-info/licenses/LICENSE,sha256=U2_VkLIktQoa60Nf6Tbt7E4RMlfhFSjWjcJJfVC-YCE,11341
|
|
114
|
+
datarobot_genai-0.2.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|