AIDataParser

v0.2.0
io.github.shibley/aidataparser Checked 2 days ago Published 2 months ago

PDFs, images and messy text to schema-guaranteed JSON.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

try_parse Try it now — parse text into JSON with no API key

Run a REAL extraction with no API key, no email and no signup, so you can see the output shape before committing to anything. Pass up to 4000 characters of messy text in `text` (an invoice, a receipt, a resume, scraped HTML, an email body) and optionally a `schema` or `schema_id` to constrain the result. Returns the same structured data, confidence and review_needed flag the paid tools return. Limited to 3 calls per caller per day — for real volume call create_api_key for 50 free credits, then use parse_text or parse_document.

ParameterTypeDescription
text *stringThe raw text to extract structured data from, up to 4000 characters. Send a representative excerpt rather than a whole corpus.
instructionsstringOptional natural-language guidance for what to extract.
schemaobjectOptional JSON Schema describing the exact output shape you want. When provided, the returned `data` conforms to it.
schema_idstringOptional named template to use instead of a hand-written schema, e.g. "invoice", "receipt", "resume". Call list_schemas for the full set. Ignored when `schema` is provided.

create_api_key Get an API key with free credits

Start here if you do not have an AIDataParser API key. Provide the user's `email` and receive a live adp_live_ API key with 50 free credits — no card, no signup form. Configure it on this MCP server as `Authorization: Bearer <api_key>` to unlock parse_document, parse_text and infer_schema. The key is returned ONCE and is never shown again, so surface it to the user and store it. Ask the user for their address; do not invent one. Free — does not consume a credit.

ParameterTypeDescription
email *stringThe user's email address. The account and its free credits belong to this address; an address that already has an account is refused rather than issued a second key.

parse_document Parse a document into structured JSON

Extract clean, schema-guaranteed JSON from a PDF or image. Provide the document via `url` or `base64`. Pass an optional JSON `schema` to constrain the output shape, and `instructions` to guide extraction. Returns the extracted data plus a confidence score and a review_needed flag. Costs 1 credit per successful call.

ParameterTypeDescription
base64stringBase64-encoded document bytes (alternative to `url`). Provide `media_type` alongside it.
instructionsstringOptional natural-language guidance for what to extract.
media_typestringMIME type for `base64` input, e.g. application/pdf, image/png, image/jpeg.
redactbooleanWhen true, PII (emails, SSNs, card numbers, phones, etc.) is masked in the output before it leaves the server.
schemaobjectOptional JSON Schema describing the exact output shape you want. When provided, the returned `data` conforms to it.
schema_idstringOptional named template to use instead of a hand-written schema, e.g. "invoice", "receipt", "resume". Call the list_schemas tool for the full set. Ignored when `schema` is provided.
urlstringPublic http(s) URL of the PDF or image to parse.

parse_text Parse raw text into structured JSON

Extract clean, schema-guaranteed JSON from raw/messy text you already have — scraped web content, email bodies, chat logs, OCR output, or pasted tables. Pass the text in `text`. Use this instead of parse_document when you don't have a file. Optional JSON `schema` (or `schema_id`) constrains the output shape and `instructions` guides extraction. Returns the extracted data plus a confidence score and a review_needed flag. Costs 1 credit per successful call.

ParameterTypeDescription
text *stringThe raw text to extract structured data from.
instructionsstringOptional natural-language guidance for what to extract.
redactbooleanWhen true, PII (emails, SSNs, card numbers, phones, etc.) is masked in the output before it leaves the server.
schemaobjectOptional JSON Schema describing the exact output shape you want. When provided, the returned `data` conforms to it.
schema_idstringOptional named template to use instead of a hand-written schema, e.g. "invoice", "receipt", "resume". Call the list_schemas tool for the full set. Ignored when `schema` is provided.

infer_schema Infer a reusable JSON Schema from a sample

Given one sample document's `text`, propose a reusable JSON Schema for that document type. Use this when no built-in schema_id fits: infer a schema once, review it, then reuse it as `schema` on parse_document / parse_text across many documents for consistent output. Returns the JSON Schema plus a flat field list and an inferred doc_type. Costs 1 credit per successful call.

ParameterTypeDescription
text *stringA single representative sample of the document type, as text.
doc_typestringOptional hint for what kind of document this is, e.g. "purchase order", "lab report".
instructionsstringOptional guidance on which fields matter or how to shape the schema.

validate Validate JSON against a schema

Check whether a JSON object conforms to a JSON `schema` (or a built-in `schema_id` template) and get back a valid flag plus per-field errors. Use this to verify data you already hold — a prior parse result, your own output, or an upstream feed — before acting on it or spending a credit. Deterministic, free, and needs no API key.

ParameterTypeDescription
data *The JSON value to validate.
schemaobjectJSON Schema to validate against. Takes precedence over schema_id.
schema_idstringBuilt-in template id to validate against instead of a hand-written schema (invoice, receipt, resume, etc.). Call list_schemas for the full set.

check_credits Check remaining credits

Return the number of extraction credits remaining on the authenticated API key. Free — does not consume a credit.

list_schemas List built-in schema templates

Return the built-in schema templates you can pass to parse_document as `schema_id` (invoice, receipt, resume, etc.), each with its id and the fields it extracts. Free — does not consume a credit and needs no API key.

buy_credits Buy a credit pack (returns a checkout link)

Get a Stripe checkout link for a one-time credit pack, to hand to the user. Packs: `starter` $9 for 500 credits, `growth` $29 for 2,000 credits, `scale` $99 for 10,000 credits. Credits never expire; 1 credit per document. If this server has an API key set, the credits land on that key's account. Without a key, pass the user's `email` (ask them; do not invent one) — the page after payment shows their new API key. Creating the link charges nothing; the user pays on Stripe's page.

ParameterTypeDescription
emailstringThe user's email. Required only when no API key is set on this server; ignored when one is.
packstringWhich pack. Defaults to starter.