Skip to main content
Glama

Extract fields by regex, Jev picks the right match

jev_extract

Extract structured fields from documents using regex to find candidates and AI to pick the right one, returning exact values for prices, dates, IDs, and more.

Instructions

Extract structured fields from a document with TypeSafe Jev as the picker, not the generator: your regex finds candidate substrings in code, Jev chooses which candidate is the field's true value, and the result is returned verbatim — never model-generated text. Fields with zero regex matches never reach the model (not_found); if no field has matches, no API call is made. Ambiguous picks are flagged for review. Use for prices, dates, version numbers, IDs, and anything with a recognizable shape; keep documents bounded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesFields to extract. Up to 32 per call, all judged in one request.
purposeNoWhat the extraction is for; shared across fields.
documentYesThe document to extract from. Rejected above 50,000 characters.
auto_acceptNoMinimum top probability for auto. Default 0.85.
minimum_marginNoMinimum winner-to-runner-up gap for auto. Default 0.5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv0.4.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: results are returned 'verbatim — never model-generated text', zero-match fields become 'not_found' and never reach the model, no field matches means no API call, and ambiguous picks are 'flagged for review'. These are non-obvious behavioral and cost traits an agent could not infer from the schema alone.

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?

Front-loaded with the core purpose and mechanism, then compactly layers behavior (not_found, no-API-call, review flagging) and usage examples. It is dense but each clause adds real information; slightly long but not padded.

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?

For a tool with no output schema, it explains return semantics well: verbatim values, not_found for unmatched fields, and review-flagging for ambiguity. It stops short of describing the concrete response structure or error behavior, but an agent has enough to call it correctly.

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 description coverage is 100%, so every parameter is already documented (including flags, pattern, description, auto_accept, minimum_margin). The description adds behavioral context but no additional parameter syntax or meaning, so the baseline 3 applies.

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 and resource ('Extract structured fields from a document') and explains the two-stage mechanism (regex finds candidates, Jev picks the true value). It is very clear about what the tool does. However, it never names or contrasts a sibling tool, so it falls short of the 'distinguishes from siblings' bar for a 5.

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?

Explicitly tells the agent when to use it with concrete examples — 'prices, dates, version numbers, IDs, and anything with a recognizable shape' — and adds a boundary constraint ('keep documents bounded'). It gives clear positive context but names no alternatives or exclusions, so it stops short of a 5.

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