Skip to content

fix(tools): allow entering decimal values like 1.0 in parameter fields (#918)#1614

Open
asif786ka wants to merge 1 commit into
modelcontextprotocol:mainfrom
asif786ka:fix/asif786ka-contribution-insp
Open

fix(tools): allow entering decimal values like 1.0 in parameter fields (#918)#1614
asif786ka wants to merge 1 commit into
modelcontextprotocol:mainfrom
asif786ka:fix/asif786ka-contribution-insp

Conversation

@asif786ka

Copy link
Copy Markdown

Summary

  • Fix tool parameter number fields so values like 1.0 can be entered without collapsing to 1 while typing.
  • Use text inputs with inputMode="decimal" for number schema fields and defer committing trailing-zero decimals until blur.
  • Apply the same draft/commit behavior to flat tool parameter inputs in ToolsTab.
  • Add regression tests for 1.0 digit-by-digit entry.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have enabled "Allow edits from maintainers" for this pull request

Fixes #918

Made with Cursor

Number parameter inputs collapsed partial decimals (for example 1.0) to
integers while typing because HTML number inputs reject values like 1.
and immediately coerced valid floats to integer display values.

Use text inputs with decimal input mode for number schema fields, defer
committing trailing-zero decimals until blur, and add regression tests
(issue modelcontextprotocol#918).
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.

It is not possible to enter 1.0 as a value

1 participant