Skip to content

Conversation

gregsaab
Copy link

@gregsaab gregsaab commented Oct 8, 2025

This adds the ability to specify a null value for nullable fields by conditionally rendering a null checkbox when a field has a null type in the array. If the checkbox is selected, the input will be disabled.

I chose checkboxes over supporting a value of "null" to make behavior explicit, obvious, and not to affect cases where you actually want to send "null" as a value.

Example:

2025-10-08 13 19 37

Note

When reviewing, hide whitespace changes
image

Motivation and Context

At present, there is no way to specify a null value for a field.

How Has This Been Tested?

  • Tested against a local MCP server with non-nullable and nullable fields (various types), and verified that correct values received by mcp server
  • Added unit & ui test specs

Breaking Changes

No

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

@gregsaab gregsaab changed the title Greg/add null support to tools Add support for specifying null values for tool fields Oct 8, 2025
@cliffhall
Copy link
Member

Hi @gregsaab!

Interestingly, there is another PR @olaservo is working on where the challenge is to send null for a field whose default is null in the tool's inputSchema.

@gregsaab
Copy link
Author

Hi @gregsaab!

Interestingly, there is another PR @olaservo is working on where the challenge is to send null for a field whose default is null in the tool's inputSchema.

Hey @cliffhall yeah, I saw that soon after I submitted this. Thought it would be worth having an alternative approach in the mix!

@cliffhall
Copy link
Member

@gregsaab can you merge main on your branch and resolve conflicts? There have been some changes to the ToolsTab.tsx.

@gregsaab
Copy link
Author

merge

@cliffhall done 3adddfb

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