query_gcode
Send read-only G-code queries to a 3D printer and return firmware replies for checking status and settings without changing printer state.
Instructions
Send a query G-code to the printer and return the firmware's reply. Only queries are accepted (M105, M114, M115, M119, M211, M420, M503, M851, M92, M301, M304, M205...) with no arguments that change anything; use send_gcode for anything else. Not available while printing.
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": {
"gcode": "<gcode>"
},
"name": "query_gcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gcode | Yes | One line of G-code, e.g. M115 | |
| timeout | No | Maximum seconds to wait for the printer's ok |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |