Skip to content

Conversation

jakemac53
Copy link
Collaborator

TLDR

Checks MCP tool parameter schemas to ensure all properties have a specified type.

If they don't then we skip adding the tool, and emit a warning asking the user to file an issue on the MCP Server implementation.

Dive Deeper

Gemini function calling requires types on all schema properties, and if this is not the case then all requests will error out making the entire CLI unusable. It is best to pre-emptively skip these tools in this case since we know they will fail.

It is not actually clear to me if MCP itself allows un-typed parameters from the spec. But either way, Gemini does not.

Reviewer Test Plan

You can connect to a known MCP server that omits types, and should see a message on startup about the skipped tool. I just created my own, but awslabs/mcp#661 has a real one you could try installing and connecting.

Testing Matrix

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

Linked issues / bugs

Fixes #4594

@jakemac53 jakemac53 requested a review from jacob314 August 6, 2025 17:42
@jakemac53 jakemac53 requested a review from a team as a code owner August 6, 2025 17:42
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.

Summary of Changes

Hello @jakemac53, 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!

I've implemented a crucial enhancement to our tool discovery process. This change addresses an issue where MCP tools with untyped parameters in their schemas could cause failures with Gemini function calling. My solution now proactively validates the parameter schemas of discovered MCP tools, ensuring all properties have explicit types. If a tool's schema is found to be invalid, it will be automatically omitted from the available tools, and a warning will be logged to guide users to report the issue to the MCP server owner. This improves the robustness and usability of our CLI by preventing runtime errors caused by malformed tool definitions.

Highlights

  • Robust Schema Validation: I've introduced a new utility function, "hasValidTypes", which recursively checks JSON schemas to ensure all properties and array items have a "type" defined.
  • Proactive Tool Omission: During the "discoverTools" process, any MCP tool whose parameter schema fails the "hasValidTypes" validation will now be automatically skipped.
  • Informative User Warnings: When a tool is skipped due to a malformed schema, a clear warning message is displayed to the user, instructing them to file an issue with the MCP server owner.
  • Comprehensive Test Coverage: I've added several new unit tests to "mcp-client.test.ts" to verify the correct behavior of tool skipping for various invalid schema configurations (missing types at top-level, nested, and within arrays), as well as confirming valid schemas are still processed.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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 validation mechanism to detect and omit MCP tools that have invalid parameter schemas, specifically when a type property is missing. This is a valuable addition to prevent runtime errors with the Gemini API. The implementation is solid, but I've identified a potential issue in the hasValidTypes function where it doesn't validate schemas within composition keywords like anyOf, allOf, or oneOf. I've included a suggestion to address this. The tests are comprehensive and cover the intended functionality well.

Copy link

github-actions bot commented Aug 6, 2025

Code Coverage Summary

Package Lines Statements Functions Branches
CLI 73.63% 73.63% 80.44% 81.06%
Core 73.07% 73.07% 73.46% 82.42%
CLI Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   73.63 |    81.06 |   80.44 |   73.63 |                   
 src               |   51.76 |    72.54 |      60 |   51.76 |                   
  gemini.tsx       |   28.71 |    55.55 |   42.85 |   28.71 | ...94-307,319-376 
  ...ractiveCli.ts |   93.33 |    71.42 |     100 |   93.33 | ...,72-74,120,123 
  ...ActiveAuth.ts |     100 |      100 |     100 |     100 |                   
 src/acp           |    1.71 |        0 |       0 |    1.71 |                   
  acp.ts           |    2.79 |        0 |       0 |    2.79 | ...98-225,228-271 
  acpPeer.ts       |    1.38 |        0 |       0 |    1.38 | 33-48,51-677      
 src/commands      |   94.11 |      100 |      50 |   94.11 |                   
  mcp.ts           |   94.11 |      100 |      50 |   94.11 | 26                
 src/commands/mcp  |   95.49 |    80.43 |    90.9 |   95.49 |                   
  add.ts           |   97.26 |    85.71 |     100 |   97.26 | 109-112,119       
  list.ts          |   90.56 |    80.76 |      80 |   90.56 | ...10-112,137-138 
  remove.ts        |     100 |    66.66 |     100 |     100 | 19-23             
 src/config        |   87.03 |    78.13 |   84.84 |   87.03 |                   
  auth.ts          |     100 |      100 |     100 |     100 |                   
  config.ts        |   97.13 |    83.09 |   66.66 |   97.13 | ...83,330,492-496 
  extension.ts     |   82.53 |    84.37 |     100 |   82.53 | ...99-103,112-113 
  sandboxConfig.ts |   51.35 |    16.66 |   66.66 |   51.35 | ...43,53-69,74-91 
  settings.ts      |   82.71 |    76.47 |   93.33 |   82.71 | ...53-454,501-502 
 src/generated     |     100 |      100 |     100 |     100 |                   
  git-commit.ts    |     100 |      100 |     100 |     100 |                   
 src/patches       |       0 |        0 |       0 |       0 |                   
  is-in-ci.ts      |       0 |        0 |       0 |       0 | 1-17              
 src/services      |   61.08 |    88.13 |   72.22 |   61.08 |                   
  ...mandLoader.ts |     100 |      100 |     100 |     100 |                   
  ...andService.ts |     100 |      100 |     100 |     100 |                   
  ...mandLoader.ts |   92.09 |    91.89 |     100 |   92.09 | 176-181,250-257   
  ...omptLoader.ts |    9.39 |    57.14 |   33.33 |    9.39 | ...44-167,173-230 
  types.ts         |       0 |        0 |       0 |       0 | 1                 
 ...mpt-processors |   95.18 |    94.73 |     100 |   95.18 |                   
  ...tProcessor.ts |     100 |      100 |     100 |     100 |                   
  ...lProcessor.ts |   93.54 |    92.85 |     100 |   93.54 | 67-70             
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/test-utils    |   90.38 |    81.81 |      75 |   90.38 |                   
  ...omMatchers.ts |   69.69 |       50 |      50 |   69.69 | 30-33,35-37,43-45 
  ...andContext.ts |     100 |      100 |     100 |     100 |                   
 src/ui            |   61.25 |    68.36 |      68 |   61.25 |                   
  App.tsx          |    58.2 |    62.19 |      50 |    58.2 | ...1009,1034-1063 
  colors.ts        |   87.75 |      100 |      80 |   87.75 | 12-13,18-19,48-49 
  constants.ts     |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/commands   |   87.43 |     85.3 |      90 |   87.43 |                   
  aboutCommand.ts  |     100 |    55.55 |     100 |     100 | 23-30             
  authCommand.ts   |     100 |      100 |     100 |     100 |                   
  bugCommand.ts    |   78.46 |    42.85 |     100 |   78.46 | 32-35,72-81       
  chatCommand.ts   |    93.6 |    84.44 |     100 |    93.6 | ...83-184,186-187 
  clearCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...essCommand.ts |     100 |    88.88 |     100 |     100 | 69                
  copyCommand.ts   |     100 |      100 |     100 |     100 |                   
  corgiCommand.ts  |     100 |      100 |     100 |     100 |                   
  ...ryCommand.tsx |   70.48 |       72 |     100 |   70.48 | ...22-123,160-168 
  docsCommand.ts   |     100 |      100 |     100 |     100 |                   
  editorCommand.ts |     100 |      100 |     100 |     100 |                   
  ...onsCommand.ts |     100 |      100 |     100 |     100 |                   
  helpCommand.ts   |     100 |      100 |     100 |     100 |                   
  ideCommand.ts    |   70.44 |       90 |   57.14 |   70.44 | ...42-152,160-170 
  initCommand.ts   |     100 |      100 |     100 |     100 |                   
  mcpCommand.ts    |   82.21 |    82.95 |   83.33 |   82.21 | ...83-384,434-441 
  memoryCommand.ts |   99.09 |    92.85 |     100 |   99.09 | 93                
  ...acyCommand.ts |     100 |      100 |     100 |     100 |                   
  quitCommand.ts   |     100 |      100 |     100 |     100 |                   
  ...oreCommand.ts |   93.79 |    91.42 |     100 |   93.79 | 54-55,84-89       
  ...hubCommand.ts |   92.59 |       80 |     100 |   92.59 | 34-37             
  statsCommand.ts  |   84.48 |       75 |     100 |   84.48 | 24-32             
  themeCommand.ts  |     100 |      100 |     100 |     100 |                   
  toolsCommand.ts  |     100 |      100 |     100 |     100 |                   
  types.ts         |     100 |      100 |     100 |     100 |                   
  vimCommand.ts    |   44.44 |      100 |       0 |   44.44 | 14-24             
 src/ui/components |   64.31 |    81.42 |   64.28 |   64.31 |                   
  AboutBox.tsx     |     100 |       50 |     100 |     100 | 102               
  AsciiArt.ts      |     100 |      100 |     100 |     100 |                   
  AuthDialog.tsx   |   89.78 |    96.42 |   66.66 |   89.78 | 68-73,102-109     
  ...nProgress.tsx |   15.78 |      100 |       0 |   15.78 | 17-57             
  ...Indicator.tsx |   15.15 |      100 |       0 |   15.15 | 17-47             
  ...ryDisplay.tsx |   89.47 |    33.33 |     100 |   89.47 | 20-21             
  ...ryDisplay.tsx |   91.25 |    94.87 |     100 |   91.25 | 75-80,100         
  ...gProfiler.tsx |    23.8 |      100 |       0 |    23.8 | 12-32             
  ...esDisplay.tsx |   10.52 |      100 |       0 |   10.52 | 24-82             
  ...ngsDialog.tsx |    6.76 |      100 |       0 |    6.76 | 26-168            
  Footer.tsx       |   73.33 |    16.66 |     100 |   73.33 | ...,87-90,108-115 
  ...ngSpinner.tsx |      80 |    33.33 |     100 |      80 | 29,31-32          
  Header.tsx       |    17.5 |      100 |       0 |    17.5 | 22-62             
  Help.tsx         |    3.27 |      100 |       0 |    3.27 | 17-173            
  ...emDisplay.tsx |      70 |    56.25 |     100 |      70 | ...59-64,84-91,94 
  ...ilDisplay.tsx |    14.7 |      100 |       0 |    14.7 | 18-51             
  InputPrompt.tsx  |   86.02 |    80.68 |     100 |   86.02 | ...28-430,524-528 
  ...Indicator.tsx |     100 |      100 |     100 |     100 |                   
  ...geDisplay.tsx |   25.92 |      100 |       0 |   25.92 | 14-36             
  ...tsDisplay.tsx |     100 |      100 |     100 |     100 |                   
  PrepareLabel.tsx |      60 |       80 |     100 |      60 | 35-48             
  ...ryDisplay.tsx |     100 |      100 |     100 |     100 |                   
  ...ionDialog.tsx |   85.93 |      100 |      50 |   85.93 | 34-36,40-47       
  ...Indicator.tsx |   44.44 |      100 |       0 |   44.44 | 12-17             
  ...MoreLines.tsx |      60 |       25 |     100 |      60 | 24-27,33-40       
  StatsDisplay.tsx |   98.39 |    86.66 |     100 |   98.39 | 173-175           
  ...nsDisplay.tsx |   88.05 |    71.42 |     100 |   88.05 | 36-41,96-98       
  ThemeDialog.tsx  |    4.29 |      100 |       0 |    4.29 | 29-316            
  Tips.tsx         |      16 |      100 |       0 |      16 | 17-45             
  ...tsDisplay.tsx |     100 |     87.5 |     100 |     100 | 30-31             
  ...ification.tsx |   36.36 |      100 |       0 |   36.36 | 15-22             
 ...nents/messages |   63.09 |     81.3 |      60 |   63.09 |                   
  ...onMessage.tsx |   18.51 |      100 |       0 |   18.51 | 22-49             
  DiffRenderer.tsx |   96.18 |    81.92 |     100 |   96.18 | ...16-217,221,283 
  ErrorMessage.tsx |     100 |      100 |     100 |     100 |                   
  ...niMessage.tsx |   18.51 |      100 |       0 |   18.51 | 20-43             
  ...geContent.tsx |   19.04 |      100 |       0 |   19.04 | 25-43             
  InfoMessage.tsx  |     100 |      100 |     100 |     100 |                   
  ...onMessage.tsx |   35.15 |     62.5 |      25 |   35.15 | ...62-197,236-264 
  ...upMessage.tsx |   10.11 |      100 |       0 |   10.11 | 27-126            
  ToolMessage.tsx  |   87.76 |       80 |     100 |   87.76 | ...,91-95,169-171 
  UserMessage.tsx  |     100 |      100 |     100 |     100 |                   
  ...llMessage.tsx |   36.36 |      100 |       0 |   36.36 | 17-25             
 ...ponents/shared |    79.2 |    74.01 |   94.59 |    79.2 |                   
  MaxSizedBox.tsx  |   80.66 |    81.19 |   88.88 |   80.66 | ...08-509,614-615 
  ...tonSelect.tsx |   66.66 |    65.51 |     100 |   66.66 | ...15,119-155,224 
  text-buffer.ts   |   76.36 |       75 |   95.83 |   76.36 | ...1611,1651,1701 
  ...er-actions.ts |   86.39 |    65.76 |     100 |   86.39 | ...75-578,883-885 
 src/ui/contexts   |   86.95 |    78.57 |     100 |   86.95 |                   
  ...owContext.tsx |   91.07 |    81.81 |     100 |   91.07 | 46-47,59-61       
  ...onContext.tsx |   94.11 |      100 |     100 |   94.11 | 101-104           
  ...ngContext.tsx |   71.42 |       50 |     100 |   71.42 | 17-20             
  ...deContext.tsx |   76.08 |       50 |     100 |   76.08 | 46-47,51-58,76-77 
 src/ui/editors    |   93.18 |    85.71 |   66.66 |   93.18 |                   
  ...ngsManager.ts |   93.18 |    85.71 |   66.66 |   93.18 | 48,62-63          
 src/ui/hooks      |   80.88 |    82.53 |   84.61 |   80.88 |                   
  ...dProcessor.ts |    78.4 |       79 |     100 |    78.4 | ...55-458,469-487 
  ...dProcessor.ts |   95.52 |    69.23 |     100 |   95.52 | ...17-218,223-224 
  ...dProcessor.ts |   86.44 |       72 |     100 |   86.44 | ...52-353,355-359 
  ...Completion.ts |   92.73 |    89.47 |     100 |   92.73 | ...85-186,219-222 
  ...uthCommand.ts |    7.46 |      100 |       0 |    7.46 | 18-92             
  ...tIndicator.ts |     100 |      100 |     100 |     100 |                   
  ...ketedPaste.ts |     100 |      100 |     100 |     100 |                   
  ...ompletion.tsx |   94.73 |    81.81 |     100 |   94.73 | ...98-199,201-202 
  useCompletion.ts |    92.4 |     87.5 |     100 |    92.4 | ...,95-96,100-101 
  ...leMessages.ts |   98.68 |       95 |     100 |   98.68 | 55                
  ...orSettings.ts |     100 |      100 |     100 |     100 |                   
  useFocus.ts      |     100 |      100 |     100 |     100 |                   
  ...miniStream.ts |   73.27 |    72.02 |     100 |   73.27 | ...25-826,856-946 
  ...BranchName.ts |   91.66 |    84.61 |     100 |   91.66 | 57-63             
  ...oryManager.ts |   98.41 |    93.33 |     100 |   98.41 | 43                
  ...putHistory.ts |    92.5 |    85.71 |     100 |    92.5 | 62-63,71,93-95    
  useKeypress.ts   |     100 |      100 |     100 |     100 |                   
  ...gIndicator.ts |     100 |      100 |     100 |     100 |                   
  useLogger.ts     |      25 |      100 |       0 |      25 | 14-32             
  ...raseCycler.ts |   95.42 |       75 |     100 |   95.42 | ...63-164,182-184 
  ...cySettings.ts |     3.6 |      100 |       0 |     3.6 | 18-139            
  ...lScheduler.ts |   78.92 |    94.44 |     100 |   78.92 | ...01-204,290-300 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-7               
  ...ompletion.tsx |     100 |     92.3 |     100 |     100 | 78                
  ...ellHistory.ts |   91.26 |       80 |     100 |   91.26 | ...67,112-113,123 
  ...oryCommand.ts |       0 |        0 |       0 |       0 | 1-75              
  ...Completion.ts |      94 |    92.53 |     100 |      94 | 58-61,69-72,93    
  ...tateAndRef.ts |   59.09 |      100 |     100 |   59.09 | 23-31             
  ...rminalSize.ts |   77.27 |      100 |      50 |   77.27 | 19-23             
  ...emeCommand.ts |   46.98 |       75 |     100 |   46.98 | ...4,70-71,77-100 
  useTimer.ts      |   88.09 |    85.71 |     100 |   88.09 | 44-45,51-53       
  vim.ts           |   83.57 |     79.5 |     100 |   83.57 | ...38,742-750,759 
 src/ui/privacy    |   13.77 |      100 |       0 |   13.77 |                   
  ...acyNotice.tsx |    9.58 |      100 |       0 |    9.58 | 20-113            
  ...acyNotice.tsx |    12.9 |      100 |       0 |    12.9 | 15-55             
  ...acyNotice.tsx |   10.81 |      100 |       0 |   10.81 | 15-58             
  ...acyNotice.tsx |   30.76 |      100 |       0 |   30.76 | 19-36,39-41       
 src/ui/themes     |   99.61 |    92.13 |     100 |   99.61 |                   
  ansi-light.ts    |     100 |      100 |     100 |     100 |                   
  ansi.ts          |     100 |      100 |     100 |     100 |                   
  atom-one-dark.ts |     100 |      100 |     100 |     100 |                   
  ayu-light.ts     |     100 |      100 |     100 |     100 |                   
  ayu.ts           |     100 |      100 |     100 |     100 |                   
  color-utils.ts   |     100 |      100 |     100 |     100 |                   
  default-light.ts |     100 |      100 |     100 |     100 |                   
  default.ts       |     100 |      100 |     100 |     100 |                   
  dracula.ts       |     100 |      100 |     100 |     100 |                   
  github-dark.ts   |     100 |      100 |     100 |     100 |                   
  github-light.ts  |     100 |      100 |     100 |     100 |                   
  googlecode.ts    |     100 |      100 |     100 |     100 |                   
  no-color.ts      |     100 |      100 |     100 |     100 |                   
  ...-of-purple.ts |     100 |      100 |     100 |     100 |                   
  theme-manager.ts |    93.5 |    82.92 |     100 |    93.5 | ...82,186,211-212 
  theme.ts         |     100 |      100 |     100 |     100 |                   
  xcode.ts         |     100 |      100 |     100 |     100 |                   
 src/ui/utils      |   77.58 |    86.11 |   98.18 |   77.58 |                   
  ...Colorizer.tsx |    77.3 |    77.77 |     100 |    77.3 | ...48-151,185-209 
  ...olePatcher.ts |   95.74 |       75 |     100 |   95.74 | 56-57             
  ...nRenderer.tsx |   26.51 |       75 |     100 |   26.51 | 32-137            
  ...wnDisplay.tsx |   86.19 |    87.69 |     100 |   86.19 | ...71-279,311-332 
  ...eRenderer.tsx |   78.09 |    76.19 |     100 |   78.09 | 55-83             
  ...boardUtils.ts |   32.25 |     37.5 |     100 |   32.25 | ...55-114,129-145 
  commandUtils.ts  |   96.36 |    90.47 |     100 |   96.36 | 68,72             
  computeStats.ts  |     100 |      100 |     100 |     100 |                   
  displayUtils.ts  |     100 |      100 |     100 |     100 |                   
  errorParsing.ts  |     100 |     92.5 |     100 |     100 | 74,78,84          
  formatters.ts    |   90.47 |    95.83 |     100 |   90.47 | 57-60             
  ...nUtilities.ts |   69.84 |    85.71 |     100 |   69.84 | 75-91,100-101     
  textUtils.ts     |   66.66 |      100 |      75 |   66.66 | 13-18             
  updateCheck.ts   |     100 |    80.95 |     100 |     100 | 26-38             
 src/utils         |   31.74 |    90.32 |      70 |   31.74 |                   
  cleanup.ts       |      64 |    66.66 |   66.66 |      64 | 18-26,35          
  events.ts        |     100 |      100 |     100 |     100 |                   
  gitUtils.ts      |   84.61 |       50 |     100 |   84.61 | 24-25             
  ...AutoUpdate.ts |   81.14 |    95.23 |   66.66 |   81.14 | 85-99,125-132     
  ...lationInfo.ts |     100 |      100 |     100 |     100 |                   
  package.ts       |   88.88 |       80 |     100 |   88.88 | 33-34             
  readStdin.ts     |    3.44 |      100 |       0 |    3.44 | 7-39              
  resolvePath.ts   |   66.66 |       25 |     100 |   66.66 | 12-13,16,18-19    
  sandbox.ts       |       0 |        0 |       0 |       0 | 1-920             
  spawnWrapper.ts  |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |   23.07 |      100 |       0 |   23.07 | 14-40             
  ...entEmitter.ts |     100 |      100 |     100 |     100 |                   
  ...upWarnings.ts |     100 |      100 |     100 |     100 |                   
  version.ts       |     100 |       50 |     100 |     100 | 11                
-------------------|---------|----------|---------|---------|-------------------
Core Package - Full Text Report
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   73.07 |    82.42 |   73.46 |   73.07 |                   
 src               |     100 |      100 |     100 |     100 |                   
  index.ts         |     100 |      100 |     100 |     100 |                   
 src/__mocks__/fs  |     100 |      100 |     100 |     100 |                   
  promises.ts      |     100 |      100 |     100 |     100 |                   
 src/code_assist   |   70.47 |    73.52 |   71.05 |   70.47 |                   
  codeAssist.ts    |   18.51 |      100 |       0 |   18.51 | 13-35             
  converter.ts     |   89.23 |    96.15 |   81.81 |   89.23 | 179-183,202-212   
  oauth2.ts        |   75.23 |     61.7 |      80 |   75.23 | ...03-409,416-417 
  server.ts        |    50.6 |       80 |   53.84 |    50.6 | ...73-214,217-219 
  setup.ts         |   73.77 |     62.5 |     100 |   73.77 | 57-58,69-71,83-93 
  types.ts         |     100 |      100 |     100 |     100 |                   
 src/config        |   73.78 |     82.5 |   46.66 |   73.78 |                   
  config.ts        |   73.51 |     82.5 |   46.66 |   73.51 | ...86-693,699-700 
  models.ts        |     100 |      100 |     100 |     100 |                   
 src/core          |   71.83 |    76.48 |   75.49 |   71.83 |                   
  client.ts        |   72.45 |    75.89 |   71.42 |   72.45 | ...01,803-804,807 
  ...tGenerator.ts |   91.95 |    78.26 |     100 |   91.95 | 81-82,134,145-148 
  ...lScheduler.ts |   66.66 |    68.96 |   83.33 |   66.66 | ...99-806,809-819 
  geminiChat.ts    |    59.2 |       72 |      60 |    59.2 | ...50-658,692-715 
  geminiRequest.ts |     100 |      100 |     100 |     100 |                   
  logger.ts        |   84.79 |    82.05 |     100 |   84.79 | ...60-261,277-281 
  modelCheck.ts    |   23.52 |       50 |     100 |   23.52 | 31-75             
  ...olExecutor.ts |   99.11 |    57.14 |     100 |   99.11 | 107               
  prompts.ts       |   95.76 |    96.96 |      50 |   95.76 | 37-38,304-361     
  tokenLimits.ts   |   14.28 |      100 |       0 |   14.28 | 15-32             
  turn.ts          |   83.45 |    83.33 |     100 |   83.45 | ...55-258,271-272 
 src/ide           |   41.73 |    75.75 |      50 |   41.73 |                   
  detect-ide.ts    |    42.1 |    66.66 |      50 |    42.1 | 12-21,25-26       
  ide-client.ts    |   19.58 |    83.33 |   17.64 |   19.58 | ...33-282,285-311 
  ide-installer.ts |   49.58 |     62.5 |     100 |   49.58 | ...,83-84,106-146 
  ideContext.ts    |   83.65 |      100 |     100 |   83.65 | 74-90             
 src/mcp           |   73.81 |    78.94 |   76.31 |   73.81 |                   
  ...h-provider.ts |   83.01 |      100 |   33.33 |   83.01 | ...69,73,77,81-82 
  ...h-provider.ts |   77.05 |    65.62 |      90 |   77.05 | ...62-664,669-671 
  ...en-storage.ts |     100 |      100 |     100 |     100 |                   
  oauth-utils.ts   |   42.85 |     87.5 |      80 |   42.85 | ...32-192,216-252 
 src/prompts       |   22.64 |      100 |    12.5 |   22.64 |                   
  mcp-prompts.ts   |   18.18 |      100 |       0 |   18.18 | 11-19             
  ...t-registry.ts |    23.8 |      100 |   14.28 |    23.8 | ...55,61-62,68-73 
 src/services      |   94.16 |    94.77 |   86.48 |   94.16 |                   
  ...eryService.ts |   93.33 |    88.46 |   85.71 |   93.33 | 31,39,84,109-110  
  gitService.ts    |   77.52 |      100 |      60 |   77.52 | ...08-112,115-119 
  ...ionService.ts |   99.22 |    96.77 |     100 |   99.22 | 282-283           
  ...ionService.ts |   96.03 |    93.75 |     100 |   96.03 | 132-134,195-196   
 src/telemetry     |   64.32 |    82.14 |   69.69 |   64.32 |                   
  constants.ts     |     100 |      100 |     100 |     100 |                   
  ...-exporters.ts |   26.47 |      100 |       0 |   26.47 | ...80,83-84,87-88 
  index.ts         |     100 |      100 |     100 |     100 |                   
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-62              
  ...t.circular.ts |       0 |        0 |       0 |       0 | 1-125             
  loggers.ts       |   67.85 |    79.16 |   69.23 |   67.85 | ...41-359,362-380 
  metrics.ts       |   60.36 |    95.65 |    62.5 |   60.36 | ...36-158,161-184 
  sdk.ts           |   76.72 |    28.57 |     100 |   76.72 | ...33,141-142,148 
  types.ts         |   76.49 |    88.46 |   77.27 |   76.49 | ...02-311,319-328 
  uiTelemetry.ts   |   99.24 |    95.83 |     100 |   99.24 | 122               
 ...learcut-logger |   76.93 |    70.83 |   65.38 |   76.93 |                   
  ...cut-logger.ts |    75.9 |    70.21 |      68 |    75.9 | ...18-619,623-625 
  ...tadata-key.ts |    86.2 |      100 |       0 |    86.2 | 203-213           
 src/test-utils    |   98.41 |     90.9 |     100 |   98.41 |                   
  ...aceContext.ts |     100 |      100 |     100 |     100 |                   
  tools.ts         |   97.77 |     87.5 |     100 |   97.77 | 61                
 src/tools         |   66.62 |     81.2 |   72.94 |   66.62 |                   
  diffOptions.ts   |     100 |      100 |     100 |     100 |                   
  edit.ts          |   80.67 |    85.13 |      75 |   80.67 | ...81-482,486-521 
  glob.ts          |   83.33 |    76.08 |   83.33 |   83.33 | ...05-306,314-321 
  grep.ts          |   60.23 |    82.89 |   72.72 |   60.23 | ...77-582,587-591 
  ls.ts            |   96.66 |    90.16 |     100 |   96.66 | 126-127,205-209   
  mcp-client.ts    |   29.58 |    80.76 |      30 |   29.58 | ...1150,1154-1157 
  mcp-tool.ts      |   93.59 |    91.22 |   92.85 |   93.59 | 84-94,206-207     
  memoryTool.ts    |   84.19 |    82.97 |   86.66 |   84.19 | ...23-338,376-394 
  ...iable-tool.ts |     100 |    84.61 |     100 |     100 | 94,101            
  read-file.ts     |   96.72 |    92.85 |   77.77 |   96.72 | 65-66,69-70       
  ...many-files.ts |   80.49 |       70 |      80 |   80.49 | ...82-583,590-591 
  shell.ts         |    80.9 |    71.42 |   85.71 |    80.9 | ...50-352,354-355 
  tool-error.ts    |     100 |      100 |     100 |     100 |                   
  tool-registry.ts |   55.05 |    76.27 |   76.47 |   55.05 | ...61-366,450-451 
  tools.ts         |   81.12 |    88.23 |   63.15 |   81.12 | ...99-400,416-422 
  web-fetch.ts     |   31.06 |    68.42 |   66.66 |   31.06 | ...92-193,221-359 
  web-search.ts    |   26.72 |      100 |      40 |   26.72 | ...04-105,108-197 
  write-file.ts    |   81.87 |    78.94 |   88.88 |   81.87 | ...30-335,397-427 
 src/utils         |   83.81 |    85.38 |   87.57 |   83.81 |                   
  LruCache.ts      |   70.96 |     62.5 |     100 |   70.96 | 20-22,28,30-34    
  bfsFileSearch.ts |   89.02 |    90.47 |     100 |   89.02 | 86-94             
  browser.ts       |    8.69 |      100 |       0 |    8.69 | 17-53             
  editCorrector.ts |   77.35 |    61.11 |   91.66 |   77.35 | ...70-682,716,730 
  editor.ts        |   97.63 |    94.54 |     100 |   97.63 | 154,224,227-228   
  ...rReporting.ts |   83.72 |    84.61 |     100 |   83.72 | 82-86,107-115     
  errors.ts        |   39.02 |       60 |      75 |   39.02 | 21-25,41-57,61-67 
  fetch.ts         |   34.04 |      100 |       0 |   34.04 | 22-27,31-57       
  fileUtils.ts     |    93.4 |    89.15 |     100 |    93.4 | ...67-271,354-360 
  formatters.ts    |   54.54 |       50 |     100 |   54.54 | 12-16             
  ...eUtilities.ts |   96.03 |    95.83 |     100 |   96.03 | 28-29,57-58       
  ...rStructure.ts |   95.96 |    94.93 |     100 |   95.96 | ...14-117,345-347 
  ...noreParser.ts |     100 |    89.47 |     100 |     100 | 27,47             
  gitUtils.ts      |   51.21 |     90.9 |      50 |   51.21 | 40-41,50-73       
  ...yDiscovery.ts |   87.31 |    76.92 |   77.77 |   87.31 | ...33-334,337-338 
  ...tProcessor.ts |   93.68 |    88.75 |   84.61 |   93.68 | ...80-281,384-385 
  ...Inspectors.ts |     100 |      100 |     100 |     100 |                   
  ...kerChecker.ts |   83.51 |    83.33 |     100 |   83.51 | 64-65,75-80,88-94 
  partUtils.ts     |     100 |      100 |     100 |     100 |                   
  paths.ts         |   80.76 |       80 |   77.77 |   80.76 | ...92-193,201-202 
  ...rDetection.ts |   37.28 |    36.36 |      80 |   37.28 | ...7,91-92,98-103 
  retry.ts         |   62.55 |    73.21 |     100 |   62.55 | ...58-278,323-338 
  ...nStringify.ts |     100 |      100 |     100 |     100 |                   
  ...aValidator.ts |   86.95 |    68.75 |     100 |   86.95 | 24-25,27-28,45-46 
  ...r-launcher.ts |   78.57 |     87.5 |   66.66 |   78.57 | ...33,135,153-188 
  session.ts       |     100 |      100 |     100 |     100 |                   
  shell-utils.ts   |   95.21 |    93.57 |     100 |   95.21 | ...,94-95,142-144 
  summarizer.ts    |     100 |    88.88 |     100 |     100 | 91                
  ...emEncoding.ts |      98 |    94.11 |     100 |      98 | 106-107           
  testUtils.ts     |   84.44 |    72.72 |   83.33 |   84.44 | 27-28,34-35,70-72 
  textUtils.ts     |    12.5 |      100 |       0 |    12.5 | 15-34             
  user_account.ts  |   97.72 |    97.05 |     100 |   97.72 | 102-103           
  user_id.ts       |    75.6 |       60 |      75 |    75.6 | 19-20,28-33,46-48 
  ...aceContext.ts |   80.37 |    74.19 |      80 |   80.37 | ...17-121,149-150 
 ...ils/filesearch |    97.8 |    93.75 |     100 |    97.8 |                   
  crawlCache.ts    |     100 |      100 |     100 |     100 |                   
  fileSearch.ts    |   96.27 |    91.52 |     100 |   96.27 | ...71-172,203-204 
  ignore.ts        |     100 |      100 |     100 |     100 |                   
  result-cache.ts  |     100 |     92.3 |     100 |     100 | 49                
-------------------|---------|----------|---------|---------|-------------------

For detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run.

@jakemac53
Copy link
Collaborator Author

Added support for subschemas 👍

Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -448,6 +507,15 @@ export async function discoverTools(
continue;
}

if (!hasValidTypes(funcDecl.parametersJsonSchema)) {
console.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

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

users won't see console.warn messages unless they open the console. If we make this
console.error then they will see it but may get too concerned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we have any more general framework for surfacing errors/warnings to users? I couldn't really find one but I did see other usages of console.warn. The UX is not ideal though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(fwiw, this message does appear without any special flags, at least in my VsCode terminal)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am going to go ahead and land this as is but I think there should be a separate issue for some sort of general framework for surfacing warnings/errors to the user as full on messages in the chat (but not the gemini history).

@jakemac53 jakemac53 added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit b3cfaeb Aug 6, 2025
14 checks passed
@jakemac53 jakemac53 deleted the missing-types branch August 6, 2025 20:25
agmsb pushed a commit to agmsb/gemini-cli that referenced this pull request Aug 6, 2025
acoliver pushed a commit to acoliver/llxprt-code that referenced this pull request Aug 6, 2025
agarwalravikant pushed a commit to agarwalravikant/gemini-cli that referenced this pull request Aug 7, 2025
thacio added a commit to thacio/auditaria that referenced this pull request Aug 7, 2025
JeongJaeSoon pushed a commit to JeongJaeSoon/gemini-cli that referenced this pull request Aug 21, 2025
Gosling-dude pushed a commit to Gosling-dude/gemini-cli that referenced this pull request Aug 23, 2025
involvex pushed a commit to involvex/gemini-cli that referenced this pull request Sep 11, 2025
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.

aws-diagram-mcp-server: Gemini backend rejects tool registration due to missing schema type
2 participants