Skip to content

Conversation

@lkrzyzanek
Copy link

@lkrzyzanek lkrzyzanek commented Oct 7, 2025

Description

DRAFT!

This code support of handling 1 MCP server result and passing programaticaly to "generate_ui" tool call argument (Next Gen UI MCP).

The PR also enhance the API response of sending also artifact next to content which is standard way how to send structured data to the client.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

@lkrzyzanek lkrzyzanek marked this pull request as draft October 7, 2025 14:25
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 7, 2025
@openshift-ci openshift-ci bot requested review from joshuawilson and onmete October 7, 2025 14:26
@openshift-ci
Copy link

openshift-ci bot commented Oct 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onmete for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 7, 2025
@openshift-ci
Copy link

openshift-ci bot commented Oct 7, 2025

Hi @lkrzyzanek. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

)


async def execute_tool_calls(
Copy link
Contributor

Choose a reason for hiding this comment

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

This function can be called multiple times ( max_rounds OR until finish_reason=stop ) Do we want to run the generate_ui during the , intermediate steps too ? @lkrzyzanek for POC this is okay .

Copy link
Author

Choose a reason for hiding this comment

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

generate_ui task is generated by LLM and also LLM decides when it happens.
I'm just making sure that conversation (all another tool results) are passed correctly to generate_ui.
So I think it's fine to keep it here.

My observation is that LLM creates for me in 1st round Kube MCP tool and 2nd round was NGUI MCP.

Presumption is that it will be last call. However LLM can make a different decision when user prompt asks for multiple actions. But we need to explore that on exact use cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have few basic queries.

  • How are we making sure that even for simple use case model calls the generate_ui tool at the end ? I don't see any prompt change.. is there some information in tool definition ?
  • Is it always going to be just one tool in future as well ?
  • Are we expecting that generate_ui tool will be called always ?

Copy link
Author

Choose a reason for hiding this comment

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

  • @xrajesh works on system prompt tuning
  • for UI generation probably yes. For other use cases like layout management etc we will probably introduce another tools
  • We originally thought it will be always called. However it also depends on the use case / experience. But it will be decided based on @xrajesh 's work on system prompt tuning.

Copy link
Author

Choose a reason for hiding this comment

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

@xrajesh I removed the logic that gather input data and pass it to NGUI and improved NGUI to have string tool arguments so LLM can pass the data directly.

My observation so far:

  1. bigger LLM can generatre NGUI args with data from previous tool call with some level of probability.
  2. Smaller data goes good and reasonably fast. e.g. generate a table component showing pods in openshift-lightspeed namespace, include all available data
  3. Bigger data takes a lot of time and fails e.g. what are my namespaces, generate ui.

Copy link
Author

Choose a reason for hiding this comment

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

@xrajesh I refactored code a bit plus added support for both "llm powered" and manual arguments passing. The generate_ui_component is mean for LLM powered, generate_ui_multiple_components for manual processing. Which tool is available can be controlled by starting NGUI MCP server with the parameter

@xrajesh xrajesh requested review from asamal4 and onmete and removed request for onmete October 8, 2025 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants