Skill Tracer
Skills › Scientific Agent Skills › folklore-variant-evidence › mcp-contract.md

mcp-contract.md

205 lines · skills/folklore-variant-evidence/references/mcp-contract.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Folklore Clinical Variant Interpretation MCP public contract
2
3Use this reference when constructing calls or interpreting public results.
4Reviewed 2026-09-30 against adapter 1.5.0, official source commit
5`fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b`, and live discovery/calls. Discover the
6live schemas rather than assuming the published adapter source and deployment
7are identical.
8

Folklore Clinical Variant Interpretation MCP public contract

Use this reference when constructing calls or interpreting public results. Reviewed 2026-09-30 against adapter 1.5.0, official source commit fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b, and live discovery/calls. Discover the live schemas rather than assuming the published adapter source and deployment are identical.

Raw lines 1 to 8
Uses an outside tool MCP :1
9## Connection
11- Endpoint: `https://api.helena.bio/folklore/v1/mcp`
12- Authentication: none
13- Transport: stateless Streamable HTTP
14- Publisher: Helena Bioinformatics
15- Registry identity: `io.github.helena-bioinformatics/folklore`
16- Reviewed modern protocol: `2026-07-28`
18Verify tools with `tools/list` at call time. Do not infer tool availability from
19this skill alone.
21For direct JSON-RPC POST requests, use `Content-Type: application/json` and
22`Accept: application/json, text/event-stream`. Send `MCP-Protocol-Version` plus
23`Mcp-Method` equal to the body `method`; for `tools/call`, send `Mcp-Name` equal
24to `params.name`. Include the protocol version and client capabilities in
25`params._meta`, as in the skill's curl example. The discovery request is:
27```bash
28curl --silent --show-error --fail-with-body --max-time 60 \
29 -X POST https://api.helena.bio/folklore/v1/mcp \
30 -H 'Content-Type: application/json' \
31 -H 'Accept: application/json, text/event-stream' \
32 -H 'MCP-Protocol-Version: 2026-07-28' \
33 -H 'Mcp-Method: tools/list' \
34 -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}'
35```
37`server/discover` is an optional preflight using the same pattern with that
38method in both header and body. It reports supported versions and server
39metadata, without a stateful initialization exchange. This modern recipe does
40not establish compatibility with every legacy MCP client.

Connection

  • Endpoint: https://api.helena.bio/folklore/v1/mcp
  • Authentication: none
  • Transport: stateless Streamable HTTP
  • Publisher: Helena Bioinformatics
  • Registry identity: io.github.helena-bioinformatics/folklore
  • Reviewed modern protocol: 2026-07-28

Verify tools with tools/list at call time. Do not infer tool availability from this skill alone.

For direct JSON-RPC POST requests, use Content-Type: application/json and Accept: application/json, text/event-stream. Send MCP-Protocol-Version plus Mcp-Method equal to the body method; for tools/call, send Mcp-Name equal to params.name. Include the protocol version and client capabilities in params._meta, as in the skill's curl example. The discovery request is:

curl --silent --show-error --fail-with-body --max-time 60 \
  -X POST https://api.helena.bio/folklore/v1/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  -H 'Mcp-Method: tools/list' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}'

server/discover is an optional preflight using the same pattern with that method in both header and body. It reports supported versions and server metadata, without a stateful initialization exchange. This modern recipe does not establish compatibility with every legacy MCP client.

Raw lines 9 to 41
Uses an outside tool MCP :22
42## Read the correct response envelope
44First handle HTTP failure or a JSON-RPC `error`; then inspect MCP `result.isError`
45and `result.structuredContent`. Call that structured object `s` below. Handle any
46non-null `s.adapter_error` before reading scientific fields; preserve its `code`,
47`message` and `retryable`. Invalid inputs can fail validation before reaching a
48scientific status. Retry only a retryable failure, with bounded backoff and any
49`Retry-After` guidance. A live HTTP 429 with JSON-RPC code `-32029` was observed;
50there is no verified universal request quota to hardcode.
52| Tool | Successful structured content |
53|---|---|
54| `search_variant_evidence` | `s.result.status`; identity at `s.result.identity`; interpretation at `s.result.interpretation`; outer `record_url`, `usage_boundary`, `adapter_error` |
55| `search_variant_literature` | Direct `s.status`, `s.variant_result`, and nullable `s.literature`; no extra `s.result` wrapper |
56| `get_publication_details` | `s.publication` and `s.usage_boundary`; no scientific `status` field |
57| `search_literature_corpus` | `s.results`, `returned_count`, pagination and retrieval metadata; no scientific `status` field |
58| Both gene-disease tools | Direct `s.status` (`ok` or `not_found`), `associations`, `pagination`, `source`, `warnings`, `usage_boundary` |
60The evidence envelope has `contract_version: "1"` and its scientific result has
61`search_contract_version: "1.0"`. Literature/details/corpus use
62`contract_version: "1.0"`; gene-disease uses camel-case `contractVersion: "1.0"`.
63Do not impose the evidence envelope on the other tools. Adapter failures for
64literature/details/corpus can use the evidence-style envelope with `result: null`;
65gene-disease failures contain `adapter_error` and `usage_boundary` directly.
66Unrecognized status values or missing required fields are a contract problem,
67not an empty result.
69Preserve complete structured content. The evidence and literature text fallbacks
70are summaries and need not contain all provenance or candidate data.

Read the correct response envelope

First handle HTTP failure or a JSON-RPC error; then inspect MCP result.isError and result.structuredContent. Call that structured object s below. Handle any non-null s.adapter_error before reading scientific fields; preserve its code, message and retryable. Invalid inputs can fail validation before reaching a scientific status. Retry only a retryable failure, with bounded backoff and any Retry-After guidance. A live HTTP 429 with JSON-RPC code -32029 was observed; there is no verified universal request quota to hardcode.

ToolSuccessful structured content
search_variant_evidences.result.status; identity at s.result.identity; interpretation at s.result.interpretation; outer record_url, usage_boundary, adapter_error
search_variant_literatureDirect s.status, s.variant_result, and nullable s.literature; no extra s.result wrapper
get_publication_detailss.publication and s.usage_boundary; no scientific status field
search_literature_corpuss.results, returned_count, pagination and retrieval metadata; no scientific status field
Both gene-disease toolsDirect s.status (ok or not_found), associations, pagination, source, warnings, usage_boundary

The evidence envelope has contract_version: "1" and its scientific result has search_contract_version: "1.0". Literature/details/corpus use contract_version: "1.0"; gene-disease uses camel-case contractVersion: "1.0". Do not impose the evidence envelope on the other tools. Adapter failures for literature/details/corpus can use the evidence-style envelope with result: null; gene-disease failures contain adapter_error and usage_boundary directly. Unrecognized status values or missing required fields are a contract problem, not an empty result.

Preserve complete structured content. The evidence and literature text fallbacks are summaries and need not contain all provenance or candidate data.

Raw lines 42 to 71
Uses an outside tool MCP :44
72## `search_variant_evidence`
74Required input:
76```yaml
77assembly: GRCh38
78query: <one public germline nuclear SNV or simple indel>
79```
81`query` is 1–512 characters. `assembly` defaults to `GRCh38`, but send it
82explicitly for reproducibility. The schema forbids additional arguments.
83The `query` may be a coordinate, genomic/coding/protein HGVS, SPDI, rsID, or a
84returned `canonical_key` in this form:
86```text
87GRCh38:chrN:position:REF:ALT
88```
90The six public outcome states are:
92- `resolved`
93- `ambiguous`
94- `not_found`
95- `invalid_request`
96- `unsupported`
97- `resolution_unavailable`
99Do not collapse these states. In particular, never convert `ambiguous` into
100`resolved`, and never convert `resolution_unavailable` into `not_found`.
101For ambiguity, preserve `total_candidate_count` and `candidates_truncated`;
102the candidate list may contain only the first ten. For resolution, reuse
103`s.result.identity.canonical_key`. Check `s.result.interpretation.status`:
104`success` permits reading the returned classification, whereas `unavailable`
105requires preserving its error despite a resolved identity.

search_variant_evidence

Required input:

assembly: GRCh38
query: <one public germline nuclear SNV or simple indel>

query is 1–512 characters. assembly defaults to GRCh38, but send it explicitly for reproducibility. The schema forbids additional arguments. The query may be a coordinate, genomic/coding/protein HGVS, SPDI, rsID, or a returned canonical_key in this form:

GRCh38:chrN:position:REF:ALT

The six public outcome states are:

  • resolved
  • ambiguous
  • not_found
  • invalid_request
  • unsupported
  • resolution_unavailable

Do not collapse these states. In particular, never convert ambiguous into resolved, and never convert resolution_unavailable into not_found. For ambiguity, preserve total_candidate_count and candidates_truncated; the candidate list may contain only the first ten. For resolution, reuse s.result.identity.canonical_key. Check s.result.interpretation.status: success permits reading the returned classification, whereas unavailable requires preserving its error despite a resolved identity.

Raw lines 72 to 106
107## `search_variant_literature`
109Use only after resolution when composing an automatic workflow:
111```yaml
112assembly: GRCh38
113query: <returned canonical_key>
114question: <optional public scientific focus>
115limit: <1 to 25>
116```
118The optional `question` is 3–500 characters, `limit` defaults to 10, and there is
119no cursor/offset argument for this tool. The response preserves the variant
120result at `s.variant_result` and returns literature at `s.literature` only when
121variant resolution permits it. Preserve `candidate_count`, aliases, corpus
122provenance and limitations; `limit` does not make a page exhaustive. Publication
123match types are `exact_variant`, `variant_alias`, and `gene_association`.

