Skip to main content
Glama
Derzkiyboomchik

SKILL.state MCP Runtime

Parse a raw LLM fenced response

parse_turn_response

Parses 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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
response_textYesRaw text response from the LLM containing free-form reasoning and a fenced ```json block conforming to Appendix A.4: { 'state_patch': {...}, 'action': '...' }.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden and discloses key traits: the reasoning trace R_t is discarded, the structured payload is extracted, and JSON syntax slips are mitigated. It stops short of specifying failure behavior when a fenced JSON block is absent, but for a pure parse operation this is meaningful disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with no filler: one states the input format and payload contract, the other states the output behavior and tolerance for JSON slips. The main verb and resource are front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter pure function with no annotations and no output schema, the description provides the expected input format, the extraction logic, and the structured payload. Error-handling details and an explicit return shape are the only notable omissions, but the given specification is sufficient for an agent to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline applies; the schema already describes response_text as the raw LLM response. The description reinforces the expected fenced-JSON format and the state_patch/action shape in prose, but does not add parameter-level detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific action (parses), a specific resource (raw LLM response string with a fenced JSON block), and the expected payload shape ({'state_patch': {...}, 'action': '...'}). It also clarifies that reasoning is separated for discarding, which makes the tool's role distinct from the execution-oriented sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied: use this tool when you have a raw LLM response containing free-form reasoning and a fenced JSON block. However, it does not explicitly state when not to use it or mention alternative tools, so the trigger condition is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.