Parse a raw LLM fenced response
parse_turn_responseParses raw LLM responses to extract the fenced JSON block, separating discardable reasoning from the structured state patch and action, preventing syntax slips.
Instructions
Parses a raw LLM response string containing free-form reasoning and a fenced ```json block { 'state_patch': {...}, 'action': '...' } per arXiv:2608.26263 Appendix A.4. Separates the reasoning trace R_t (for discarding) from the structured payload, mitigating JSON syntax slips (arXiv:2608.26263 §5.7).
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": {
"response_text": "<response_text>"
},
"name": "parse_turn_response"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response_text | Yes | Raw text response from the LLM containing free-form reasoning and a fenced ```json block conforming to Appendix A.4: { 'state_patch': {...}, 'action': '...' }. |