Skip to main content
Glama

extract

Read-only

Convert short text into JSON fields like names, dates, amounts, and IDs using your schema and the offline on-device Apple model.

Instructions

Extract fields from text into JSON matching a JSON Schema, with the on-device model for Apple Foundation Models (free, private, offline). Good for names, dates, amounts and IDs in short documents, emails, logs. Input up to about 3,500 words, as text or path to a text file. Ask only for fields the text likely states: a missing one is often null but may take a wrong value from nearby text. Flat schemas work best; nested ones are unreliable. Allowed keywords: type, properties, required, items, enum, const, description, minItems, maxItems. Not for code or reasoning; check values that matter.

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute path to a UTF-8 text file to extract from instead of `text`.
textNoThe text to extract from. Up to about 3,500 words. Give this or `path`.
schemaYesA JSON Schema for the result. The top level must be an object, for example {"type": "object", "properties": {"invoice": {"type": "string"}, "total": {"type": "number"}}}.
instructionsNoOptional extra guidance, for example "amounts in AUD without the currency sign".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/non-destructive/non-open-world, so the bar is lower, yet the description adds substantial context: free/private/offline on-device execution, ~3,500-word input cap, the risk that absent fields take wrong values from nearby text, and the unreliability of nested schemas. This is exactly the behavioral context annotations cannot express.

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?

Dense but front-loaded: capability first, then good-use cases, limits, accuracy caveats, and schema constraints. Every sentence adds operational value, though it packs enough caveats that it reads as a block rather than distinct scannable points.

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?

Covers input sourcing, size limits, accuracy expectations, and schema restrictions for a tool with no output schema, and annotations cover the safety profile. An agent has everything needed to call this correctly and to know when results should be verified.

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 coverage is 100%, so the baseline is 3. The description goes beyond the schema by enumerating the JSON Schema keywords the tool actually honors (type, properties, required, items, enum, const, description, minItems, maxItems) and clarifying that text and path are alternates, which the schema only implies via defaults.

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?

States a specific verb (extract) plus resource (fields into JSON matching a JSON Schema) and the engine (on-device model for Apple Foundation Models). It is clearly distinguishable from classify, ocr, and summarise, which all transform rather than populate a caller-supplied schema.

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

Usage Guidelines4/5

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

Gives concrete when-to-use context (names, dates, amounts, IDs in short documents, emails, logs), an explicit exclusion ('Not for code or reasoning'), and input-size guidance. It never names a sibling tool as the alternative, so routing to classify/ocr/summarise is left to inference.

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

Deploy Server

Other Tools