backlog-mcp 1.0.4__py3-none-any.whl → 1.0.5__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.
- app/main.py +1 -0
- app/tools/__init__.py +1 -0
- app/tools/update_issue_description.py +31 -0
- app/utils/ultils.py +53 -0
- {backlog_mcp-1.0.4.dist-info → backlog_mcp-1.0.5.dist-info}/METADATA +1 -1
- {backlog_mcp-1.0.4.dist-info → backlog_mcp-1.0.5.dist-info}/RECORD +8 -7
- {backlog_mcp-1.0.4.dist-info → backlog_mcp-1.0.5.dist-info}/WHEEL +0 -0
- {backlog_mcp-1.0.4.dist-info → backlog_mcp-1.0.5.dist-info}/entry_points.txt +0 -0
app/main.py
CHANGED
app/tools/__init__.py
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from app.utils.di import create_backlog_context
|
|
2
|
+
from app.utils.ultils import update_issue_description_handler
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
async def update_issue_description(
|
|
6
|
+
issue_key: str,
|
|
7
|
+
description: str,
|
|
8
|
+
):
|
|
9
|
+
"""
|
|
10
|
+
Update the description of a Backlog issue.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
issue_key (str): The key or ID of the Backlog issue to update.
|
|
14
|
+
description (str): The new description content for the issue.
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
if not issue_key:
|
|
18
|
+
raise ValueError("Please provide an issue key.")
|
|
19
|
+
if not description:
|
|
20
|
+
raise ValueError("Please provide a description.")
|
|
21
|
+
|
|
22
|
+
ctx = create_backlog_context()
|
|
23
|
+
result = await update_issue_description_handler(
|
|
24
|
+
backlog_domain=ctx.backlog_domain,
|
|
25
|
+
api_key=ctx.api_key,
|
|
26
|
+
issue_key=issue_key,
|
|
27
|
+
description=description,
|
|
28
|
+
)
|
|
29
|
+
return result
|
|
30
|
+
except Exception as e:
|
|
31
|
+
raise e
|
app/utils/ultils.py
CHANGED
|
@@ -300,3 +300,56 @@ async def get_current_user(backlog_domain: str, api_key: str) -> dict:
|
|
|
300
300
|
raise ValueError(f"Failed to get current user: {e}") from e
|
|
301
301
|
except Exception as e:
|
|
302
302
|
raise ValueError(f"Unexpected error while getting current user: {e}") from e
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
async def update_issue_description_handler(
|
|
306
|
+
backlog_domain: str,
|
|
307
|
+
api_key: str,
|
|
308
|
+
issue_key: str,
|
|
309
|
+
description: str,
|
|
310
|
+
):
|
|
311
|
+
"""Update issue description via Backlog API.
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
backlog_domain (str): Backlog domain URL
|
|
315
|
+
api_key (str): API key for authentication
|
|
316
|
+
issue_key (str): Issue key or ID
|
|
317
|
+
description (str): New description content
|
|
318
|
+
|
|
319
|
+
Returns:
|
|
320
|
+
dict: Updated issue information
|
|
321
|
+
"""
|
|
322
|
+
try:
|
|
323
|
+
url = f"{backlog_domain}api/v2/issues/{issue_key}"
|
|
324
|
+
params = {"apiKey": api_key}
|
|
325
|
+
data = {"description": description}
|
|
326
|
+
|
|
327
|
+
async with httpx.AsyncClient() as client:
|
|
328
|
+
response = await client.patch(
|
|
329
|
+
url,
|
|
330
|
+
params=params,
|
|
331
|
+
data=data,
|
|
332
|
+
headers={"Content-Type": "application/x-www-form-urlencoded"},
|
|
333
|
+
timeout=10.0
|
|
334
|
+
)
|
|
335
|
+
response.raise_for_status()
|
|
336
|
+
result = response.json()
|
|
337
|
+
|
|
338
|
+
result = {
|
|
339
|
+
"issueKey": result["issueKey"],
|
|
340
|
+
"summary": result["summary"],
|
|
341
|
+
"description": result["description"]
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return result
|
|
345
|
+
except httpx.HTTPStatusError as e:
|
|
346
|
+
try:
|
|
347
|
+
body = e.response.json()
|
|
348
|
+
error_code = None
|
|
349
|
+
if "errors" in body and body["errors"]:
|
|
350
|
+
error_code = body["errors"][0].get("code")
|
|
351
|
+
raise ValueError(f"API error: {BacklogApiError.get_description_by_code(error_code)}") from e
|
|
352
|
+
except Exception:
|
|
353
|
+
raise ValueError("Failed to parse error response") from e
|
|
354
|
+
except Exception as e:
|
|
355
|
+
raise ValueError(f"Request failed: {str(e)}") from e
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
app/logging_config.py,sha256=1tSV1HXExfIi_mxOpugvGL7ywd43SMmsKsjARWXTLnU,999
|
|
3
|
-
app/main.py,sha256=
|
|
3
|
+
app/main.py,sha256=iCyuJoQlueVQjZWmAlmb1WuMBDO2arTHSjkjLoXCZqQ,527
|
|
4
4
|
app/server_settings.py,sha256=mI-G1DKJ2IBg9dKuW4Da5MDhFLeYSQwLOGGNEb_kQwM,434
|
|
5
5
|
app/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
app/constants/constants.py,sha256=DV8HJnvCceHqUmA5csk9CcmcX9Zr0upl56qXVa9tF88,1664
|
|
7
7
|
app/core/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
8
8
|
app/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
app/models/models.py,sha256=y3JhziNew3_2bM4Lw3aVjWcTvhmaEbzz0AaCHsdAkbk,4169
|
|
10
|
-
app/tools/__init__.py,sha256=
|
|
10
|
+
app/tools/__init__.py,sha256=v37to4C68ZJswTDeECaZZT3IPbRIe876CzJ_0XmZYCw,108
|
|
11
11
|
app/tools/get_issue_details.py,sha256=efixu906oloeIZdf-geTlLxt9nLe-tPDqUlDd9HL6-g,973
|
|
12
12
|
app/tools/get_user_issue_list.py,sha256=soNX0OfvfT1hIyzeDMPaHpAjHeGqavtZdTl0CemCpyo,865
|
|
13
|
+
app/tools/update_issue_description.py,sha256=yS0yAETvDWeQYyeT-h7gTTihuszxyTJtizEyT6p4SX8,916
|
|
13
14
|
app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
15
|
app/utils/di.py,sha256=5MmL6efLAX3uzp5WSMi4E_BDCgapzlr_OERZoN5NGnM,408
|
|
15
|
-
app/utils/ultils.py,sha256=
|
|
16
|
-
backlog_mcp-1.0.
|
|
17
|
-
backlog_mcp-1.0.
|
|
18
|
-
backlog_mcp-1.0.
|
|
19
|
-
backlog_mcp-1.0.
|
|
16
|
+
app/utils/ultils.py,sha256=_JGcpS-EMgp4gw_A3c4dTdPl5UEvVCM1x61n5VrQt70,13099
|
|
17
|
+
backlog_mcp-1.0.5.dist-info/METADATA,sha256=t774bjIDzAc1nbJBF6ahSq3j7rb4oSFFstufxSdzAQg,3883
|
|
18
|
+
backlog_mcp-1.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
19
|
+
backlog_mcp-1.0.5.dist-info/entry_points.txt,sha256=h5JeHYUp_uoaya4FO3QelcsgYOu-VRmh5qWRhPrwjtk,46
|
|
20
|
+
backlog_mcp-1.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|