Skip to content

OLS-2722: olsToolUIs initial support#1576

Draft
iNecas wants to merge 1 commit intoopenshift:mainfrom
iNecas:ols-tool-ui
Draft

OLS-2722: olsToolUIs initial support#1576
iNecas wants to merge 1 commit intoopenshift:mainfrom
iNecas:ols-tool-ui

Conversation

@iNecas
Copy link

@iNecas iNecas commented Mar 2, 2026

Allows plugins to define 'ols.tool-ui' extensions to map the tools to react components to be rendered when the tool gets called.

Sample extensions registration:

{
  "type": "ols.tool-ui",
  "properties": {
    "id": "my-obs/my-tool",
    "component": {
      "$codeRef": "MyToolUI"
    }
  }
}

The ToolUI implemntation receives the tool details in it's argument:

type MyTool = {
  name: 'my-tool';
  args: object,
  // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
  // component implementation
}

Depends on openshift/lightspeed-service#2779

This allows monitoring-plugin to define a UI for obs-mcp tools
image

Related changes leveraging this feature:

@iNecas iNecas marked this pull request as draft March 2, 2026 15:40
@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 Mar 2, 2026
@openshift-ci openshift-ci bot requested review from syedriko and xrajesh March 2, 2026 15:41
@openshift-ci
Copy link

openshift-ci bot commented Mar 2, 2026

[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 xrajesh for approval. For more information see the Code Review Process.

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

Details 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

Allows plugins to define 'ols.tool-ui' extensions to map the tools
to react components to be rendered when the tool gets called.

Sample extensions registration:

```json
{
  "type": "ols.tool-ui",
  "properties": {
    "id": "my-obs/my-tool",
    "component": {
      "$codeRef": "MyToolUI"
    }
  }
}
```

The ToolUI implemntation receives the tool details in it's argument:

```ts
type MyTool = {
  name: 'my-tool';
  args: object,
  // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
  // component implementation
}
```
@iNecas iNecas changed the title olsToolUIs initial support OLS-2722: olsToolUIs initial support Mar 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 6, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 6, 2026

@iNecas: This pull request references OLS-2722 which is a valid jira issue.

Details

In response to this:

Allows plugins to define 'ols.tool-ui' extensions to map the tools to react components to be rendered when the tool gets called.

Sample extensions registration:

{
 "type": "ols.tool-ui",
 "properties": {
   "id": "my-obs/my-tool",
   "component": {
     "$codeRef": "MyToolUI"
   }
 }
}

The ToolUI implemntation receives the tool details in it's argument:

type MyTool = {
 name: 'my-tool';
 args: object,
 // ...
};

export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
 // component implementation
}

Depends on openshift/lightspeed-service#2779

This allows monitoring-plugin to define a UI for obs-mcp tools
image

Related changes leveraging this feature:

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Member

@kyoto kyoto left a comment

Choose a reason for hiding this comment

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

Looks good @iNecas. Thanks!

Just 2 minor comments and could you please run npm run lint-fix to address the lint errors and rebase?

import type { OlsToolUIComponent } from '../types';

type ToolUIExtensionProperties = {
/** Id of the component (as refferrenced by the mcp tool) */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** Id of the component (as refferrenced by the mcp tool) */
/** ID of the component (as referenced by the MCP tool) */

Comment on lines +13 to +16
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => {
const ToolComponent = toolUIElement;
return <ToolComponent tool={tool} />;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => {
const ToolComponent = toolUIElement;
return <ToolComponent tool={tool} />;
};
export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: ToolComponent }) => {
return <ToolComponent tool={tool} />;
};

@kyoto
Copy link
Member

kyoto commented Mar 17, 2026

Also, we should add a brief description of how to use this extension to the README

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2026
@openshift-merge-robot
Copy link

PR needs rebase.

Details

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.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants