Kaval

v0.8.2
io.github.usekaval/kaval Checked 5 hours ago Published 2 months ago

Verify the facts an agent's action depends on before it acts — ALLOW, REVIEW, or BLOCK.

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

check

Verify the facts an action depends on BEFORE acting on it. Describe the action you are about to take (and any context you are relying on), or pass the specific claims, and Kaval re-checks each fact against the sources it watches — returning decision ALLOW, REVIEW, or BLOCK with a signed receipt. ALLOW: every material fact still holds on fresh evidence — proceed. REVIEW: something is unknown, mid-re-evaluation, or changed at low/medium materiality — REVIEW IS NEVER PERMISSION TO ACT; surface it to a human or re-research. BLOCK: a high/critical fact has changed, or a critical fact is unkno…

ParameterTypeDescription
actionstringwhat you are about to do, in plain language, e.g. 'Approve this claim at the 2026 in-network rate'. Kaval extracts the facts it depends on.
as_ofstringRFC 3339 cutoff for what the action may rely on
claimsarraycheck these facts directly instead of extracting them: plain sentences, or {subject, predicate, object, scope} objects (structured claims skip extraction entirely)
contextstringwhat you already believe that bears on the action — the retrieved chunk, the cached field, the prior answer
materialityhow much this action's correctness matters — drives whether a changed fact is REVIEW or BLOCK
max_wait_msintegerbudget in ms for live research on facts that are stale or new. Over MCP this defaults to 45000 and cannot go higher, because a tool call is cancelled by the caller at 60s; the API's own default, for d…
modestring'standard' (default) may research anything stale or novel within max_wait_ms; 'fast' answers only from stored state and reports anything it does not know as unknown
origin_urlsarrayauthoritative sources for this action, merged with whatever this workspace already watches

get_receipt

Fetch the full signed receipt for a check you already ran, by the `receipt.id` that check returned. `check` gives you only the id, the signature, and when it was signed; this returns the document that was actually signed — every fact with its state and the evidence basis under it (source locator, content digest, fetch and publication time), the freshness failure if state could not be served, the decision-rule version, and the signing key id. Get it when you have to SHOW the work: attach it to a BLOCK you are escalating, hand it to a reviewer or auditor, or check the verdict offline — the d…

ParameterTypeDescription
receipt_id *stringthe `receipt.id` from the check you want the proof for

prepare_contract_upload

Create a private PDF upload target. Upload the exact bytes to upload_url before you call ingest_contract with the returned upload id.

ParameterTypeDescription
filename *string
sha256 *stringlowercase SHA-256 digest of the exact PDF bytes
size_bytes *integer
content_typestring
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation

ingest_contract

Queue a contract for extraction. Use canonical text, an approved HTTPS content URL, or an upload id from prepare_contract_upload.

ParameterTypeDescription
authority_status *string
contract_family_key *
document_type *string
effective_from *
effective_to *
external_id *string
source *
supersedes_contract_id *
title *string
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation

get_contract

Get contract processing status, candidate counts, and extraction issue state. Poll until the contract is ready for review or has failed.

ParameterTypeDescription
contract_id *string

list_contract_claims

List extracted claim candidates with exact evidence spans. A reviewer must approve, correct, or reject each candidate before activation.

ParameterTypeDescription
contract_id *string
activation_statestring
cursorstring
limitinteger
statusstring

list_contract_extraction_issues

List deterministic contract extraction failures for customer review. Each issue identifies the rejected candidate and evidence-line range without exposing contract text.

ParameterTypeDescription
contract_id *string
cursorstring
issue_codestring
limitinteger

review_contract_claim

Record an immutable human review. Use correct only with corrected_claim. The expected version prevents a stale review from overwriting newer work.

ParameterTypeDescription
claim_id *
contract_id *string
decision *string
expected_candidate_version *integer
review_id *string
corrected_claimobject
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation
reasonstring

import_facts

Queue 1 through 400 reviewed facts for warm checks. This tool does not create watched sources. Each item gets a terminal result.

ParameterTypeDescription
external_batch_id *string
items *array
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation

get_fact_import

Get one bulk import and every item result. Poll until the batch reaches a terminal state.

ParameterTypeDescription
import_id *string

list_bulletins

List structured payer bulletins. Filter by payer, policy, code, publisher date, or review status. Dates are publisher-stated dates only. Prefer create_extraction_schema + create_extraction_run (or update_source's extraction_schema_id binding) for new integrations — this free-text pipeline still works but is not receiving new record types.

ParameterTypeDescription
codestring
cursorstring
limitinteger
payer_idstring
policy_numberstring
published_fromstring
published_to
record_statusstring
source_idstring

get_bulletin

Get one structured bulletin by source-version id. Each field includes its status and exact evidence when available. Prefer get_extraction_run for new integrations — this free-text pipeline still works but is not receiving new record types.

ParameterTypeDescription
source_version_id *string

list_bulletin_extraction_attempts

List customer-readable bulletin extraction status. Filter by source or lifecycle state. This tool cannot requeue work. Prefer list_extraction_runs for new integrations — this free-text pipeline still works but is not receiving new record types.

ParameterTypeDescription
cursorstring
limitinteger
source_idstring
statusstring

get_bulletin_extraction_attempt

Get one customer-readable bulletin extraction attempt by source-version id. This tool cannot requeue work. Prefer get_extraction_run for new integrations — this free-text pipeline still works but is not receiving new record types.

ParameterTypeDescription
source_version_id *string

list_training_jobs

List training and evaluation job status. This read-only tool does not start, approve, or promote a model.

ParameterTypeDescription
cursorstring
demo_onlyboolean
limitinteger
statusstring

get_training_job

Get one training job status. Production promotion remains an internal operation and is not available through MCP.

ParameterTypeDescription
job_id *string

list_training_feedback

List reviewed feedback and its effective training-use state. This read requires training:manage and does not approve data for training.

ParameterTypeDescription
cursorstring
effective_training_usestring
limitinteger

create_extraction_schema

Register a JSON Schema Kaval extracts structured records against. Bind the returned schema's id to a source with update_source so every document that lands on it afterward is extracted automatically and delivered as an extraction.document webhook, or pass it directly to create_extraction_run for a one-off publisher + period run. This is the schema-bound successor to list_bulletins' free-text extraction. Requires policy-update:manage.

ParameterTypeDescription
json_schema *objectthe JSON Schema records must satisfy, e.g. {type:'object', properties:{cpt_code:{type:'string'}}, required:['cpt_code']}
name *string
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation

rename_extraction_schema

Rename a schema without changing its definition or hash. Active watched sources can continue to use it.

ParameterTypeDescription
id *stringThe extraction schema ID.
name *stringThe new display name.

delete_extraction_schema

Delete a schema from lists and selectors. Historical extraction records remain available. Returns a conflict if an active watched source uses it.

ParameterTypeDescription
id *stringThe extraction schema ID to delete.

list_extraction_schemas

List the extraction schemas registered in this workspace, newest first.

create_extraction_run

Request a one-off publisher + period extraction run. Pass source_id or extraction_schema_id, not both; omit both when exactly one schema is bound in the workspace. Requires policy-update:manage. Answers with the run in status 'processing' — poll get_extraction_run or wait for its extraction.document webhook.

ParameterTypeDescription
period *stringthe YYYY-MM period to extract
publisher_id *stringorg publisher UUID (from list_publishers / create_publisher)
extraction_schema_idexplicit schema override; do not pass together with source_id
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation
source_idstringwatched source whose bound schema should drive this publisher-period run

get_extraction_run

Get one extraction run (an Update) by id — its status (processing | retry | succeeded | review_required | failed | out_of_scope), the schema it ran against, and its extracted result once it succeeds. Document PDF chrome (pdf_href, content_href, sections) is nested on extraction_run.document by default; pass expand_document=false to omit. Records and nested evidence live on extraction_run.result.

ParameterTypeDescription
run_id *string
expand_documentbooleannested document chrome on the run; defaults to true. Pass false to omit.

list_extraction_runs

List extraction runs (Updates). Filter by publisher_id (org publisher UUID), optional period_from and/or period_to (YYYY-MM), created_since/updated_since (ISO-8601), and page with limit + cursor. Document chrome is nested on each run.document by default; pass expand_document=false to omit. Returns { extraction_runs, next_cursor }. Prefer webhooks for steady state; use this to catch up. Sources: list_sources / get_source_version_content.

ParameterTypeDescription
created_sincestring
cursorstring
expand_documentbooleannested document chrome on each run; defaults to true. Pass false to omit.
limitinteger
period_fromstring
period_to
publisher_idstring
updated_sincestring

list_extraction_packages

List the monthly PDF + manifest rollups every publisher/period's extraction runs are packaged into, optionally filtered by publisher UUID and/or YYYY-MM period. Each row's pdf_href is GET /v1/extraction-packages/{id}/document — follow the 302 to a short-lived signed PDF (this tool does not download bytes).

ParameterTypeDescription
periodstring
publisher_idstring

list_publishers

List org-owned publishers for this workspace's billing account. publisher_id on sources and extraction runs is the UUID returned here; rename the display name without changing identity. Create with create_publisher.

create_publisher

Create an org-owned publisher (renameable display name; UUID is the identity). Pass the returned id as publisher_id to add_source. Duplicate names in the same org return 409.

ParameterTypeDescription
name *stringdisplay name, e.g. 'Aetna'
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation

get_publisher

Get one org-owned publisher by UUID. Display name is renameable; identity is the UUID used as publisher_id on sources and extraction runs.

ParameterTypeDescription
publisher_id *string

update_publisher

Rename an org-owned publisher. The UUID identity is unchanged — existing sources and runs keep grouping under it.

ParameterTypeDescription
name *stringnew display name
publisher_id *string

add_source

Tell Kaval what to watch, so later checks are answered from fresh state instead of live research. Requires publisher_id (org publisher UUID from list_publishers / create_publisher) so extractions group under that publisher. Registering the NAME of an authority is usually enough: {kind:'entity', name:'Aetna', intent:'payer policy bulletins', publisher_id:'…'} resolves to the pages that publish it and watches them. Use kind:'url' for a specific page, kind:'push' for a document your own system will send in. Kaval polls watched sources adaptively, re-evaluates the facts that depend on them when…

ParameterTypeDescription
kind *stringurl (a specific page) | entity (a name to resolve) | push (a document you will send to Kaval) | connection (a configured system of record)
publisher_id *stringorg publisher UUID from list_publishers / create_publisher — required; runs and monthly packages group by it
intentstringwhat you want watched about it, e.g. 'prior-authorization policy bulletins'. Drives entity resolution.
labelstring
locatorstringthe URL, connection id, or push locator
namestringfor kind:'entity', the plain name of the authority, e.g. 'Aetna' — the same field as locator, spelled for readability
poll_interval_sintegerstarting poll interval; Kaval adapts it — slower when nothing changes, faster when it does
scope_keysarraytags that route document changes to the facts they can affect, e.g. ['plan:HMO','state:CA']

list_sources

List what Kaval currently watches for this workspace — including sources it auto-registered after a check cited them. Each row shows the locator, what it was registered for, when it was last successfully fetched, and whether it is active. Use it to see whether the fact you care about is actually backed by a watched source (and therefore fast and monitored) before relying on a check being warm.

ParameterTypeDescription
include_inactivebooleanalso return paused sources (default false)

remove_source

Stop watching a source and forget it, by the `id` `add_source` or `list_sources` returned. Removal is the only thing that frees a slot. Capacity is two ceilings: up to 200 active registered/resolved sources per workspace (every URL a check cites auto-registers against that ceiling), and up to 200 active discovered children per parent (those do not consume the workspace registered/resolved budget). Pausing does not free either. An agent that only ever adds eventually fills the workspace ceiling — after which new citations are silently dropped and checks that used to be warm go back to researc…

ParameterTypeDescription
id *stringthe watched-source id returned by add_source (`source.id`) or list_sources

update_source

Bind (or unbind) an extraction schema and/or set publisher_id on a watched source, by the `id` add_source or list_sources returned. Provide extraction_schema_id and/or publisher_id. Once a schema is bound, every document that lands on the source is extracted automatically and delivered as an extraction.document webhook. Pass extraction_schema_id: null to unbind. Pass reprocess: true to also fill-missing re-extract versions (webhook source_change is schema_changed; join on source_version_id) — also regroups under a newly set publisher_id. Requires policy-update:manage.

ParameterTypeDescription
id *stringthe watched-source id returned by add_source (`source.id`) or list_sources
extraction_schema_idthe extraction schema to bind, or null to unbind and stop automatic extraction
publisher_idstringorg publisher UUID from list_publishers / create_publisher; future runs use this identity
reprocessbooleanwhen true, also re-extract versions that already ran under another schema/publisher; default false. Invalid with extraction_schema_id null.

get_source_version_content

Fetch the captured content of one fetched version of a watched source, by the `source_version_id` an extraction.document webhook or an extraction run names. Defaults to the raw canonical text; pass format:'sections' to get it pre-split into the same sections the sectionizer feeds extraction runs.

ParameterTypeDescription
source_version_id *string
formatstring

report_outcome

Report what actually happened after a prior check, using the receipt id it returned, so Kaval can calibrate. Use `relied_and_correct` when you acted on an ALLOW and it held; `current_later_contradicted` when an ALLOW turned out to be wrong; `stale_caught_real` when a REVIEW/BLOCK caught a genuine change; `stale_was_false_alarm` when it did not.

ParameterTypeDescription
id *stringthe `receipt.id` returned by the check you are labelling
kind *string
notestring

verify

DEPRECATED — prefer the `check` tool. Verifies one load-bearing conclusion against evidence references you supply and returns a signed ProofPacket receipt (status valid | invalidated | could_not_verify, receipt.decision ALLOW | REVIEW | BLOCK). Kept only for existing pilot integrations that pass explicit evidence_refs; it will be removed. New calls should use `check`, which needs no evidence list, is answered from watched state with no model call and no fetch, and keeps monitoring the facts afterwards.

ParameterTypeDescription
conclusion *stringthe exact assertable proposition the downstream workflow intends to rely on — a STATEMENT of what you believe, in the indicative. The API rejects anything phrased as a request or a question, INCLUDI…
evidence_refs *array1-20 evidence references the conclusion relies on: plain http(s) URL strings, or { url, document_id } objects with unique document_id values
as_ofstringRFC 3339 cutoff for what the conclusion may rely on
contextstring
idempotency_keystringreuse the operation key returned by an ambiguous prior attempt; omit for a new operation
intended_actionstring
jurisdictionstring
materialitystring
reversibilitystring