evidence-ledger-mcp
v0.6.1MCP server through which agents write and check evidence ledgers for the citations in a work.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
schema_info
Report the server version and the evidence ledger schema version it supports.
validate_record
Validate one ledger record against the schema; returns the violations, empty if valid.
| Parameter | Type | Description |
|---|---|---|
record * | object |
create_ledger
Create a ledger file (JSON Lines) with a header; `work` needs `title` and `type`.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
work * | object | |
description | ||
notes |
import_ledger
Import a ledger of any older schema version, or a pre-schema hand-built list, as a new JSON Lines ledger at `path`, which must not exist. The source is YAML, JSON (`{"ledger": header, "records": [...]}` or a plain list of records) or JSON Lines (header on the first line, one record per line). A plain list needs `work` (`title` and `type`); a source with a header must not be given `work`. The header's `schema_version` is upgraded step by step to this server's (a newer or unknown version is refused); records keep their ids, claim ids, provenance dates and quote hashes (an…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
source * | string | |
work |
add_record
Append a record. The server assigns `id`, `claim_id` (unless given), `quote_hash` and the provenance date, validates the result and returns the stored record. Mark the phrase carrying the claim (a number, term or short statement) with optional `quote_focus`. `relation` is `contrasts` only for a passage that conflicts with the claim; one that only qualifies it is `partially_supports`, with a `justification` naming the qualification. Source text belongs only in `quote`, `quote_prefix`, `quote_suffix` and `quote_focus`: write `justification`, `locator` (including a section…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
provenance * | object | |
record * | object | |
related |
update_record
Change fields of one record and return it. `changes` is merged into the record; a null value removes a field. `id`, `withdrawn`, `quote_hash` and `provenance` cannot be changed, and a withdrawn record cannot be edited. A new `quote` gets a new `quote_hash`; a removed one drops it. The record's `provenance` is not touched: it records the original assessment (who, which model, which manuscript revision, when), not later edits. A change to `claim` or `importance` is copied to every record with the same `claim_id`; a claim may span related ledgers, so pass their paths as `r…
| Parameter | Type | Description |
|---|---|---|
changes * | object | |
id * | string | |
path * | string | |
related |
update_records
Change fields of several records in one call and return each item's record in its final state (two items on one record return the same, fully updated record). `updates` is a list of `{"id": "R-0001", "changes": {...}}`; each `changes` works as in `update_record`, and provenance stays as it was. Updates apply in order, so a later one sees an earlier one (a duplicate id is allowed), and claim-level changes are copied to the claim's other records, also in the `related` ledgers (pass the same list every time). Every affected record is checked against the final state of all…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
updates * | array | |
related |
move_record
Move a record (withdrawn ones too) from the ledger at `path` to the ledger at `to`, keeping its `id`, `claim_id` and provenance, and return it. Refused when both are the same file, the id is missing from `path` or already used in `to`, or the record fails the checks of `add_record` against `to` and the `related` ledgers (header text, claim text or importance of its claim). The claim may then span both ledgers: pass the project's other ledgers as `related` to later calls so it stays consistent. Both files are rewritten together, `to` first, all or none (on a write error…
| Parameter | Type | Description |
|---|---|---|
id * | string | |
path * | string | |
to * | string | |
related |
get_record
Return one record by its id.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
path * | string |
find_records
Find records by claim_id, source key, text in the claim, or contestable records lacking evidence (all filters combine); withdrawn records are left out unless requested.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
claim_id | ||
include_withdrawn | boolean | |
key | ||
missing_evidence | boolean | |
text |
validate_ledger
Validate a whole ledger; returns the problems found, empty if valid. Pass the other ledgers of the project as `related` (the same list as for `add_record`) to also report ids used in more than one of them (`R-0001: id also used in <ledger>`) and claims whose records disagree on claim text or importance across them (`C-0001: records disagree on claim text across related ledgers`).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
related |
withdraw_record
Mark a record withdrawn with a reason instead of deleting it.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
path * | string | |
reason * | string |
export_ledger
Export the ledger to a new file. `masked` keeps the first and last words of each quote, `locator` no quoted text; a publication check runs before writing, and `out` is never overwritten. `max_words` is allowed only for `masked`, from 1 to 25; None keeps the default masking. With a budget, `quote_focus` centres the excerpt. A `full` export holds whole quotes: keep it private.
| Parameter | Type | Description |
|---|---|---|
out * | string | |
path * | string | |
format | string | |
include_withdrawn | boolean | |
level | string | |
max_words |
summarize_ledger
Write a standalone HTML summary of the records, grouped by claim, to a new file. Levels and the publication check work as in `export_ledger`, and `out` is never overwritten. A `full` summary holds whole quotes: keep it private. For a PDF, print the HTML from a browser; its print style shows link targets and avoids splitting records where possible.
| Parameter | Type | Description |
|---|---|---|
out * | string | |
path * | string | |
include_withdrawn | boolean | |
level | string |
embed_ledger
Write a copy of the work's HTML (`work`, rendered by Quarto, Pandoc or any tool) with each claim's anchor marked and linked to its evidence, to a new file. Both layouts end with an "Evidence" section holding one card per claim; a button switches the reader between that section and a side panel that opens the clicked claim's card (a bottom sheet on narrow screens), and `layout` picks the view shown first; if no anchor is located, `panel` falls back to `endnotes` and the result's `layout` says so. Anchors that are only a marker, not found in the text or overlapping anothe…
| Parameter | Type | Description |
|---|---|---|
out * | string | |
path * | string | |
work * | string | |
include_withdrawn | boolean | |
layout | string | |
level | string |
check_ledger
Check a ledger without changing anything; the result holds record and claim ids, keys and counts, never quote or source text. `gaps` is always returned: contestable records lacking a locator, quote or justification, claims whose records are all withdrawn, and, when a bibliography is known, record keys missing from it. Optional checks, each returned only when its input is given: `work` reports anchors not found in it, or with only a marker, under `anchors` (HTML is matched on its visible text; other files on their source text, so markup inside an anchor reports not found…
| Parameter | Type | Description |
|---|---|---|
path * | string | |
bibliography | ||
include_withdrawn | boolean | |
revision | ||
source_urls | ||
sources | ||
work |
resolve_links
Resolve the ledger's sources against the reader's own PDFs and write the result to `link_file`, which must end in `.private.json` (a rerun replaces one this tool wrote, no other file): it holds paths on this computer, so do not share it. Give `folder`, `link_map` or both. Best layout: a `sources/` folder holding only the cited PDFs, each named `<citation key>.pdf`, kept out of version control (copyrighted). A file named exactly after the key is tried first; other names work through the matching below. Do not pass a whole reference library as `folder`: thousands of PDFs…
| Parameter | Type | Description |
|---|---|---|
link_file * | string | |
path * | string | |
bibliography | ||
folder | ||
include_withdrawn | boolean | |
link_map |
relink_html
Give a reader links from a summary or embedded HTML file (from `summarize_ledger` or `embed_ledger`, e.g. one a co-author sent) to their own PDFs in `folder` (best: a `sources/` folder of only the cited PDFs named `<citation key>.pdf`, kept out of version control; never a whole library) or in a `link_map` (a `.private.json` file as for `resolve_links`). Records are read from the data the file carries, sources matched as in `resolve_links`, and each evidence card gets a "Your copy" line with an "Open PDF" button opening the PDF at the passage's page, or else at the c…
| Parameter | Type | Description |
|---|---|---|
html * | string | |
bibliography | ||
folder | ||
link_map |