search_variant_literature

Use only after resolution when composing an automatic workflow:

assembly: GRCh38
query: <returned canonical_key>
question: <optional public scientific focus>
limit: <1 to 25>

The optional question is 3–500 characters, limit defaults to 10, and there is no cursor/offset argument for this tool. The response preserves the variant result at s.variant_result and returns literature at s.literature only when variant resolution permits it. Preserve candidate_count, aliases, corpus provenance and limitations; limit does not make a page exhaustive. Publication match types are exact_variant, variant_alias, and gene_association.

Raw lines 107 to 124
125## `get_publication_details`
127Input `{"pmid":"<returned PMID>"}`, a string of 1–12 digits without a `PMID:`
128prefix. Preserve `publication.is_retracted`, bibliographic metadata, source URLs,
129gene mentions, and variant mentions. A `publication_not_found` adapter error
130means no record in this service's corpus, not that the PMID does not exist in
131PubMed. A missing abstract or full-text URL is not a missing publication.

get_publication_details

Input {"pmid":"<returned PMID>"}, a string of 1–12 digits without a PMID: prefix. Preserve publication.is_retracted, bibliographic metadata, source URLs, gene mentions, and variant mentions. A publication_not_found adapter error means no record in this service's corpus, not that the PMID does not exist in PubMed. A missing abstract or full-text URL is not a missing publication.

Raw lines 125 to 132
133## `search_literature_corpus`
135Use for source-linked scientific-literature discovery with a natural-language
136question, publication identifier, gene, variant, phenotype, HPO, or OMIM
137concept. Arguments are `query` (3–200 characters), `limit` (1–25, default 20),
138`sort` (`relevance`, `newest`, `oldest`; default `relevance`) and optional `cursor`.
139Keep all queries public and nonsensitive.
141Use `has_more` and the opaque `next_cursor` for continuation with the same query
142and sort order. Stop if continuation is absent; report a contradictory pagination
143state rather than inventing a cursor. Keep result `match_types`, scores and
144`article_entities` with their source/normalization metadata; these are retrieval
145signals, not pathogenicity probabilities. Corpus match types are not restricted
146to the three variant-literature types above.
148Report `semantic_index_used` and any `semantic_degraded_reason`. The live service
149also advertised and returned `graph_used`, `graph_version`, and
150`graph_degraded_reason` on the review date, although the pinned public adapter's
151corpus model did not declare them. Retain such fields as returned metadata; do
152not assume their presence or infer graph/semantic success from HTTP 200 alone.

search_literature_corpus

Use for source-linked scientific-literature discovery with a natural-language question, publication identifier, gene, variant, phenotype, HPO, or OMIM concept. Arguments are query (3–200 characters), limit (1–25, default 20), sort (relevance, newest, oldest; default relevance) and optional cursor. Keep all queries public and nonsensitive.

Use has_more and the opaque next_cursor for continuation with the same query and sort order. Stop if continuation is absent; report a contradictory pagination state rather than inventing a cursor. Keep result match_types, scores and article_entities with their source/normalization metadata; these are retrieval signals, not pathogenicity probabilities. Corpus match types are not restricted to the three variant-literature types above.

Report semantic_index_used and any semantic_degraded_reason. The live service also advertised and returned graph_used, graph_version, and graph_degraded_reason on the review date, although the pinned public adapter's corpus model did not declare them. Retain such fields as returned metadata; do not assume their presence or infer graph/semantic success from HTTP 200 alone.

Raw lines 133 to 153
154## Gene-disease assertions in adapter 1.5.0
156Request examples (not captured scientific results):
158```json
159{"name":"get_gene_disease_associations","arguments":{"gene":"BRCA1","limit":20,"offset":0}}
160{"name":"search_disease_genes","arguments":{"disease":"Marfan","limit":20,"offset":0}}
161```
163The gene lookup accepts an exact gene symbol or HGNC identifier (1–64
164characters). Disease lookup accepts an exact `MONDO:` plus seven digits or a
165public disease-name substring (3–160 characters). Both have limit 1–50 (default
16620) and offset 0–1000 (default 0). Preserve distinct disease matches and follow
167`pagination.nextOffset` while present. Do not invent offsets beyond 1000. When
168the ceiling prevents completion, `nextOffset` can be null while rows remain;
169preserve the warning and compare `offset + len(associations)` with `total` before
170calling retrieval complete. An out-of-range page can be empty with `status: ok`
171when `total > 0`; `not_found` means `total == 0`.
173Successful structured output directly carries query, associations, pagination, source, warnings and usage_boundary. Read JSON-RPC and adapter errors before interpreting output. The source is ClinGen Gene-Disease Validity; preserve assertion-specific inheritance, assessment, source links and dates. Missing source values stay unavailable. No result does not establish no association, and association validity is not variant pathogenicity.
175Record `source.version`, `source.snapshotSha256`, and `source.downloadUrl`.
176These describe the deployed local snapshot and do not guarantee the newest
177ClinGen release. Preserve source assertions separately, including disputed
178assessments; avoid collapsing them into a single gene-wide classification.

Gene-disease assertions in adapter 1.5.0

Request examples (not captured scientific results):

{"name":"get_gene_disease_associations","arguments":{"gene":"BRCA1","limit":20,"offset":0}}
{"name":"search_disease_genes","arguments":{"disease":"Marfan","limit":20,"offset":0}}

The gene lookup accepts an exact gene symbol or HGNC identifier (1–64 characters). Disease lookup accepts an exact MONDO: plus seven digits or a public disease-name substring (3–160 characters). Both have limit 1–50 (default 20) and offset 0–1000 (default 0). Preserve distinct disease matches and follow pagination.nextOffset while present. Do not invent offsets beyond 1000. When the ceiling prevents completion, nextOffset can be null while rows remain; preserve the warning and compare offset + len(associations) with total before calling retrieval complete. An out-of-range page can be empty with status: ok when total > 0; not_found means total == 0.

Successful structured output directly carries query, associations, pagination, source, warnings and usage_boundary. Read JSON-RPC and adapter errors before interpreting output. The source is ClinGen Gene-Disease Validity; preserve assertion-specific inheritance, assessment, source links and dates. Missing source values stay unavailable. No result does not establish no association, and association validity is not variant pathogenicity.

Record source.version, source.snapshotSha256, and source.downloadUrl. These describe the deployed local snapshot and do not guarantee the newest ClinGen release. Preserve source assertions separately, including disputed assessments; avoid collapsing them into a single gene-wide classification.

Raw lines 154 to 179
180## Reviewed sources and execution scope
182- [Hosted technical guide](https://folklore.helena.bio/docs/folklore-connector)
183- [Protocol compatibility](https://github.com/helena-bioinformatics/folklore-mcp/blob/fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b/docs/COMPATIBILITY.md)
184- [Tool response construction](https://github.com/helena-bioinformatics/folklore-mcp/blob/fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b/src/folklore_mcp_service/presentation/mcp.py)
185- [Variant contracts](https://github.com/helena-bioinformatics/folklore-mcp/blob/fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b/src/folklore_mcp_service/domain/contracts.py)
186- [Literature contracts](https://github.com/helena-bioinformatics/folklore-mcp/blob/fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b/src/folklore_mcp_service/domain/literature_contracts.py)
187- [Gene-disease contracts](https://github.com/helena-bioinformatics/folklore-mcp/blob/fef7220d66f99c3c021f8eee1cdd6b8ea4b0a64b/src/folklore_mcp_service/domain/gene_disease_contracts.py)
189Live read-only public requests verified discovery, ambiguity, resolved identity,
190variant-linked literature, publication details, both gene-disease tools, and
191corpus/gene pagination. Eleven successful captured responses passed validation
192against their live tool output schemas; invalid-argument calls returned typed
193adapter errors separately.
194The unavailable/degraded branches and the gene-disease pagination ceiling were
195source-reviewed, not forced in the live service. These checks establish observed
196protocol behavior, not clinical accuracy, source completeness, or host UI support.

Reviewed sources and execution scope

Live read-only public requests verified discovery, ambiguity, resolved identity, variant-linked literature, publication details, both gene-disease tools, and corpus/gene pagination. Eleven successful captured responses passed validation against their live tool output schemas; invalid-argument calls returned typed adapter errors separately. The unavailable/degraded branches and the gene-disease pagination ceiling were source-reviewed, not forced in the live service. These checks establish observed protocol behavior, not clinical accuracy, source completeness, or host UI support.

Raw lines 180 to 197
198## Interpretation boundary
200- Folklore Clinical Variant Interpretation MCP accepts no patient, phenotype,
201 family, segregation, or private case data.
202- Results support qualified professional review.
203- Results are not a diagnosis or treatment recommendation.
204- Literature associations do not alter an ACMG/AMP classification.
205- An empty bounded result does not establish universal absence.

Interpretation boundary

  • Folklore Clinical Variant Interpretation MCP accepts no patient, phenotype, family, segregation, or private case data.
  • Results support qualified professional review.
  • Results are not a diagnosis or treatment recommendation.
  • Literature associations do not alter an ACMG/AMP classification.
  • An empty bounded result does not establish universal absence.
Raw lines 198 to 205
Uses an outside tool MCP :200