evidence-ledger-mcp

v0.6.1
evidence-ledger-mcp Checked 19 hours ago Published 8 days ago

MCP 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.

ParameterTypeDescription
record *object

create_ledger

Create a ledger file (JSON Lines) with a header; `work` needs `title` and `type`.

ParameterTypeDescription
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…

ParameterTypeDescription
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…

ParameterTypeDescription
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…

ParameterTypeDescription
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…

ParameterTypeDescription
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…

ParameterTypeDescription
id *string
path *string
to *string
related

get_record

Return one record by its id.

ParameterTypeDescription
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.

ParameterTypeDescription
path *string
claim_id
include_withdrawnboolean
key
missing_evidenceboolean
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`).

ParameterTypeDescription
path *string
related

withdraw_record

Mark a record withdrawn with a reason instead of deleting it.

ParameterTypeDescription
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.

ParameterTypeDescription
out *string
path *string
formatstring
include_withdrawnboolean
levelstring
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.

ParameterTypeDescription
out *string
path *string
include_withdrawnboolean
levelstring

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…

ParameterTypeDescription
out *string
path *string
work *string
include_withdrawnboolean
layoutstring
levelstring

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…

ParameterTypeDescription
path *string
bibliography
include_withdrawnboolean
revision
source_urls
sources
work