Skip to content

Fix MCP interface description not updating in studio#32341

Open
shirsenduda wants to merge 3 commits intolanggenius:mainfrom
shirsenduda:fix/mcp-interface-description
Open

Fix MCP interface description not updating in studio#32341
shirsenduda wants to merge 3 commits intolanggenius:mainfrom
shirsenduda:fix/mcp-interface-description

Conversation

@shirsenduda
Copy link
Copy Markdown

@shirsenduda shirsenduda commented Feb 15, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 15, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Feb 15, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shirsenduda, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the MCP (Managed Custom Plugin) interface descriptions were not updating correctly in the studio. The fix involves implementing a global cache invalidation mechanism for all MCP tools whenever an update occurs, ensuring that the user interface consistently displays the most current information.

Highlights

  • Global Cache Invalidation: Introduced and utilized a new useInvalidateAllMCPTools hook to ensure that the cache for all MCP tools is globally invalidated after an update operation, resolving issues with outdated interface descriptions.
  • Component Logic Update: Integrated the global cache invalidation into the MCPDetailContent component's handleUpdateTools function, ensuring that UI updates correctly reflect the latest changes.
  • Test Coverage: Updated unit tests for MCPDetailContent to include mocking and clearing of the new useInvalidateAllMCPTools hook, maintaining test integrity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/app/components/tools/mcp/detail/tests/content.spec.tsx
    • Added a mock for the useInvalidateAllMCPTools hook.
    • Included the new mock in the vi.mock setup for @/service/use-tools.
    • Ensured the mockInvalidateAllMCPTools is cleared in the afterEach test hook.
  • web/app/components/tools/mcp/detail/content.tsx
    • Imported the useInvalidateAllMCPTools hook.
    • Instantiated invalidateAllMCPTools using the new hook.
    • Called invalidateAllMCPTools() within the handleUpdateTools function to trigger global cache invalidation.
    • Added invalidateAllMCPTools to the dependency array of the handleUpdateTools useCallback hook.
Activity
  • The author confirmed understanding that the PR may be closed if there was no previous discussion.
  • The author confirmed adding a test for each introduced change.
  • The author confirmed updating the documentation accordingly.
  • The author confirmed running make lint and make type-check (backend) and cd web && npx lint-staged (frontend).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where the MCP interface description failed to update in the studio. The fix correctly introduces a call to invalidateAllMCPTools within the handleUpdateTools function. This ensures that the list of all MCP tools is refetched after an update, which should resolve the stale description issue. The necessary changes to support this in the component and its tests (adding mocks) have been made. Overall, the approach is sound and the implementation is clean. I have one suggestion to improve test coverage.

Comment thread web/app/components/tools/mcp/detail/__tests__/content.spec.tsx
@shirsenduda
Copy link
Copy Markdown
Author

All tasks completed, CI is green. Ready for review when you have time! Thanks.

1 similar comment
@shirsenduda
Copy link
Copy Markdown
Author

All tasks completed, CI is green. Ready for review when you have time! Thanks.

@shirsenduda
Copy link
Copy Markdown
Author

Hi team! 👋 Branch is up to date with main, bot review was positive, and all suggestions are resolved.

Could someone please approve the CI workflow run? This is my first contribution to this repo so the checks need maintainer approval to execute.

Ready for review whenever you have time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant