Skip to main content
Glama

local_extract

Read-only

Extract structured fields from large files or text as validated JSON, reading files server-side to avoid loading large content into Claude's context.

Instructions

PREFIERE esta tool en vez de leer el archivo con Read cuando el archivo es grande (>200 líneas / >10 KB) y solo necesitas campos estructurados, no el contenido literal.

Extrae campos estructurados de un texto/archivo como JSON, con un modelo local.

Pasa 'path' para leer el archivo server-side (no gasta contexto de Claude) o 'text'.
Devuelve un objeto con exactamente las claves pedidas, ya validado: quien llama no tiene que
parsear una cadena. Si la entrada hubo que truncarla, se añade además la clave reservada
`_local_delegate` con el aviso — antes ese aviso iba como texto delante del JSON, donde
obligaba a limpiar la cadena antes de poder parsearla. Enruta al modelo mecánico
(entradas cortas) o al de contexto largo (documentos grandes) automáticamente: el sondeo
de tamaño usa bytes del archivo para 'path' y caracteres para 'text' (~5-10% de diferencia
en UTF-8, aceptable). Por defecto pide al backend un JSON restringido por schema
(`LOCAL_DELEGATE_JSON_SCHEMA=auto`); si el backend no lo soporta, reintenta en modo libre.

Args:
    fields: Nombres de los campos a extraer (claves del JSON).
    text: Texto fuente (usa esto o 'path').
    path: Ruta a un archivo fuente (leído server-side).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
textNo
fieldsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond annotations (readOnlyHint, openWorldHint), the description details that the tool returns a validated JSON with exact keys, uses local models, routes based on size, and uses schema-restricted JSON with fallback. It also explains the _local_delegate key for truncation, which is valuable behavioral context.

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

Conciseness4/5

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

The description is well-structured with a front-loaded usage guideline, but includes some historical context (e.g., previous behavior of warning before JSON) that is slightly verbose. However, it remains focused and informative.

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

Completeness5/5

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

Given the tool's complexity (multiple parameters, automatic routing, truncation handling, schema fallback) and the presence of an output schema, the description covers all necessary aspects: when to use, what it does, how parameters work, and behavioral nuances.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining that 'path' reads server-side (saving Claude context), 'text' is direct input, and 'fields' are the JSON keys to extract. This adds essential meaning beyond the schema's type definitions.

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 clearly states the tool extracts structured fields from text/files as JSON using a local model. It explicitly distinguishes itself from Read for large files and from sibling tools like local_summarize by focusing on field extraction.

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

Usage Guidelines5/5

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

The first line explicitly advises when to prefer this tool over Read: when the file is large (>200 lines/>10 KB) and only structured fields are needed. It also explains automatic model routing and truncation handling, providing clear context for usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZahiriNatZuke/local-delegate'

If you have feedback or need assistance with the MCP directory API, please join our Discord server