local_extract
Extracts requested structured fields from large text or files as validated JSON using a local model, reading files server-side to avoid consuming Claude context.
Instructions
PREFER this tool over reading the file with Read when the file is large (>200 lines / >10 KB) and you only need structured fields, not the literal content.
Extracts structured fields from a text/file as JSON, with a local model.
Pass 'path' to read the file server-side (spends no Claude context) or 'text'. Returns an
object with exactly the requested keys, already validated: the caller does not have to parse
a string. What is not data travels under the reserved key `_local_delegate` (`truncated` and
`warning`, `read_server_side`, `fallback`, or `error` and `raw`); with chunked input, `chunked`
says how many pieces there were and which fields stayed null in all of them. Routes
automatically to the mechanical model (short inputs) or to the long-context model (large
documents): the size probe uses file bytes for 'path' and characters for 'text' (~5-10%
difference in UTF-8, acceptable).
By default it asks the backend for schema-constrained JSON (`LOCAL_DELEGATE_JSON_SCHEMA=auto`);
if the backend does not support it, it retries in free mode.
Args:
fields: Names of the fields to extract (JSON keys).
text: Source text (use this or 'path').
path: Path to a source file (read server-side).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| text | No | ||
| fields | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||