Skip to main content
Glama

extract

Turn text or files into structured JSON using a local model, with optional schema validation and automatic retry on invalid output.

Instructions

Extract structured data from text/files with the local model. Optionally validate output against a JSON schema (one automatic retry on invalid output).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoGlob pattern, e.g. 'src/**/*.ts'
pathNoSingle file path (read server-side — never enters your context)
seedNoFixed seed for reproducible output.
stopNoStop sequences.
textNoInline text instead of files
modelNo
pathsNoMultiple file paths
thinkNoChain-of-thought control (ollama `think`; best-effort on openai-compatible servers). think:false keeps the whole max_tokens budget for the answer.
top_pNoNucleus sampling threshold.
schemaNoJSON Schema the result must satisfy
num_ctxNo
optionsNoProvider-native overrides merged into the request (ollama `options` keys like top_k/repeat_penalty; openai-compatible body fields). Wins over named params.
providerNo
instructionYesWhat to extract, e.g. 'all function names and their purposes'
temperatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two genuinely useful traits: local-model execution and one automatic retry on invalid schema output. It omits operational realities for a 15-param inference tool — whether the model must be pulled first (siblings include pull_model/list_models), latency or timeout behavior, and what happens on retry failure.

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 sentences, zero filler, with the core action front-loaded and the optional validation behavior trailing it. Every clause carries information.

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

Completeness2/5

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

For a 15-parameter tool with no output schema, the description should say what comes back — raw JSON object, string, or wrapper with metadata — and how the file-input variants relate. Neither the return shape nor the input-mode selection is covered, leaving substantial gaps for an agent assembling a call.

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 73%, so the schema documents most parameters and the baseline is 3. The description adds only that extraction works over 'text/files' and that 'schema' triggers validation with a retry, but says nothing about the mutual exclusivity of text/path/paths/glob or the model/provider/options relationships it exposes.

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

Purpose4/5

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

States a specific verb+resource (extract structured data from text/files) and the execution locus (local model), which implicitly separates it from sibling inference tools like classify, chat, and summarize. It stops short of naming any alternative explicitly, so it lands at 4 rather than 5.

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

Usage Guidelines2/5

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

The description never says when to reach for this instead of the other model-backed siblings (classify, summarize, decide, chat, run_local_agent). The schema-validation mention hints at a context, but there are no stated conditions, prerequisites, or exclusions.

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