Skip to main content
Glama

Open Targets evidence invariants

A reproducible target-dossier prototype for NOD2 and TNF in inflammatory bowel disease (IBD). It explores which scientific constraints can be enforced in code and which still require human judgment.

Built by Chris Lawrence, RN with AI coding assistance. Public Open Targets data only; no employer or client materials. Local research prototype, not a clinical recommendation system.

Review in five minutes

  1. Read the evaluation findings.

  2. Compare the original live NOD2 dossier with the corrected dossier and signed review.

  3. Inspect the domain validator, thin MCP server, and four fault-injection tests.

  4. Run the offline demo; no API key is required.

Related MCP server: Evidrift

What this adds

Open Targets already has an official MCP server for access to its API. This project is a separate, task-specific server that replays frozen GraphQL responses. It does not call, replace, or claim superiority over the official MCP.

  • assemble_target_disease_evidence: creates a typed packet with disease scope, source-record provenance, and explicit missingness and retrieval limits.

  • validate_dossier_references: checks packet-bound citations and selected structured assertions. It does not determine whether arbitrary prose is true.

  • A bounded agent loop requires final validation and records tool calls, repairs, versions, and token use. A reusable skill guides synthesis. Markdown and JSON outputs support subsequent review.

For example, a Crohn disease record remains descendant evidence for selected IBD. Calling it direct IBD evidence in a structured assertion is rejected. Inferring what intervention to use from a LoF/risk label still requires scientific judgment.

Synthetic fault

Checked behavior

Descendant evidence asserted as direct

Reject with INDIRECT_SCOPE

Approval for an unrelated indication asserted for IBD

Reject with INDICATION_MISMATCH

Empty safety data interpreted as a safe target

Preserve unknown state; reject structured safety assertion

Nonexistent citation

Reject with DANGLING_REFERENCE

Results and limits

The reviewed live NOD2 run completed with 2 generation requests, 2 MCP calls, 0 repairs, and 63,391 input / 1,341 output tokens. Structural validation passed, but human-assisted review identified three error-bearing claims: a mismatched source citation, an uncited named variant, and an incorrect numeric lower bound. A separate edited derivative was signed off by Chris Lawrence, RN on September 22, 2026, with partial factual coverage disclosed. It is not unassisted model success.

TNF passed scripted integration through the real MCP server. Live TNF scientific evaluation is not completed. Both targets use 300-row frozen evidence captures, not exhaustive or representative evidence samples. There is no held-out benchmark, official-MCP comparison, independent publication review, or specialist validation. See evaluation details and limitations.

Quick start — Python 3.12

From this repository directory:

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.lock
python -m pip install --no-deps --no-build-isolation -e .
python -m pytest -q
PYTHONPATH=src python -m ot_dossier.agent.loop --target NOD2 --out generated/demo-nod2-01

Dependency installation needs network access once. Tests and this scripted demo use frozen data and no model API. Expected demo result: two MCP calls and zero repairs. Use a new output directory on each run; the agent refuses overwrite. The loop launches its own stdio MCP server. Open generated/demo-nod2-01/dossier.md and result.json afterward.

For deterministic source-observation drafts without the agent loop:

PYTHONPATH=src python -m ot_dossier.cli --target NOD2 --out generated
PYTHONPATH=src python -m ot_dossier.cli --target TNF --out generated

The ordinary CLI overwrites its named draft outputs in the specified directory; the agent's per-run directories are immutable by convention and protected from overwrite by the host. Installed entry points are ot-dossier and ot-dossier-mcp. See the beginner MCP walkthrough or optional paid live-run guide. Keep API keys out of files and Git.

The supported runtime is an editable checkout: fixtures and skill files are loaded from the repository. Wheel-only deployment and remote hosting are not supported.

Architecture and reproducibility

Open Targets GraphQL → frozen cassettes + checksum manifest
                                  ↓
                         deterministic assembler
                                  ↓
                         typed EvidencePacket
                                  ↓
                 two stdio MCP tools ↔ bounded agent host
                                  ↓
                   required validation → JSON + Markdown
                                  ↓
                      attributed human/assistant review

Architecture explains the code boundaries. Packet IDs and record IDs are content-derived; provenance retains cassette names, response hashes, and JSON pointers. Frozen replay is reproducible, but a fresh API query need not return the same evidence. Verification records the checks; the pre-upload audit includes a clean installation and 84 passing tests.

Frozen data release 26.06

NOD2

TNF

Captured evidence rows

300

300

Upstream matching rows

4,003

20,990

Direct / descendant rows

31 / 269

64 / 236

Curated target safety records returned

0

9

Clinical context is limited to drug-bearing rows in that evidence capture. An empty result is not proof of safety or absence of drugs. Source-reported APPROVAL stays with its exact indication; PHASE_4 is not converted to approval.

The source reference case contains five reviewed source facts and five prohibited inferences; its metadata distinguishes human source review from publication-level validation. The artifact index separates original outputs, scripted runs, review findings, and edited derivatives.

Scope and attribution

No UI, deployment, ranking, RAG/vector database, additional biomedical source, official-MCP comparator, or large benchmark. See scope decisions.

Code: Apache-2.0. Open Targets Platform data is marked CC0; retain upstream attribution and consult its licensing and citation guidance. Only queried fields are frozen; no paper full text is redistributed. Sources and NOTICE document attribution. No endorsement by Open Targets, Anthropic, or a data provider is implied.

Available Tools

2 tools
assemble_target_disease_evidenceC

Replay frozen evidence for NOD2/TNF and IBD. Returns scoped records and typed missingness.

Inputs: target (required), disease. Returns: target, records, release, endpoint, +6 more

validate_dossier_referencesC

Check references and structured assertions against a previously assembled packet. Not entailment.

Inputs: dossier (required), packet_id (required). Returns: scope, valid, findings

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools have distinct verbs and roles: one assembles/replays evidence, the other validates references against an assembled packet. They are part of the same pipeline, which introduces mild sequencing ambiguity, but a careful reading of the descriptions clearly separates their purposes.

    Naming Consistency5/5

    Both tools use snake_case with a leading verb (assemble_..., validate_...) and noun-phrase tails. The verb_noun pattern is consistent throughout, with no style mixing.

    Tool Count3/5

    Only 2 tools is on the thin side, though the server's scope (a single frozen evidence dossier workflow) is narrow enough that this is borderline rather than clearly wrong. A few more operations would make it feel better scoped.

    Completeness3/5

    The surface covers an assemble-and-validate loop but appears locked to one hardcoded disease pair (NOD2/TNF and IBD) with no discovery, listing, or update operations, and no way to build or modify the underlying packet. Notable gaps remain for a general dossier workflow.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers