modelcontextprotocol / modelcontextprotocol/ext-apps

tools that conditionally return ui resources

Open
#191 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
387
Avg merge
3h 21m
Merged PRs (30d)
6

Description

First off the spec looks great and we are hoping to use parts of it in place of elicitations (which are very cumbersome to use).

For many of our use cases we want the tool to sometimes return a ui resources and sometimes just return to the model. I may be reading it wrong but it doesn't look like conditional rendering of ui resources in a tool response is possible at the moment, can you confirm? it looks as though every response from a tool with a ui resources MUST render that ui resources.

A simple use case that exhibits this would be transferring money - transfer_money(from (checking / savings), to (checking/savings, amount).

The code will enforce rules on ensuring that the user picks a different from and to and that the amount being transferred is less than the balance. None of this requires a widget. However for the final stage we would like to return a widget for confirmation. When the user clicks accept it calls a different tool to confirm the transfer.

Is this possible today? i.e. this conditional return of a ui resource or is it assumed that every time a tool (with a ui resource) is called that the ui resources must be rendered.

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the spec sections covering tool responses and UI resources, then trace the transfer_money and confirmation-tool flow described in the issue. Determine whether a tool can return a UI resource conditionally; done means the supported behavior is confirmed or the required protocol change is clearly specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.