read_variable
Read the current value of any C/C++ variable from a halted debug target using its symbol name.
Instructions
Read a C/C++ variable from the target by its symbol name.
The target must be halted (stopped) for variable reads to work.
Args: name: Variable name as it appears in source code (e.g., "counter", "myStruct.field")
Returns: Variable name and its current value
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": "read_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |