Skip to main content
Glama

local_extract

Extract only the structured fields you need from large files or text as JSON, using a local model that reads files server-side to save context memory.

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 JSON con exactamente las claves pedidas. 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
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses: local model usage, automatic routing based on input size, server-side file reading, JSON schema restriction with fallback, and return format. Minor gaps include error handling and behavior when both text and path are provided, but overall very transparent.

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 front-loaded with the crucial usage advice, then efficiently covers function, parameters, and technical details. Every sentence adds value, though a few technical details (size detection difference, schema auto) could be shortened without losing clarity.

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?

Given the tool's complexity (3 params, no output schema initially? but actually has output schema which describes return), the description covers input alternatives, return format, automatic routing, and schema handling. It is sufficiently complete for an AI to select and invoke correctly, though edge cases like error states are omitted.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explains each parameter: fields ('keys of JSON'), text ('source text'), path ('file path, read server-side'). It clarifies they are alternatives but doesn't explicitly state mutual exclusivity or that one must be provided. Good but could be slightly clearer.

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 verb 'extract' and the resource 'structured fields from text/file as JSON', and explicitly recommends it over Read for large files when only structured fields are needed. This distinguishes it from sibling tools like classify or summarize.

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 description begins with a clear directive to prefer this tool over Read for files >200 lines or >10 KB when only structured fields are needed. It provides explicit context for when to use (large files, structured extraction) and implies when not to use (when literal content is needed, use Read).

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