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

Do not remove form on error in tool call tab. #241

Merged
merged 9 commits into from
Apr 1, 2025

Conversation

NicolasMontone
Copy link
Contributor

Now if you have an error in you MCP tool call, do not remove the form

Before:

image

After:

Screen.Recording.2025-04-01.at.10.55.34.mov

Motivation and Context

Before, on each error, you need to select another tool and then come back to the same one, now, you can see the error and continue testing.

How Has This Been Tested?

Yep, I'm building my own MCP, and I made the change to continue my integration, I tested it with another MCP.

Breaking Changes

Nope

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Nope

Copy link
Contributor

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

It is definitely worthwhile that the form doesn't get wiped out, so that you can try again 👍.

However, I question whether we need it to remain persistent. We have a toast that pops with the error, then goes away. The persistent one remains even when you subsequently make changes to the form.

Both displayed when the error happens.

Screenshot 2025-04-01 at 3 34 29 PM

Persistent error not removed after amending form

Screenshot 2025-04-01 at 3 41 13 PM

Maybe the answer is just to not display the error at all in this component and let the toast handle it? I suspect its presence in this component may be a holdover from pre-toast times, but not sure. But I don't see the need for it at all now.

@NicolasMontone
Copy link
Contributor Author

Agree with you, I think that leaving the toast without the Alert is just fine :)

@NicolasMontone
Copy link
Contributor Author

Updated! @cliffhall
image
I removed the alert. I thought that since the project is using shadcn/ui, we could remove react-toastify and instead use the shadcn toast to keep the project consistent. Let me know, and I can create a new PR with that change :

@cliffhall
Copy link
Contributor

Retested, and this looks good.

Screenshot 2025-04-01 at 3 56 08 PM

@cliffhall
Copy link
Contributor

@NicolasMontone Doh, but you need to run Prettier to get past the build.

@NicolasMontone
Copy link
Contributor Author

image seems that now is working! was an issue with the test that was no longer needed.

Copy link
Contributor

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@NicolasMontone NicolasMontone requested a review from cliffhall April 1, 2025 20:03
@cliffhall cliffhall merged commit f9cb2c1 into modelcontextprotocol:main Apr 1, 2025
2 checks passed
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.

2 participants