Skip to content

Conversation

janEbert
Copy link

TLDR

During confirmation, the arguments to the MCP call can now be expanded using CTRL+s. I'm a bit worried about the interplay with the Command.SHOW_MORE_LINES (in keyBindings.ts), which shares the same keybinding, but was unable to produce a test case.

Reviewer Test Plan

Ask the model to execute any of your configured MCP servers that takes arguments; then press CTRL+s to toggle display of the arguments.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

That is, during confirmation, the arguments to the MCP call can now be
expanded using CTRL+s.

Ref google-gemini#11031.
@janEbert janEbert requested a review from a team as a code owner October 15, 2025 14:35
Copy link
Contributor

Summary of Changes

Hello @janEbert, 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 enhances the CLI's MCP tool call confirmation process by allowing users to inspect the arguments passed to an MCP server. By pressing "Ctrl+S", users can now toggle the detailed JSON view of the arguments, providing greater transparency and control before confirming a tool's execution. This addresses issue #11031, improving the user experience for tool invocation.

Highlights

  • MCP Argument Expansion: Introduced the ability to expand and view arguments for MCP tool calls during the confirmation step in the CLI.
  • Keyboard Shortcut: Implemented "Ctrl+S" as the shortcut to toggle the display of these arguments, which are shown as JSON.
  • Keybinding Conflict Awareness: Acknowledged and handled a potential conflict with the existing "Ctrl+S" binding for "SHOW_MORE_LINES".
  • Documentation Update: Added the new "Ctrl+S" shortcut for tool argument expansion to the keyboard shortcuts documentation.
  • Interface Enhancement: Updated the "ToolMcpConfirmationDetails" interface to include the "args" property, ensuring tool arguments are passed to the confirmation message.
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
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 introduces a useful feature for expanding MCP call arguments during confirmation. Your concern about the keybinding conflict with SHOW_MORE_LINES is valid, as the current implementation introduces a side effect where expanding arguments also expands the entire history view. I've included review comments with suggestions to resolve this issue and improve the overall consistency of the implementation.

Comment on lines 966 to 967
(keyMatchers[Command.SHOW_MORE_LINES](key) ||
keyMatchers[Command.TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION](key)) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

high

You were right to be concerned about the interplay with SHOW_MORE_LINES. As it's currently implemented, when a user presses Ctrl+S in the MCP confirmation dialog, it will correctly toggle the arguments' visibility, but it will also trigger this global key handler, causing setConstrainHeight(false) to be called. This expands the main history view, which is likely an unwanted side effect.

The key press should be handled exclusively by the ToolConfirmationMessage component when it is focused. To fix this, we can remove the check for TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION from this global handler. The useKeypress hook in ToolConfirmationMessage will still capture and handle the event correctly for toggling the arguments.

        keyMatchers[Command.SHOW_MORE_LINES](key) &&

if (!isFocused) return;
if (key.name === 'escape' || (key.ctrl && key.name === 'c')) {
handleConfirm(ToolConfirmationOutcome.Cancel);
} else if (key.ctrl && key.name === 's') {
Copy link
Contributor

Choose a reason for hiding this comment

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

high

To improve consistency and maintainability, it's better to use the centralized keyMatchers for keybinding checks instead of hardcoding the key combination. This ensures that if the keybinding for TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION is ever changed in keyBindings.ts, it will be automatically reflected here. This also makes the purpose of defining the new Command and its keybinding clearer.

You'll also need to add import { keyMatchers, Command } from '../../keyMatchers.js'; at the top of the file.

Suggested change
} else if (key.ctrl && key.name === 's') {
} else if (keyMatchers[Command.TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION](key)) {

Copy link
Contributor

Summary of Changes

Hello @janEbert, 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 introduces a new feature to the CLI that allows users to inspect the arguments passed to an MCP server during the tool call confirmation process. By pressing "Ctrl+S", users can toggle the display of these arguments, providing greater transparency and control before executing a tool. This enhancement aims to improve the user experience by offering more detailed information at a critical decision point.

Highlights

  • MCP Argument Expansion: Users can now expand and view the arguments of an MCP (Multi-Cloud Provider) tool call during the confirmation phase using "Ctrl+S".
  • Keybinding Conflict Awareness: The author noted a potential conflict with the existing "Ctrl+S" keybinding for "SHOW_MORE_LINES", though a test case for this conflict was not produced.
  • Documentation Update: The new keyboard shortcut has been added to the keyboard-shortcuts.md documentation.
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
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 introduces a useful feature for expanding MCP tool call arguments. My review focuses on the keybinding implementation. You correctly identified a potential conflict with the shared CTRL+s shortcut. I've found a logic issue in how this conflict is handled in AppContainer.tsx and a consistency issue in ToolConfirmationMessage.tsx. The suggested changes should resolve the conflict cleanly by isolating the new keybinding's effect to its component and adhering to the project's centralized key-matching pattern.

Comment on lines +87 to 89
} else if (key.ctrl && key.name === 's') {
setIsExpanded((prev) => !prev);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The keypress for toggling argument expansion is hardcoded as key.ctrl && key.name === 's'. This is inconsistent with the rest of the application, which uses a centralized system for managing keybindings (keyBindings.ts) and matching them (keyMatchers.ts). You've already added the TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION command to this system, and it should be used here to maintain consistency and configurability.

You will need to import keyMatchers and Command from ../../keyMatchers.js.

Suggested change
} else if (key.ctrl && key.name === 's') {
setIsExpanded((prev) => !prev);
}
} else if (keyMatchers[Command.TOGGLE_TOOL_CALL_ARGUMENTS_EXPANSION](key)) {
setIsExpanded((prev) => !prev);
}

Copy link
Author

@janEbert janEbert Oct 15, 2025

Choose a reason for hiding this comment

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

This is in line with the if-query in the lines right above the change, which also checks for (key.name === 'escape' || (key.ctrl && key.name === 'c')). Should both occurrences be adapted? If yes, what should the other command(s) be?

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.

Allow expanding MCP call arguments during confirmation

1 participant