Skip to content

Commit fc2cbdc

Browse files
updated deps
1 parent 4c6a829 commit fc2cbdc

File tree

3 files changed

+1198
-681
lines changed

3 files changed

+1198
-681
lines changed

NEWS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# DCI MCP Server - Change Log
22

3+
## [2026-01-27]
4+
5+
### Improvements
6+
7+
- Simplified prompt implementations to use FastMCP's modern API (direct string returns instead of PromptMessage/TextContent wrappers)
8+
9+
### Dependencies
10+
11+
- Updated all project dependencies to their latest versions:
12+
- black: 25.1.0 → 26.1.0
13+
- ruff: 0.12.8 → 0.14.14
14+
- pytest: 8.4.1 → 9.0.2
15+
- fastapi: 0.116.1 → 0.128.0
16+
- fastmcp: 2.11.3 → 2.14.4
17+
- mcp: 1.12.4 → 1.26.0
18+
- pydantic: 2.11.7 → 2.12.5
19+
- isort: 6.0.1 → 7.0.0
20+
- cryptography: 45.0.6 → 46.0.3
21+
- dciclient: 4.1.0.post202509100810 → 4.1.0.post202510221005
22+
- google-api-python-client: 2.181.0 → 2.188.0
23+
- uvicorn: 0.35.0 → 0.40.0
24+
- pre-commit: 4.3.0 → 4.5.1
25+
- And many other dependency updates
26+
327
## [2025-11-21]
428

529
### Improvements

mcp_server/prompts/prompts.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2025 Red Hat, Inc.
2+
# Copyright (C) 2025-2026 Red Hat, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License"); you may
55
# not use this file except in compliance with the License. You may obtain
@@ -17,8 +17,6 @@
1717

1818
from typing import Annotated
1919

20-
from fastmcp.prompts.prompt import PromptMessage, TextContent
21-
2220

2321
def register_prompts(mcp):
2422
"""Register prompts with the MCP server."""
@@ -28,14 +26,14 @@ async def rca(
2826
dci_job_id: str = Annotated[
2927
str, "The DCI job ID for which to perform root cause analysis (RCA)."
3028
],
31-
) -> PromptMessage:
29+
) -> str:
3230
"""
3331
Prompt for instructions on how to do a Root Cause Analysis (RCA) of a failing DCI job. Always use this prompt when analysing a failing DCI job.
3432
3533
Returns:
3634
A prompt message with instructions on how to perform RCA of a failing DCI job.
3735
"""
38-
content = f"""Conduct a root cause analysis (RCA) on the following DCI job: {dci_job_id}. Store all the downloaded files at /tmp/dci/<job id>, so as not to download them twice. Create a report with your findings at /tmp/dci/rca-<job id>.md. Be sure to include details about the timeline of events and the DCI job information in the report, such as the components, the topic, and the pipeline name. If there is a CILAB-<num> comment, replace it with https://issues.redhat.com/browse/CILAB-<num>. Include a hyperlink each time you refer to the DCI job ID.
36+
return f"""Conduct a root cause analysis (RCA) on the following DCI job: {dci_job_id}. Store all the downloaded files at /tmp/dci/<job id>, so as not to download them twice. Create a report with your findings at /tmp/dci/rca-<job id>.md. Be sure to include details about the timeline of events and the DCI job information in the report, such as the components, the topic, and the pipeline name. If there is a CILAB-<num> comment, replace it with https://issues.redhat.com/browse/CILAB-<num>. Include a hyperlink in the form https://distributed-ci.io/jobs/<job id> each time you refer to the DCI job ID.
3937
4038
First step is to review ansible.log (overview of the CI job execution). Then the logjuicer.txt (for regular files) and logjuicer_omg.txt (for must_gather) files that compare the logs from a previous successful run.
4139
@@ -49,65 +47,54 @@ async def rca(
4947
5048
Check it the associated JIRA ticket is consistent with your findings.
5149
"""
52-
return PromptMessage(
53-
role="user", content=TextContent(type="text", text=content)
54-
)
5550

5651
@mcp.prompt()
5752
async def weekly(
5853
subject: str = Annotated[
5954
str, "The subject of the analysis (team name or id, remoteci name or id)."
6055
],
61-
) -> PromptMessage:
56+
) -> str:
6257
"""
6358
Prompt for instructions on how to analyze DCI jobs for a week.
6459
6560
Returns:
6661
A prompt message with instructions on how to analyze DCI jobs for a week.
6762
"""
68-
content = f"""Analyze the DCI jobs for the last week for {subject}. Provide a summary of the number of jobs, the number of failures, and the failure rate. Identify the top 3 reasons for failures and provide recommendations for improvement. If there are any CILAB-<num> comments, replace them with https://issues.redhat.com/browse/CILAB-<num>. Include hyperlinks each time you refer to a DCI job ID.
63+
return f"""Analyze the DCI jobs for the last week for {subject}. Provide a summary of the number of jobs, the number of failures, and the failure rate. Identify the top 3 reasons for failures and provide recommendations for improvement. If there are any CILAB-<num> comments, replace them with https://issues.redhat.com/browse/CILAB-<num>. Include hyperlinks in the form https://distributed-ci.io/jobs/<job id> each time you refer to a DCI job ID.
6964
7065
Create a report with your findings in the /tmp/dci directory (create the directory if it doesn't exist). Be sure to include a summary, statistics and anomaly detection if applicable. Use markdown formatting for the report.
7166
"""
7267

73-
return PromptMessage(
74-
role="user", content=TextContent(type="text", text=content)
75-
)
76-
7768
@mcp.prompt()
7869
async def biweekly(
7970
subject: str = Annotated[
8071
str, "The subject of the analysis (team name or id, remoteci name or id)."
8172
],
82-
) -> PromptMessage:
73+
) -> str:
8374
"""
8475
Prompt for instructions on how to analyze DCI jobs for 2 weeks.
8576
8677
Returns:
8778
A prompt message with instructions on how to analyze DCI jobs for a week.
8879
"""
89-
content = f"""Analyze the DCI jobs for the last 2 weeks for {subject}. Provide a summary of the number of jobs, the number of failures, and the failure rate. Identify the top 3 reasons for failures and provide recommendations for improvement. If there are any CILAB-<num> comments, replace them with https://issues.redhat.com/browse/CILAB-<num>. Include hyperlinks each time you refer to a DCI job ID.
80+
return f"""Analyze the DCI jobs for the last 2 weeks for {subject}. Provide a summary of the number of jobs, the number of failures, and the failure rate. Identify the top 3 reasons for failures and provide recommendations for improvement. If there are any CILAB-<num> comments, replace them with https://issues.redhat.com/browse/CILAB-<num>. Include hyperlinks in the form https://distributed-ci.io/jobs/<job id> each time you refer to a DCI job ID.
9081
9182
Create a report with your findings in the /tmp/dci directory (create the directory if it doesn't exist). Be sure to include a summary, statistics and anomaly detection if applicable. Use markdown formatting for the report.
9283
"""
9384

94-
return PromptMessage(
95-
role="user", content=TextContent(type="text", text=content)
96-
)
97-
9885
@mcp.prompt()
9986
async def quarterly(
10087
subject: str = Annotated[
10188
str, "The subject of the analysis (remoteci name or id)."
10289
],
103-
) -> PromptMessage:
90+
) -> str:
10491
"""
10592
Prompt for instructions on how to analyze DCI jobs for a quarter (3 months).
10693
10794
Returns:
10895
A prompt message with instructions on how to analyze DCI jobs for a quarter.
10996
"""
110-
content = f"""Analyze the DCI jobs for the last quarter (3 months) for {subject}. Due to the large volume of data, you must use a multi-step approach with caching to avoid exhausting the context window.
97+
return f"""Analyze the DCI jobs for the last quarter (3 months) for {subject}. Due to the large volume of data, you must use a multi-step approach with caching to avoid exhausting the context window.
11198
11299
## Step 1: Data Collection and Caching
113100
@@ -256,9 +243,6 @@ async def quarterly(
256243
- Prioritize statistics that reveal patterns and trends
257244
- Be thorough but concise in the report
258245
"""
259-
return PromptMessage(
260-
role="user", content=TextContent(type="text", text=content)
261-
)
262246

263247

264248
# prompts.py ends here

0 commit comments

Comments
 (0)