Skip to content

Conversation

@cbbayburt
Copy link
Contributor

@cbbayburt cbbayburt commented Dec 4, 2025

List of changes

  • Reorganized system list/details tools
  • Combined CPU details tools functionality into get_system_details tool
  • API error handling: raised errors are propagated to the MCP client through FastMCP
  • Standardized logging and status reporting replacing print statements
  • MCP progress report where applicable
  • Standardized tool naming for convention
  • Added network (IP) information to get_system_details tool
  • Added tools for systems search by name or IP
  • Fallback to user/pass credentials if no auth server is configured

Fixes https://github.com/SUSE/spacewalk/issues/27816

@cbbayburt cbbayburt force-pushed the tool-reorganization branch 2 times, most recently from 0c66c51 to 144a2b0 Compare December 9, 2025 15:48
@cbbayburt cbbayburt marked this pull request as ready for review December 9, 2025 15:52
@cbbayburt cbbayburt force-pushed the tool-reorganization branch from 144a2b0 to 1c6b197 Compare December 9, 2025 16:03
Copy link
Contributor

@ycedres ycedres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just left small comments.

system_identifier: The unique identifier of the system. It can be the system name (e.g. "buildhost") or the system ID (e.g. 1000010000).
system_identifier: The system name (e.g., "buildhost.example.com") or system ID (e.g., 1000010000).
Prefer using numerical system IDs instead of system names when possible.
offset: Number of reults to skip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small typo in the word "results".

@mcp.tool()
async def get_cpu_of_a_system(system_identifier: Union[str, int], ctx: Context) -> Dict[str, Any]:
async def get_system_event_history(system_identifier: Union[str, int], ctx: Context, offset: int = 0, limit: int = 10, earliest_date: str = None):
"""Gets the event/action history of the specified system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it and works fine, the LLM just returns the first 10 events. Would it be nice to steer the LLM so it asks if the user wants the next batch with a subsequent call with the next offset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave it to LLMs decision. It mostly depends on the history of the conversation, and what led to this tool call. In many cases, this tool would be called as part of a bigger conversation, such as "check what went wrong with this patch application on this date" or "check if my system tasks executed properly" etc. In this case, LLM should decide what slice it wants to get depending on the situation.

One thing that's missing though, is the total number of events available. This would be very useful for the LLM to know in advance. However, it's not provided by the API as of now.

@jordimassaguerpla
Copy link
Contributor

I love it ! However, the first commit is from #33 and I have some concerns on that one, which means there might need to be a rebase.

@jordimassaguerpla
Copy link
Contributor

I love it ! However, the first commit is from #33 and I have some concerns on that one, which means there might need to be a rebase.

concerns resolved. Approving!

@cbbayburt cbbayburt merged commit 82a315d into main Dec 11, 2025
@cbbayburt cbbayburt deleted the tool-reorganization branch December 11, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants