Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance tool call input #130

Open
isaacwasserman opened this issue Jan 22, 2025 · 6 comments
Open

Enhance tool call input #130

isaacwasserman opened this issue Jan 22, 2025 · 6 comments
Labels
enhancement New feature or request

Comments

@isaacwasserman
Copy link

Is your feature request related to a problem? Please describe.
Tools with complex object input schemas can be difficult to work with because we're only given a <textarea/> in the UI.

Describe the solution you'd like
Provide a JSON editor component, rather than a textarea for object inputs. This component could be pre-populated with the fields of the input schema.

Describe alternatives you've considered

  1. Alternatively, object properties could be expanded into multiple inputs up to a reasonable depth.
  2. At the very least, the textarea could have a default value that provides the JSON structure required by the schema.
@isaacwasserman isaacwasserman added the enhancement New feature or request label Jan 22, 2025
@olaservo
Copy link
Collaborator

I added a draft approach here for the maintainers to review, let me know what you think: #136

@WAY29
Copy link

WAY29 commented Feb 14, 2025

+1, need more complex tool call input

@olaservo
Copy link
Collaborator

I updated my original PR to add a JSON editing component in order to resolve conflicts and took it out of draft: #136

Still working on providing an updated version of the Everything server to help test more complex inputs.

@olaservo
Copy link
Collaborator

A few enhancements were merged this AM. Please take a look at the latest from main and let me know if you have any suggestions for further improvements!

@WAY29
Copy link

WAY29 commented Feb 20, 2025

A few enhancements were merged this AM. Please take a look at the latest from main and let me know if you have any suggestions for further improvements!

hi, maybe something like array is not corret. here is an object-array example:

{
  "type": "object",
  "properties": {
    "test": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "default": "aaa"
          }
        }
      }
    }
  }
}

In mcp inspector it is a string input box:

Image

Expect the following effects:

Image

@olaservo
Copy link
Collaborator

olaservo commented Mar 5, 2025

A couple updates on related changes:

@kshern was awesome and added more robust array handling in this PR: #157

There are still some open issues I noticed when it comes to editing object fields, and there's also this open issue with handling fields that are supposed to be integers: #154

I have an open PR here tp address both of those, and since the tool input logic is starting to get pretty complicated I also started adding automated tests: #159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants