Skip to content

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