Skip to content

fix:type conversion for component state valuesmain #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tuskermanshu
Copy link

Fix Type Conversion for Component State Values

close #18

Problem

When modifying component state values through MCP, the values are passed as strings, causing incorrect type conversion. For example:

  • Numbers are treated as strings: "1" instead of 1
  • Booleans are not properly converted: "true" instead of true
  • Objects and arrays remain as string format

Solution

Implemented proper type conversion system to ensure values are converted to their correct types before being applied to component state.

Testing

Tested with following scenarios:

  • Setting number values (e.g., count: "12" → 12)
  • Setting boolean values (e.g., isActive: "true" → true)
  • Setting object values (e.g., config: "{"key": "value"}" → {key: "value"})

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.

Type Inconsistency in Component State Updates
1 participant