Extract any field from structured LLM output
Models that return JSON — tool calls, function calls, structured outputs — bury
the value you actually want deep inside wrapper objects. This tool lets you pull
it out with a single RFC 6901 JSON Pointer, the standard, unambiguous way to
address a node in a JSON document. Paste the response, type a pointer like
/choices/0/message/content, and get the value back instantly.
How JSON Pointer evaluation works
A JSON Pointer is a string of reference tokens, each prefixed by a /. Starting
from the root document, the evaluator walks one token at a time: for an object it
looks up the token as a key, for an array it treats the token as a numeric index.
The empty pointer "" refers to the whole document. Two escape sequences keep the
syntax unambiguous — ~1 means a literal / inside a key, and ~0 means a
literal ~. If any token fails to resolve (missing key, out-of-range index), the
whole pointer has no match.
Tips and examples
- OpenAI chat completions:
/choices/0/message/contentgrabs the assistant text. - Tool/function arguments often arrive as a JSON string — extract it, then paste that string back in as a fresh document to drill deeper.
- To pull every element of an array you address them one index at a time; a pointer resolves to exactly one node by design.
- If a key literally contains a slash (rare, but valid JSON), escape it as
~1.
JSON Pointer vs JSONPath — which to use?
Both are standard ways to address values inside a JSON document, but they have different design goals:
JSON Pointer (RFC 6901) resolves to exactly one node. The path is compact and unambiguous — there are no wildcards, no filters, no fanout. Every JSON Pointer either resolves to a single value or fails. This makes it ideal for JSON Patch (RFC 6902), JSON Merge Patch, and OpenAPI discriminator mappings, where a precise, deterministic reference is required.
JSONPath is expressive and can return multiple matches through wildcards ([*]) and recursive descent (..). It is the right choice when you want to fan out over an array — for example, extracting every id from a list of objects.
For navigating to one specific field in a structured LLM response, JSON Pointer is cleaner and less ambiguous. For collecting all values matching a pattern, use JSONPath.
Common RFC 6901 patterns for LLM output
OpenAI Chat Completions
/choices/0/message/content
The finish reason:
/choices/0/finish_reason
Tool call function name:
/choices/0/message/tool_calls/0/function/name
Anthropic Messages API
/content/0/text
Input token usage:
/usage/input_tokens
Escaping in practice
The two escape sequences exist to handle the characters that are special in the pointer syntax:
| Literal character in key | Write in pointer |
|---|---|
~ (tilde) | ~0 |
/ (forward slash) | ~1 |
For example, to reach the value at key a/b inside the root object, the pointer is /a~1b. Keys containing tildes or slashes are unusual but valid JSON, and the escaping ensures the pointer remains unambiguous.
The empty string "" is a valid JSON Pointer that references the entire document — useful for confirming that your JSON parsed correctly without navigating anywhere.