add_variable
Add a global variable to a target in mBlock projects for sprites, mBot, CyberPi, or Arduino. Set name, initial value, and path to enable live block editing.
Instructions
Add a global variable to a target.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "add_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | No | ||
| value | No | ||
| target | No | ||
| confirm | No |