TogoMCP
TogoMCP lets an AI assistant query dozens of life-science databases through one MCP server — SPARQL against RDF Portal knowledge graphs plus a set of REST API wrappers — with built-in schema guidance (MIE files) and ID-conversion tools to join them up.
Guided SPARQL over RDF databases —
run_sparqlagainst ~37 registered databases (UniProt, PDB, ChEMBL, ChEBI, PubChem, Reactome, Rhea, Ensembl, NCBI Gene, ClinVar, MedGen, MeSH, GO, MONDO, PubMed, PubTator, BacDive, MediaDive, GlyCosmos, Bgee, OMA, BRENDA, HGNC, jPOST, MassBank, NBRC, GWAS Catalog, TogoVar, etc.), including cross-database queries on shared endpoints.Schema/endpoint discovery —
get_MIE_file(ShEx schema + RDF/SPARQL examples per database),get_sparql_endpoints,get_graph_list(named graphs, so queries can be pinned correctly).Workflow guidance —
TogoMCP_Usage_Guidereturns a step-by-step protocol (classify → plan → pick databases → ground IRIs → read MIE → query) and warns about co-tenancy/pitfalls.Entity resolution / ID lookup —
search_uniprot_entity,search_pdb_entity,search_mesh_descriptor,search_reactome_entity,search_rhea_entity,search_chembl_target/search_chembl_molecule/search_chembl_id_lookup,get_pubchem_compound_id,get_compound_attributes_from_pubchem.Cross-database ID conversion (TogoID) —
togoid_convertId,togoid_countId,togoid_getRelation(s),togoid_getAllDataset,togoid_getDataset,togoid_getDescription(e.g. NCBI Gene ↔ UniProt ↔ PDB ↔ Ensembl ↔ ChEMBL).NCBI E-utilities —
ncbi_esearch,ncbi_esummary,ncbi_efetch,ncbi_list_databasesfor gene, taxonomy, ClinVar, MedGen, MeSH, PubMed, PubChem.Human variant / population-frequency search (TogoVar) —
togovar_search_gene,togovar_search_disease,togovar_search_variant(gnomAD, ToMMo, NCBN, GEM-J, JGA, BBJ frequencies, ClinVar/MGeND significance, SIFT/PolyPhen/AlphaMissense).Reproducible research support — a
record_for_paperprompt/query-provenanceworkflow producing a re-runnable ledger,PROVENANCE.mdandMETHODS.md, plus optional JSONL tool-call logging.Deployment options — hosted remote server, local
uv/stdio install, or Docker/Compose (with optional opt-in KEGG tools on local stdio only).
Provides tools for searching and retrieving biomedical literature from PubMed, including access to citations and abstracts via NCBI E-utilities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TogoMCP retrieve the UniProt entry for human p53"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TogoMCP: An MCP Server for Life-Science Databases
An MCP (Model Context Protocol) server that gives AI assistants (Claude, etc.) access to biological and biomedical RDF databases via SPARQL — mostly at the RDF Portal, plus a few databases' own public endpoints (GlyCosmos, TogoVar, WikiPathways, IDSM, LIPID MAPS, SwissLipids, MarpolBase) — as well as selected REST APIs (NCBI E-utilities, UniProt, ChEMBL, PDB, PubChem, Reactome, Rhea, MeSH, TogoID, TogoVar, PubCaseFinder).
Quick Start: Remote Server (No Installation)
You can use the hosted TogoMCP server directly — no local setup needed.
See https://togomcp.rdfportal.org/ for connection instructions.
Related MCP server: BioContextAI Knowledgebase MCP
Local Installation
Prerequisites
Python >= 3.11
uv package manager
1. Install uv
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"2. Clone and install
git clone https://github.com/dbcls/togomcp.git
cd togomcp
uv sync3. Set NCBI API Key (required for NCBI tools)
Obtain your NCBI API key and export it:
export NCBI_API_KEY="your-key-here"Configuration
Claude Desktop
Edit your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
~\AppData\Roaming\Claude\claude_desktop_config.json
{
"mcpServers": {
"togomcp": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/togomcp",
"run",
"togo-mcp-local"
],
"env": {
"NCBI_API_KEY": "your-key-here"
}
}
}
}Tip: Run
which uv(macOS/Linux) orwhere uv(Windows) to find the full path touv.
Note on KEGG: TogoMCP does not enable KEGG by default. The
kegg_*tools requireTOGOMCP_ENABLE_KEGG=1and the localstdioserver, because the KEGG API is licensed to academic users at academic institutions. If that is not you, simply leave it unset and everything else works normally. See KEGG (opt-in, localstdioonly).
Docker
A Dockerfile is provided for containerized deployment.
Recommended: docker compose
compose.yaml defines two services — togomcp-main (port 8000) and togomcp-test (port 8001) — so you can run a main and a test endpoint side by side from the same image (for local and development use).
cp .env.example .env # then fill in NCBI_API_KEY
docker build -t localhost/togo-mcp:latest . # build main image (tag in .env)
docker compose up -d togomcp-main # start main endpointCommon operations:
docker compose logs -f togomcp-main # tail logs
docker compose down # stop and remove all services
docker compose down togomcp-test # stop and remove just one
docker compose up -d togomcp-test # after rebuilding, recreates with new imageOverride image tags and host ports via .env — see .env.example for the full list. Use docker compose up -d --force-recreate <svc> if compose doesn't pick up a rebuilt image, and docker image prune -f to clean up dangling layers.
Behind a reverse proxy
Two env vars matter if you put TogoMCP behind nginx/Caddy/Traefik. Both fail in ways that are easy to misdiagnose:
TOGOMCP_ALLOWED_HOSTS— FastMCP validates theHostheader (DNS-rebinding protection) and answers 421 for any host not on the allow-list. The default list is localhost plus the public DBCLS vhosts, so your own hostname must be added or every proxied request is rejected.TOGOMCP_FORWARDED_ALLOW_IPS— which peer addresses may setX-Forwarded-Proto/-For. uvicorn parses those headers but trusts only127.0.0.1unless told otherwise, and a container reached via a published port never arrives as loopback. Left wrong, the header is silently dropped (not rejected): the app then believes it is serving plain HTTP and emits redirects that downgradehttps://tohttp://. The default covers the usual container-runtime ranges; set this only if your proxy sits elsewhere.
Your proxy must also send X-Forwarded-Proto — nginx does not by default (proxy_set_header X-Forwarded-Proto $scheme;), while Caddy and Traefik do. Both halves are required; neither works alone.
Simple: docker run
For a single container without compose:
docker build -t togo-mcp .
docker run -e NCBI_API_KEY="your-key-here" -p 8000:8000 togo-mcpTool-Call Logging (Optional)
TogoMCP can record every MCP tool call as one JSON line per call (timestamp,
tool name, arguments, status, elapsed_ms, session/request/client IDs, transport,
client IP). SPARQL calls are enriched with endpoint URL, HTTP code, row/byte
counts, and a SHA-256 of the query. Note the client IP is the peer address as
the app sees it — behind a proxy or container that is the proxy/gateway, the same
value for every caller, unless TOGOMCP_FORWARDED_ALLOW_IPS lets uvicorn trust
X-Forwarded-For. Useful for benchmarking, MIE iteration,
and reconstructing multi-tool sequences.
The IP is recorded as a salted hash (ip_hash) by default. Set
TOGOMCP_LOG_RAW_IP=1 to also record it in the clear as ip, which is what
lets an abusive caller be identified and blocked — at the cost of making the log
personal data (and /stats/log serves it verbatim to whoever holds the dashboard
credentials). Full field-by-field reference, including the privacy model, is in
log_file_specs.md.
On/off is a single env var: TOGOMCP_QUERY_LOG. Unset/empty = disabled
(zero-overhead default). Set to a writable file path to enable.
Output uses RotatingFileHandler (50 MB × 10, ~500 MB cap).
Docker
compose.yaml bind-mounts ./logs (and ./logs-test) on the host to
/var/log/togomcp inside each container and passes through TOGOMCP_QUERY_LOG
/ TOGOMCP_QUERY_LOG_TEST from .env. Opt in:
echo 'TOGOMCP_QUERY_LOG=/var/log/togomcp/togomcp.jsonl' >> .env
mkdir -p logs
docker compose up -d togomcp-main
tail -f logs/togomcp.jsonlThe path in the env var is the container-side path; the bind mount makes
the same file visible at ./logs/togomcp.jsonl on your host. Leaving the var
unset keeps logging off — no compose changes needed.
Claude Desktop (local stdio)
Add TOGOMCP_QUERY_LOG to the env block alongside NCBI_API_KEY. Use an
absolute path (the spawned process's cwd is unpredictable) and ensure the
parent directory exists:
"env": {
"NCBI_API_KEY": "your-key-here",
"TOGOMCP_QUERY_LOG": "/Users/you/togomcp-logs/togomcp.jsonl"
}Then mkdir -p ~/togomcp-logs once and fully restart Claude Desktop.
Available Databases & Tools
TogoMCP exposes tools for querying the following (via SPARQL or REST APIs):
Category | Resources |
Proteins / Proteomics | UniProt, PDB, jPOST |
Genes / Genomics | NCBI Gene, Ensembl, HGNC, OMA, Bgee, HCO, MCO, DDBJ, MoG+, TogoVar, JoGo, GWAS Catalog, Fanta.bio, TiSMeD, MarpolBase |
Chemistry | ChEMBL, PubChem, ChEBI, Rhea, BRENDA, MassBank, IDSM |
Lipidomics | LIPID MAPS, SwissLipids |
Pathways | Reactome, WikiPathways |
Disease / Clinical | ClinVar, MedGen, MONDO, NANDO, PubCaseFinder |
Literature | PubMed, PubTator |
Microbiology | BacDive, MediaDive, AMR Portal, NBRC |
Glycomics | GlyCosmos |
Ontologies / Vocabulary | MeSH, GO, Ontology Graphs (HP, UBERON, CL, SO, ECO, EFO, PRO, FMA, …) |
Taxonomy | NCBI Taxonomy |
Materials Science | SuperCon |
Identifier conversion | TogoID |
KEGG (opt-in, local stdio only)
KEGG is off by default. You do not need it, and TogoMCP is fully functional without it — this section only matters if you are eligible and want it.
A kegg tool group (kegg_find, kegg_get_entry, kegg_pathway_graph,
kegg_pathway_neighborhood, kegg_pathway_paths, kegg_pathway_cycles,
kegg_link, kegg_conv) is mounted only when both conditions hold:
you run the local
stdioentry pointtogo-mcp-local, andyou set
TOGOMCP_ENABLE_KEGG=1.
Why two gates, for two different reasons:
The transport gate is structural and not configurable. The KEGG API is provided "for academic use by academic users belonging to academic institutions", and offering a service built on KEGG additionally requires an academic service-provider license (see KEGG's terms). A public host cannot verify a caller's affiliation, so the hosted server at togomcp.rdfportal.org — and any HTTP deployment — never reaches
rest.kegg.jp. No environment variable can change this;TOGOMCP_ENABLE_KEGGhas no effect on the HTTP path at all.The opt-in exists because eligibility is yours to assert. Under
stdioyou are the caller, but only you know whether your institution's access covers you. Mounting KEGG by default would put an API call you may not be entitled to make on the path of least resistance — an AI assistant will use any tool it can see. Leaving the variable unset is the correct configuration for a non-academic user, and nothing else is affected.
Enable it in your Claude Desktop config:
"env": {
"NCBI_API_KEY": "your-key-here",
"TOGOMCP_ENABLE_KEGG": "1"
}Calls are capped at 3 requests per second (TogoMCP enforces this process-wide, and
never retries an HTTP 403/429). KEGG is not part of RDF Portal: it has no SPARQL
endpoint, so database="kegg" is invalid in run_sparql. Use kegg_conv to translate
KEGG identifiers to UniProt, NCBI Gene/Protein, ChEBI or PubChem before querying any RDF
database with them.
Example Prompts
Once connected, you can ask your AI assistant things like:
"Find all human proteins associated with Alzheimer's disease in UniProt."
"Run a SPARQL query on the ChEMBL database to find compounds targeting EGFR."
"Search PubMed for recent papers on CRISPR base editing."
"What pathways involve the TP53 gene in Reactome?"
Results for a paper
If you will use the results in a paper, say so at the start of the investigation (e.g. "I will use
this in a paper; record the queries"), or choose the MCP prompt Record this investigation for a
paper (record_for_paper) from your client's prompt menu. The assistant then follows the
query-provenance workflow: it records the exact tool calls behind each finding in a ledger.yaml,
re-runs them to confirm the results, and writes PROVENANCE.md and a draft METHODS.md. Anyone can
re-run a ledger later with scripts/togomcp_reproduce.py, which sends
the SPARQL queries straight to the endpoints:
uv run scripts/togomcp_reproduce.py ledger.yamlSaying it only at the end also works, but in a long conversation the exact text of early queries may no longer be recoverable. Some clients, Claude Desktop among them, do not pass the server's guidance to the model before its first tool call, so they will not start this workflow unless you ask. If the prompt is not in the menu, disconnect and reconnect TogoMCP: clients keep the prompt list from when they first connected.
Directory Structure
togomcp/
├── togo_mcp/ # Main Python package
│ ├── server.py # Root FastMCP instance + tool-call logging middleware
│ ├── main.py # Assembles the server, mounts sub-servers, entry points
│ ├── rdf_portal.py # RDF Portal / SPARQL, MIE, and endpoint tools
│ ├── api_tools.py # REST search wrappers (UniProt, PDB, Reactome, MeSH, PubChem, etc.)
│ ├── chembl.py # ChEMBL REST search wrappers
│ ├── ncbi_tools.py # NCBI E-utilities sub-server
│ ├── togoid.py # TogoID identifier-conversion sub-server
│ ├── togovar.py # TogoVar human-variation sub-server
│ ├── pubcasefinder.py # PubCaseFinder phenotype-ranking / case-report sub-server
│ ├── skills.py # Agent Skills registry (served by get_workflow and as skill:// resources)
│ ├── kegg.py # KEGG sub-server — mounted by togo-mcp-local ONLY (licence, see above)
│ ├── kgml.py # KGML -> signed pathway graph (pure; no network, no FastMCP)
│ ├── stats.py # Tool-call usage-log analysis
│ └── data/ # Bundled data files (included in wheel)
│ ├── mie/ # MIE files (YAML, one per database)
│ ├── docs/ # Developer documentation (MIE spec, examples)
│ ├── resources/ # Static resources (endpoints.csv, usage guide, etc.)
│ └── skills/ # Public Agent Skills (served by get_workflow)
├── benchmark/ # Benchmark question set, scripts, and results
├── scripts/ # Utility/maintenance scripts (deploy, Docker, MIE keywords)
├── tests/ # Pytest test suite
├── tutorial/ # Workshop materials (slides, handbook, hands-on, instructor script)
├── Dockerfile # Docker build configuration
├── compose.yaml # Docker Compose (main + test services)
├── pyproject.toml # Python project metadata and entry points
└── uv.lock # Locked dependency versions (uv)Contributing
Contributions are welcome!
Adding a database: five places, not two. Only the first two affect what the server validates; the rest are documentation surfaces that drift silently, and the tests are what catch them.
togo_mcp/data/resources/endpoints.csv— the registry row (this alone decides validdatabase=values).togo_mcp/data/mie/<db>.yaml— the MIE file (see the MIE spec intogo_mcp/data/docs/).uv run python scripts/generate_usage_guide_catalog.py— regenerates the Usage Guide's database catalog. Guarded bytests/test_catalog_in_sync.py.togo_mcp/data/resources/usage_guide_v7/02_budgets_and_discovery.md— a hand-written copy of the registry that no generator touches. Bump the per-endpoint count and add the key. Guarded byTestUsageGuideEndpointTableintests/test_server.py.togo_mcp/data/docs/togomcp-intro.html— add a card to the database grid (not generated), and the same card totogomcp-intro-ja.html. Guarded bytests/test_trial_pages.py, which requires the two pages to match.
Note that a database removal really is just step 1: nothing validates against the other four.
Adding a tool: pass annotations=READ_ONLY_TOOL to the @mcp.tool decorator. Every TogoMCP tool is read-only, and MCP's default for an unannotated tool is the unsafe one — clients such as ChatGPT treat a tool with no readOnlyHint as a write action, which means a confirmation prompt on every call. A test asserts this, so omitting it fails the build.
Please open an issue or pull request on GitHub.
References
The system paper — describes TogoMCP as a whole (based on MIE v2):
Kinjo, A. R., Yamamoto, Y., Bustamante-Larriet, S., Labra-Gayo, J.-E., & Fujisawa, T. (2026). TogoMCP: Natural Language Querying of Life-Science Knowledge Graphs via Schema-Guided LLMs and the Model Context Protocol. Database 2026:baag042. https://doi.org/10.1093/database/baag042
The MIE v3 report — the ablation study behind the current MIE format. Removing any single MIE section (or any whole functional group) turned out to be statistically null, while removing the MIE entirely cost 0.9 points out of 20 — heavy redundancy, with the query-construction content alone recovering 99% of the total effect. MIE v3 reorganizes around that evidence, matching v2 answer quality at n=100 benchmark questions while using 15% fewer input tokens and running 6% faster:
Kinjo, A. R., & Yamamoto, Y. (2026). Measure before you rewrite: ablation-driven redesign of LLM-facing RDF schema documentation in TogoMCP. BioHackrXiv. https://doi.org/10.37044/osf.io/6v5ra_v1
The measured version of the server is archived as release v2.0.0: https://doi.org/10.5281/zenodo.21543297
License
This project is licensed under the MIT License.
The MIT licence covers this code only, not the data or the third-party APIs it
reaches — each carries its own terms, and you are the caller. Most RDF Portal
databases are open, but note in particular that the KEGG API (kegg_* tools,
opt-in and local stdio only) is licensed to academic users at academic institutions
and requires a separate academic service-provider licence to redistribute as a
service — which is why it is off by default and the hosted server does not expose it at
all. See KEGG (opt-in, local stdio only).
Available Tools
33 toolsget_compound_attributes_from_pubchemGet PubChem compound attributesARead-only
Get core attributes of one PubChem compound: IUPAC name, molecular formula, molecular weight, SMILES, InChI, its identifiers.org IRI and a structure-image URL. Served by a DBCLS SPARQList API over PubChem RDF (https://togodx.dbcls.jp/human/sparqlist/api/metastanza_pubchem_compound).
RETURNS a JSON array string with one object for the CID (keys ID, URL,
label, molecular_formula, molecular_weight, SMILES, InChI,
formula_img). An unknown CID is NOT an error: it returns the same object with
label, molecular_formula, SMILES and InChI as empty strings — treat an
empty label as "not found". On upstream/HTTP
failure this tool does NOT raise — it returns a plain string beginning with
"Error:" (not JSON). check for the "Error:" prefix before parsing.
Inputs: pubchem_compound_id (required). Returns: result
get_graph_listList graphs on a SPARQL endpointARead-only
Get a list of named graphs on a SPARQL endpoint. database is required.
Endpoints are the same registry run_sparql uses: RDF Portal (https://rdfportal.org/)
for most databases, plus the external endpoints run_sparql's description names.
RETURNS a CSV-formatted list of named graphs (database-name matches first). On missing endpoint selection it returns a string beginning with 'Error:' — check for that prefix before use.
Graph URIs containing the database substring (case-insensitive) are ranked first,
always — useful when the endpoint hosts multiple databases (e.g. SIB hosts UniProt +
Rhea + Bgee + OMA). Virtuoso/OpenLink internal graphs are filtered out unless
include_system=True.
The endpoint URL is resolved with the same priority used by run_sparql:
endpoint_url > endpoint_name > database. If only database is given it must be
in the registry; otherwise pass endpoint_url (or endpoint_name if its parent
endpoint is registered) to bypass that check, and the required database value then
serves only as the ranking hint.
Inputs: database (required), endpoint_url, endpoint_name, include_system. Returns: result
get_MIE_fileGet database schema (MIE file)ARead-only
At the start of any task, identify ALL databases needed and call this tool for EACH of them before writing any SPARQL queries. Do not query a database until its MIE file has been read. Get the MIE (Metadata Interoperability Exchange) file for a specific RDF database: its graphs to pin, database-wide gotchas, live-verified SPARQL examples and ID join map. RETURNS the MIE file as a YAML-formatted string; an unknown database returns a string beginning with 'Error:' that lists the valid database names. Part of the workflow in TogoMCP_Usage_Guide, which says which databases a question needs.
Inputs: db, dbname, database. Returns: result
get_pubchem_compound_idLook up PubChem compound IDARead-only
Get the PubChem compound ID(s) (CID) for a compound name, via the PubChem PUG-REST name lookup (https://pubchem.ncbi.nlm.nih.gov/rest/pug/). The name is matched against PubChem synonyms (common, IUPAC, trade names), so one name can map to more than one CID.
RETURNS PubChem's JSON verbatim as a string:
{"IdentifierList": {"CID": [445154, ...]}}. On
upstream/HTTP failure this tool does NOT raise — it returns a plain string
beginning with "Error:" (not JSON). check for the "Error:" prefix before
parsing.
Inputs: compound_name (required). Returns: result
get_sparql_endpointsList SPARQL endpointsARead-only
Get the registered SPARQL endpoints: most on RDF Portal (https://rdfportal.org/), some run externally by the database's own provider (e.g. GlyCosmos, WikiPathways).
RETURNS a dict with two keys: databases (maps each database ->
{url, endpoint_name, keyword_search}) and endpoints (maps each
endpoint_name -> {url, databases}).
Inputs: no named parameters. Returns: object
get_workflowGet workflow or guide sectionARead-only
Retrieve a TogoMCP workflow: a multi-step analysis protocol that drives the TogoMCP tools. Workflows also cover requests about results, not only analysis questions: name="query-provenance" records, re-runs and packages the exact queries behind a result, for saving, citing or reproducing it (e.g. for a paper). Call with no arguments to list available workflows. Call with name to get its SKILL.md. Relative links inside it (e.g. references/x.md) are fetched with get_workflow(name, path="references/x.md"). Read-only. RETURNS a text listing, or a short header (files + sizes, digest) followed by the raw SKILL.md, or the raw requested file. An unknown name or an invalid path returns a string beginning with 'Error:' (listing the valid names or files); retrying the same arguments will not change the result. Also serves the TogoMCP Usage Guide's on-demand reference files: get_workflow(name="usage-guide", path="references/").
Inputs: name, path. Returns: result
ncbi_efetchFetch NCBI records (EFetch)ARead-only
Fetch full records for known IDs from NCBI E-utilities EFetch (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi), e.g. sequences in FASTA, GenBank flat files, or PubMed records. Use after ncbi_esearch has produced the IDs.
RETURNS a text item holding the raw record text exactly as NCBI sends it, in the
format chosen by rettype/retmode (default XML). Valid combinations differ by
database (e.g. protein/nuccore accept fasta and gb; pubmed accepts
abstract and medline). On missing database, empty ids or an HTTP error
it returns a single text item beginning with "Error" — check for that prefix
before use.
Inputs: db, id, ids, retmode, +2 more.
ncbi_esearchSearch NCBI databases (ESearch)ARead-only
Search NCBI Entrez databases with E-utilities ESearch (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi) and return the matching record IDs, for use with ncbi_esummary / ncbi_efetch or as SPARQL anchors.
Recall depends heavily on NCBI field tags for Gene, ClinVar and similar databases: an untagged query is matched loosely and misses most relevant records. Gene field tags: • [Organism] - taxonomic filter (e.g. "Homo sapiens[Organism]", "Archaea[Organism]") • [Gene Name] - gene symbol (e.g. "TP53[Gene Name]", "nifH[Gene Name]") • [All Fields] - broad keyword (e.g. "nitrogenase[All Fields]")
Measured on Gene for archaeal nitrogenase genes: • query="Archaea[Organism] AND (nifH[Gene Name] OR nitrogenase[All Fields])" → ~1,300 records (full recall) • query="archaea AND nifH" → ~300 records (~23% recall)
RETURNS formatted text results carrying the database-specific IDs. On a
missing/invalid database or query it returns a single text item whose
message begins with "Error:" — check for that prefix before using the IDs.
Inputs: db, term, query, retmax, +6 more.
ncbi_esummaryGet NCBI record summaries (ESummary)ARead-only
Fetch document summaries for known IDs from NCBI E-utilities ESummary (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi): title, names, organism, dates and similar per-record fields, lighter than ncbi_efetch. Use after ncbi_esearch has produced the IDs.
RETURNS a text item holding the parsed JSON summary data. On a
missing/invalid database or empty ids it returns a single text item
whose message begins with "Error:" — check for that prefix before use.
Inputs: db, id, ids, database.
ncbi_list_databasesList NCBI databasesARead-only
List the NCBI Entrez databases these tools are tuned for (gene, taxonomy, clinvar, medgen, mesh, pubmed, PubChem compound/substance/assay, …), with a description, ID type, example query and supported field tags for each. Makes no network call.
RETURNS a single text item: a plain-text list, one block per database. Gene and
ClinVar queries need field tags (e.g. BRCA1[Gene Name]) to be precise; each
block lists the tags that database supports.
Inputs: no named parameters.
pubcasefinder_get_case_reportsGet case reports (PubCaseFinder)ARead-only
List published case reports for a rare disease, newest first.
PubCaseFinder's curated case-report index per MONDO disease. lang="en" lists
PubMed case reports; lang="ja" lists Japanese-language articles from J-STAGE
(with J-GLOBAL links), which no other TogoMCP source covers. The selection is
text-mining based, so it is NOT reproducible with a MeSH query over the pubmed
RDF (for Marfan syndrome, 507 of the 1,615 reports also in that RDF carry no
Marfan syndrome MeSH heading).
RETURNS a JSON object string: {mondo_id, lang, total_count, returned, has_more, results}. English rows are {pmid, title, journal, year, url}; Japanese rows are
{title, journal, year, jstage_url, jglobal_url}. total_count 0 means no
reports are indexed for that ID — upstream answers an unknown MONDO ID the same
way, so confirm the ID (e.g. from pubcasefinder_rank_by_phenotypes mondo_ids)
before reporting "no case reports".
RAISES ValueError on a malformed MONDO ID, when the shared PubCaseFinder rate budget (10/min, 100/h, 1,000/day for the whole server) is exhausted, and on any HTTP error. Repeated calls are cached.
Inputs: mondo_id (required), lang, limit. Returns: result
pubcasefinder_rank_by_phenotypesRank diseases by phenotypes (PubCaseFinder)ARead-only
Rank rare diseases (or genes) by how well they match a set of HPO phenotypes.
PubCaseFinder's differential-diagnosis ranking: an information-content-weighted similarity between the given phenotypes and every OMIM disease, Orphanet disease or gene profile, computed over the HPO hierarchy — a disease annotated with a more specific child term still matches. SPARQL cannot reproduce this: an "all of these phenotypes" query returns an unordered set and drops partial matches. It is decision support over annotations, NOT a diagnosis.
RETURNS a JSON object string: target; query_phenotypes (each
{hpo_id, name_en, name_ja} — check these are the phenotypes you meant);
unrecognized_hpo_ids (IDs PubCaseFinder does not know, ignored by the ranking:
usually obsolete terms); total_count (candidates scored); returned;
has_more; ties_at_cutoff ({rank, tied_rows_not_returned} when the last
returned rank continues past limit, else null); and results, best first.
Disease rows: {rank, score, id ("OMIM:154700"/"ORPHA:558"), name_en, name_ja, mondo_ids, gene_ids ("GENEID:2200"), gene_symbols, inheritance, matched_hpo_ids, annotated_hpo_count}. Gene rows: {rank, score, id ("GENEID:2200"), gene_symbol, name_en, hgnc_id, mondo_ids, matched_hpo_ids, annotated_hpo_count}.
score is normalized so the best match is 1.0; ranks are competition ranks, so
several rows can share rank 1. matched_hpo_ids are the candidate's annotated
terms that matched, which may be descendants of the query terms. Pass a
mondo_ids entry to pubcasefinder_get_case_reports for literature.
Counts differ from database='pubcasefinder' RDF (different release): do not
compare annotated_hpo_count with SPARQL counts.
RAISES ValueError on a malformed HPO ID, when NONE of the IDs is recognized, when the shared PubCaseFinder rate budget (10/min, 100/h, 1,000/day for the whole server) is exhausted, and on any HTTP error. Each call costs up to 3 upstream requests (names, ranking, candidate names); repeated calls are cached.
Inputs: hpo_ids (required), limit, target. Returns: result
run_sparqlRun SPARQL queryARead-only
Run a read-only SPARQL query on an RDF database. Correct results depend on get_MIE_file(database), read once per database before its first query: it carries the graph pins, literal types and join paths for that database's endpoint, each live-verified. A query written without them does not fail; it returns a wrong answer that looks right — well-formed rows, plausible magnitude, no error, no warning. Unpinned queries on these endpoints have been measured returning x2.84, x6.29 and x45,848 the correct row count, all in under 4 seconds, so speed and a clean result are not evidence of correctness; the graph pin is. TogoMCP_Usage_Guide lays out the workflow these results depend on; answers produced after reading it vary less between runs. On the benchmark, answers built from 3 or more consecutive run_sparql calls score ~1.1 points lower. Queries go to the SPARQL endpoint registered for database: RDF Portal (https://rdfportal.org/, operated by DBCLS) for most databases, and the databases' own public endpoints for glycosmos (https://ts.glycosmos.org/sparql); togovar (https://grch38.togovar.org/sparql); wikipathways (https://sparql.wikipathways.org/sparql); idsm (https://idsm.elixir-czech.cz/sparql/endpoint/idsm); lipidmaps (https://lipidmaps.org/sparql); swisslipids (https://beta.sparql.swisslipids.org/sparql); marpolbase (https://marchantia.info/sparql); rikenbrc_mouse, rikenbrc_cell, rikenbrc_dnabank, rikenbrc_plant, rikenbrc_jcm (https://knowledge.brc.riken.jp/sparql); riken_pmm (https://metabobank.riken.jp/sparql). database is required (valid values: uniprot, rhea, pubchem, pdb, chembl, chebi, reactome, ensembl, amrportal, mesh, go, taxonomy, mondo, nando, bacdive, mediadive, clinvar, pubmed, pubtator, ncbigene, medgen, ddbj, glycosmos, supercon, bgee, oma, brenda, hgnc, jpostdb, massbank, nbrc, mogplus, jcm, hco, mco, togovar, ontology, gwascatalog, fantabio, wikipathways, idsm, pubcasefinder, lipidmaps, swisslipids, bh26microbes, marpolbase, jogo, tismed, bmrb, lotus, cellosaurus, rikenbrc_mouse, rikenbrc_cell, rikenbrc_dnabank, rikenbrc_plant, rikenbrc_jcm, riken_pmm) and selects the endpoint for a single-database query. For a cross-database query on a shared endpoint, pass a member database plus endpoint_name (valid values: sib, pubchem, pdb, ebi, primary, ncbi, ddbj, glycosmos, nims, togovar, wikipathways, idsm, lipidmaps, swisslipids, microbes, marpolbase, rikenbrc, metabobank) or endpoint_url, which take priority over database. Invalid database/endpoint_name values fail immediately with a deterministic error; retrying the same value returns the same error. RETURNS the query results as a CSV-formatted string (first row is the header of SELECT variable names). An EMPTY result — no rows, or an aggregate that is 0 over an empty match — is prefixed with # comment lines diagnosing it. An empty result is not an endpoint failure, and it has two causes with opposite answers (the data is genuinely absent, or one triple pattern is wrong and the real answer is non-zero). The block names the probe that tells them apart.
Inputs: database (required), query, endpoint_url, sparql_query, +1 more. Returns: result
search_chembl_id_lookupLook up ChEMBL IDsARead-only
Resolve a name to ChEMBL IDs across several entity kinds in one call.
Queries the ChEMBL RDF graph. Two matching regimes, because the entity kinds carry different searchable text:
• EXACT (case-insensitive) NAME match — COMPOUND (skos:altLabel: brands,
generics, synonyms), TARGET (its own rdfs:label OR its component's
skos:altLabel — gene symbols and protein names), CELL_LINE and TISSUE
(rdfs:label, e.g. "Liver", "CCRF S-180"). Not fuzzy/substring; for a
known kind, search_chembl_molecule / search_chembl_target return extra
fields (organism/type), and the target tool falls back to a substring pass.
• KEYWORD-IN-DESCRIPTION — ASSAY. Assays have no name; their searchable text is a free-text dcterms:description, so ASSAY does a keyword (token) match on that description, NOT an exact match, e.g. entity_type="ASSAY", query="acetylcholinesterase" → every assay whose description mentions it. ASSAY results are relevance-ranked (best description match first).
Default (no entity_type) searches the four EXACT-name kinds and UNIONs them.
ASSAY is opt-in via entity_type="ASSAY" — its keyword semantics and high hit
counts would otherwise swamp a name lookup. (DOCUMENT is not supported; query
SPARQL directly for it.)
The search string can be passed as any of: query (canonical), search,
term, keyword, keywords, search_term, or name.
RETURNS a dict {'total_count', 'has_more', 'results'}. total_count is the
number of rows RETURNED (capped by limit), NOT the full match count; check
has_more (true = more results exist beyond this page — relevant mainly for
ASSAY, whose keyword search can have many hits). On a default (cross-kind)
search, has_more=true can also mean an entire entity_type is missing from
the page: the limit applies to the UNION, so "Liver" at limit=5 returns 5
TARGET rows and no TISSUE row, though both exist. A truncated page therefore
does not show that a kind is absent; a larger limit or entity_type does.
Each result carries
'chembl_id', 'entity_type', and 'organism' (null for COMPOUND / where absent —
use it to tell e.g. human from mouse targets). Name kinds also carry 'name'
(rdfs:label); ASSAY rows instead carry 'description' (the free-text assay
description, name=null) and a relevance 'score' (higher = better match).
An empty 'results' carries a 'hint' explaining the empty match; it is not an endpoint failure. On a real endpoint failure this tool does not raise — it returns a dict with a single 'error' key, so check for 'error' before reading 'results'.
Inputs: name, term, limit, query, +5 more. Returns: object
search_chembl_moleculeSearch ChEMBL moleculesARead-only
Resolve a DRUG / COMPOUND / MOLECULE (by name or structure) to a ChEMBL ID.
For drug, compound or molecule names (e.g. "sorafenib", "imatinib",
"aspirin", "Gleevec"). Biological targets (proteins, receptors, enzymes,
genes such as EGFR, BRCA1, TP53) are resolved by search_chembl_target.
Resolution path is auto-selected from the query shape:
• NAME / BRAND / SYNONYM → deterministic SPARQL, EXACT (case-insensitive) match on the molecule's skos:altLabel synonyms (which include brand and trade names — "Gleevec" → CHEMBL941 IMATINIB). Not fuzzy/substring: fix typos before calling. No relevance ranking to second-guess.
• InChIKey / InChI → deterministic SPARQL, EXACT (case-SENSITIVE) match on the RDF-stored identifier. These are canonical (toolkit-independent), so exact match is correct, e.g. "BSYNRYMUTXBXSQ-UHFFFAOYSA-N" → CHEMBL25.
• SMILES → the ChEMBL REST chemistry engine (flexmatch), NOT exact match: a SMILES is written differently by each toolkit, so flexmatch normalizes the structure first, e.g. "CC(=O)Oc1ccccc1C(=O)O" → CHEMBL25.
Structure detection is conservative (multi-word input, or input without the "InChI=" prefix / InChIKey pattern / structural punctuation, is treated as a name), so a bare-chain SMILES like "CCO" is treated as a name.
The search string can be passed as any of: query (canonical), search,
term, keyword, keywords, search_term, or name.
mode='extract' — for a string that NAMES a drug rather than IS one: a
trial intervention, a dosed product or a regimen ("Ustekinumab 90 mg",
"Ropivacaine 10% + Clonidine 1 µg/kg"), which return 0 rows under the
default 'exact'. It returns one result per distinct substance named inside
the string (ROPIVACAINE and CLONIDINE above); nested synonyms collapse to
the longest match. It is a text-extraction heuristic meant as the retry
after an empty 'exact' call, so a hit is a candidate to confirm, and a
regimen resolves to its components, never to "FOLFIRI" itself.
RETURNS a dict {'total_count', 'has_more', 'results'}. total_count is rows
RETURNED (capped by limit), not the full match count; has_more is true if
more exist beyond this page. Each result has 'chembl_id' (e.g. "CHEMBL25") and
'name' (rdfs:label, may be None for some structure hits). Under
mode='extract' each result additionally carries 'matched_span' (the text
that matched) and 'match_type' ('exact' if the span is the whole query,
else 'contained'), which says how far to trust a hit. When a call returns no
results, a 'note' key explains why and what to try next. On endpoint/HTTP
failure this tool does not raise — it returns a dict with a single 'error'
key, so check for 'error' before reading 'results'.
Inputs: mode, name, term, limit, +5 more. Returns: object
search_chembl_targetSearch ChEMBL targetsARead-only
Resolve a biological TARGET (protein/receptor/enzyme) to a ChEMBL ID.
Not for drugs, compounds or molecules: names like "sorafenib", "imatinib" or
"aspirin" are resolved by search_chembl_molecule.
Resolution is deterministic SPARQL against the ChEMBL RDF graph, not a lexical
search — there is no ranking to second-guess:
• UNIPROT ACCESSION (e.g. "P00533") → the structured skos:exactMatch link.
Returns every target containing that protein (the single protein plus any
complex/family/chimera it participates in) — filter target_type to get
just one.
• GENE SYMBOL / PROTEIN NAME (e.g. "EGFR", "epidermal growth factor
receptor") → EXACT (case-insensitive) match, tried against BOTH the
target's own name and its protein component's skos:altLabel synonyms.
• If that finds nothing, ONE substring pass over target names runs as a
fallback (e.g. "dehydrogenase"). Still never fuzzy — fix typos.
Every result carries organism and type, so a symbol shared across species
or complexes is disambiguated by inspecting those fields (or by passing the
organism/target_type filters) — NOT by trusting order.
Target-type values (for type and the target_type filter): SINGLE PROTEIN,
PROTEIN COMPLEX, PROTEIN FAMILY, PROTEIN-PROTEIN INTERACTION, CHIMERIC PROTEIN,
NUCLEIC-ACID, CELL-LINE, TISSUE, ORGANISM, SELECTIVITY GROUP, SMALL MOLECULE,
OLIGOSACCHARIDE, LIPID, METAL, and other rarer kinds. An unrecognized
target_type raises rather than silently matching nothing.
The search string can be passed as any of: query (canonical), search,
term, keyword, keywords, search_term, or name.
RETURNS a dict {'total_count', 'has_more', 'results', 'match_mode'}.
total_count is rows RETURNED (capped by limit), not the full match count;
has_more is true if more exist beyond this page. Each result has
'chembl_id', 'name' (rdfs:label), 'organism', and 'type'. match_mode is
'exact', 'substring', or 'none' — 'substring' means the exact pass found
nothing and these are looser, UNRANKED matches, so verify 'name' before using
them; 'none' means both passes ran and neither matched.
An empty 'results' carries a 'hint' explaining the empty match; it is not an endpoint failure. On a real endpoint failure this tool does not raise — it returns a dict with a single 'error' key, so check for 'error' before reading 'results'.
Inputs: name, term, limit, query, +6 more. Returns: object
search_mesh_descriptorSearch MeSH descriptorsARead-only
Find MeSH descriptors whose label contains the query, via the NLM MeSH lookup API (https://id.nlm.nih.gov/mesh/lookup/descriptor). Matching is a case-insensitive substring match on the descriptor label, so "asthma" also returns "Anti-Asthmatic Agents".
RETURNS a JSON array string of {"resource": <MeSH descriptor IRI>, "label": <descriptor name>} objects (at most limit); the descriptor ID (e.g. D001249)
is the IRI's last path segment. On upstream/HTTP
failure this tool does NOT raise — it returns a plain string beginning with
"Error:" (not JSON). check for the "Error:" prefix before parsing.
Inputs: name, term, limit, query, +4 more. Returns: result
search_pdb_entitySearch PDB structuresARead-only
Search PDBj for structures, chemical components, or BIRD molecules.
Returns rich, named fields per hit (not just the title) — for pdb,
each result carries the experimental method, resolution, bound ligands,
and citation; for cc, the formula, SMILES, and InChI.
RETURNS a JSON string {"total": int | null, "results": [ {…fields…} ]}.
total is null when PDBj gives no count (typical for structured-filter
searches) — that is NOT zero and does NOT mean "no results"; consult
results directly. On upstream/HTTP failure returns a JSON object with an
error key instead — check for error before reading results.
Inputs: db (required), name, term, limit, +13 more. Returns: result
search_reactome_entitySearch Reactome pathways and entitiesARead-only
Search the Reactome pathway knowledgebase by keyword (name / fuzzy match).
Resolves a term (pathway / reaction / protein / complex / small-molecule name) to Reactome stable IDs. Matching is keyword/fuzzy — UNLIKE the exact-match ChEMBL search tools, so expect ranked, approximate hits.
RETURNS a dict {'total_count', 'has_more', 'results'} — NOT a bare list.
total_count is the number of records RETURNED (capped by limit);
has_more is true if more matched beyond the cap. Each result carries
'id' (stable Reactome stId, e.g. "R-HSA-109581"), 'name', 'type' (facet
type), 'exactType' (specific BioPAX-ish class), 'species' (list), and — only
when include_summation=True — 'summation' (≤240-char description). On
upstream failure returns {'error': ...} instead — check for 'error' before
reading 'results'.
species and types are validated case-INSENSITIVELY against Reactome's
controlled vocabularies and normalized to canonical casing before dispatch:
the server-side filter is case-SENSITIVE and silently ignores a mis-cased
value (returning UNFILTERED results), so a mis-cased species used to lose
most hits. An unrecognized species/type now RAISES rather than silently
returning the wrong rows.
Inputs: name, rows, term, limit, +8 more. Returns: object
search_rhea_entitySearch Rhea reactionsARead-only
Search the Rhea reaction database by keyword and return matching reactions.
Matching is KEYWORD/FUZZY over reaction participants, equations, EC numbers,
and cross-references — NOT exact-ID lookup. A term like "glucose" matches any
reaction mentioning glucose. Field-scoped terms and wildcards are supported
(e.g. ec:1.1.1.1, chebi:17234, uniprot:*). A chebi:-scoped term takes
a BARE ChEBI number, not the CHEBI: prefix; a redundant chebi:CHEBI:17234
is auto-corrected to chebi:17234 (the prefixed form otherwise 500s).
RETURNS a dict {'total_count', 'has_more', 'results'} — NOT a bare list.
'total_count' is the number of reactions RETURNED (capped by limit, max
500); 'has_more' is true if more matched beyond the cap. Each result carries
the requested columns as snake_cased keys (e.g. 'rhea-id' → 'rhea_id',
'chebi-id' → 'chebi_id'). On upstream failure returns {'error': ...} instead
— check for 'error' before reading 'results'.
Valid columns (default rhea-id,equation): rhea-id, equation, chebi,
chebi-id, ec, uniprot, go, pubmed, reaction-xref(EcoCyc|KEGG|MetaCyc|
Reactome|M-CSA).
Inputs: name, term, limit, query, +5 more. Returns: object
search_uniprot_entitySearch UniProt proteinsARead-only
Search for a UniProt entity ID by query.
⚠️ Only the search string and limit are accepted. Extra parameters
like taxon, organism, reviewed, species, etc. are silently
dropped and have no effect — express such filters inside the Solr
query string instead (e.g., organism_id:9606 AND reviewed:true).
⚠️ An unrecognised FIELD NAME inside the query string is not silently
ignored: UniProt rejects it (HTTP 400, "'taxon' is not a valid search
field") and this tool returns the "Error:" string described below.
Common wrong guesses that fail this way: taxon, organism, species,
go_id. What CAN fail silently is a valid field given an ill-formed
value — it returns 0 rows, or rows you did not expect, with HTTP 200.
The search string can be passed as any of: query (canonical),
search, term, keyword, keywords, search_term, or name.
RETURNS a TSV string with columns: accession, protein_name, organism_name. On upstream/HTTP failure this tool does NOT raise — it returns a plain string beginning with "Error:" (not TSV). check for the "Error:" prefix before parsing rows.
Inputs: name, term, limit, query, +4 more. Returns: result
togoid_convertIdConvert IDs (TogoID)ARead-only
Convert identifiers from one database to another.
Maps IDs between biological databases — e.g., NCBI Gene IDs to UniProt accessions, or UniProt accessions to PDB structure IDs.
RETURNS a JSON string of a bare array of [source_id, target_id] pairs,
e.g. '[["672", "P38398"], ["675", "O15129"]]'. An empty array means none
of the input IDs converted along the route. Ontology-style datasets (go,
mondo, doid, hp_*, orphanet_*, mgi_*, uberon, …) come back as CURIEs on
both sides (GO:0005515), even for bare input; SPARQL needs the IRI form
(obo:GO_0005515).
Inputs: ids (required), route (required), limit, offset. Returns: result
togoid_countIdCount convertible IDs (TogoID)ARead-only
Check how many of your IDs can be converted before doing bulk conversion.
A lightweight pre-check: tells you how many source IDs have mappings in the target database WITHOUT actually returning the mapped IDs. Use this to: - Verify your IDs are in the correct format - Estimate result size before a large convertId call - Check if a conversion route works for your specific IDs
This is a single-hop, pairwise check: pass source and target as two
separate args (unlike convertId, which takes one comma-joined route).
Inputs: ids (required), source (required), target (required). Returns: object
togoid_getAllDatasetList ID datasets (TogoID)ARead-only
List all databases registered in TogoID with their ID formats.
Returns configuration for every dataset TogoID knows about, including:
label: Human-readable database name
regex: Pattern for validating IDs, AS SERVED BY TogoID
regex_flavor: dialect of
regex— currently always "ecmascript"regex_python: the same pattern rewritten for Python's
re(ADDED HERE)prefix: URI prefix for linked data
examples: Sample IDs you can use to test conversions
⚠️ regex IS NOT PYTHON-COMPATIBLE. TogoID publishes .NET/JavaScript named
groups — (?<id>...) — which re.compile rejects outright for all 119
datasets. Use regex_python, which this tool adds beside the original.
Never wrap the compile of regex in a bare try/except: that converts
"cannot compile" into "matches nothing", i.e. a silently wrong answer.
Inputs: no named parameters. Returns: object
togoid_getAllRelationList all ID conversion routes (TogoID)ARead-only
Discover all available ID conversion routes between databases.
A planning tool for questions that involve 2+ databases on DIFFERENT SPARQL endpoints, where IDs have to be mapped between them.
Returns a map of all source→target database pairs that TogoID can convert, so a cross-database route can be checked before writing SPARQL joins or looking IDs up by hand.
Inputs: no named parameters. Returns: object
togoid_getDatasetGet ID dataset details (TogoID)ARead-only
Get configuration for a specific database in TogoID.
Retrieves detailed metadata about a single dataset, including its ID format, URI prefix, example IDs, and available annotations.
RETURNS a dict with label (human-readable name), regex (the ID-validation
pattern exactly as TogoID serves it), regex_flavor ("ecmascript"),
regex_python (the same pattern rewritten for Python's re — ADDED HERE),
prefix (URI prefixes for linking), examples (sample IDs — test with
countId before bulk conversion), and annotations (available annotation
types).
⚠️ regex uses .NET/JavaScript named groups (?<id>...), which Python's
re.compile rejects. Use regex_python. A bare try/except around the
compile silently degrades to "matches nothing" — a wrong answer, not an error.
Inputs: dataset (required). Returns: object
togoid_getDescriptionGet dataset descriptions (TogoID)ARead-only
Get human-readable descriptions for all databases in TogoID (https://togoid.dbcls.jp/, DBCLS's ID-conversion service; API at https://api.togoid.dbcls.jp/config/descriptions).
RETURNS a dict keyed by TogoID dataset key (the names convertId's route
uses). Each value has name, description_en, description_ja,
organization_en and organization_ja; about a third of the keys map to an
empty dict (no description recorded). Use it to see what a dataset key stands
for when planning cross-database conversions; for prefixes and example IDs use
getDataset instead. Raises on an HTTP error.
Inputs: no named parameters. Returns: object
togoid_getRelationCheck an ID conversion route (TogoID)ARead-only
Check if a specific ID conversion route exists and get its details.
Use this to verify that a particular source→target conversion is available before calling convertId. Also reveals the nature of the relationship (e.g., "encoded by", "has structure", "is target of").
This is a single-hop, pairwise check: pass source and target as two
separate args (unlike convertId, which takes one comma-joined route).
RETURNS a JSON string of a bare array of relationship objects, each with
forward (label from source to target), reverse (label from target to
source), and description (explanation of the link). An empty array means
no direct route exists.
DIRECTION IS NOT A CONSTRAINT ON TRAVERSAL. TogoID registers each pair in
one direction only (274 of 308 pairs have no reverse entry), but convertId
and countId traverse a pair BOTH ways. So this tool falls back to the
swapped pair when the requested orientation is unregistered: the labels are
swapped into YOUR orientation and the object carries
"registered_direction": "target-source" to say so. A non-empty result
means the conversion works in the direction you asked for.
NO DIRECT PAIR is an error, not an empty array. The error names an unknown
dataset key if there is one; otherwise it lists up to 5 multi-hop routes
(at most 2 hops) that convertId can walk, e.g. chebi,hmdb,pdb_ccd. A route
through a grouping dataset (taxonomy, go, a pathway) is flagged: it links
every member of the group, not equivalent IDs.
Inputs: source (required), target (required). Returns: result
togoid_identifyIdIdentify ID type (TogoID)ARead-only
Resolve a bare accession to the TogoID dataset key(s) it could belong to.
The inverse of getDataset: given an identifier like AEK21611 or P38398,
it returns the route key convertId expects. Plausible-sounding keys such as
ncbi_protein, entrez_gene and uniprotkb are not TogoID datasets, and
any call using one fails.
RETURNS a JSON string of a bare array, one object per input ID, each with
id and candidates (possibly empty). Each candidate carries dataset
(the key to put in a route), label, category, shape_matches_examples,
and pattern_collisions.
Candidates are ordered best-first on two pieces of evidence:
shape_matches_examples— whether the ID's character-class shape (AEK21611→L3D5) is one the dataset's own example IDs take. This is the main per-ID signal:insdc_cds's examples are allL3D5,insdc'sL1D5/L2D6, so a protein accession sorts above the gene-level dataset.pattern_collisions— how many other datasets' example IDs this dataset's pattern also matches, used to break ties. Low means a distinctive format (uniprot: ~10), high a catch-all (hgnc_symbol: over a thousand).
The order is evidence, not an answer: it puts the right dataset first for
about 82% of TogoID's published example IDs, and the rest cannot be told
apart by shape — a bare 672 is a well-formed ncbigene, pubmed, chebi and
homologene ID. category=, verify=True, or knowing where the ID came from
settles it. An empty candidates list means no registered dataset's pattern
matches, so TogoID cannot convert that ID.
VERIFY (verify=True) asks TogoID which of its conversion tables actually
contain the ID. Each candidate then also carries:
attested— "yes": TogoID holds the ID as this dataset in at least one table. "no": it holds it under no table for this dataset, so TogoID cannot convert it from this dataset. "unknown": TogoID did not answer in time (seeverify_note).pairs_with— datasets this ID shares a direct table with on this dataset's side (null when unknown); for a "yes" candidate these are single-hop convertId targets.
Candidates then sort yes, unknown, no. Verification rules out datasets
better than it picks one (a short number like 672 is present in a dozen),
and costs one lookup per ID, so it is off by default and limited to 10 IDs
per call. Pass the ID as written (GO:0005515, not 0005515): TogoID
resolves the prefix, and a bare ontology number is found nowhere.
A CURIE disambiguates far better than a bare accession:
insdc.cds:AEK21611 rather than AEK21611. A full IRI matches no
dataset's pattern; pass its accession or CURIE instead.
Inputs: ids (required), verify, category. Returns: result
TogoMCP_Usage_GuideTogoMCP Usage GuideARead-only
Returns the TogoMCP Usage Guide (v7 core): the workflow the other TogoMCP tools are designed around, a catalog of every database with what it holds, and the query rules that keep SPARQL results correct on shared endpoints. It is meant to be read once, before the other tools are used.
What the guide covers, in workflow order:
GATE 0 / STEP −1: classifying a question (bounded vs open-ended) and
identifying its entities, databases and endpoints.
STEP 0: the DATABASE CATALOG, for choosing databases without a tool call.
STEP 1: which search tool grounds each entity in a real IRI.
STEP 2: get_MIE_file(database), the per-database schema run_sparql relies on.
STEP 3: run_sparql budgets (LIMIT 10 first, at most 2 consecutive queries).
STEP 4: synthesis.Why the other tools depend on it (measured on the TogoMCP benchmark): answers with ≥3 consecutive run_sparql calls score ~1.1 points lower, and SPARQL written before the MIE schema was read accounts for ~95% of silent SPARQL failures. Most RDF Portal endpoints host MANY databases (primary: 22, ebi: 6, ncbi: 5, sib: 5) and every endpoint hosts many GRAPHS; an unpinned query reads all of them, so a co-hosted graph can supply a predicate that looks native and return a plausible, correctly-shaped, wrong number with no error. The guide's CO-TENANCY section describes the graph pins that prevent this.
The workflow applies per question: a new question in the same conversation starts again at GATE 0.
The core is complete for ordinary questions and is sized to arrive inline. Deeper detail (full catalog, co-tenancy worked examples, federation, bulk mode, the full troubleshooting table) lives in reference files listed at the end of the guide, served by get_workflow(name="usage-guide", path="references/").
RETURNS the guide as Markdown text.
Inputs: no named parameters. Returns: result
togovar_search_diseaseSearch diseases (TogoVar)ARead-only
Resolve a disease term to MONDO / MedGen IDs for variant search.
The returned mondo_id (or MedGen CUI) is what search_variant takes as
disease_id. Both land directly on TogoMCP's existing mondo/medgen RDF
databases and TogoID nodes.
The TogoVar endpoint does loose token matching with no relevance order (a
query like "cystic fibrosis" also returns unrelated "Hepatic fibrosis…"
rows), so this tool RE-RANKS client-side: exact label match first, then
prefix, then whole-word, then loose token matches last. Each result carries
match_type ("exact"|"prefix"|"word"|"fuzzy") — a top hit that is not
exact means no exact label matched.
COVERAGE LIMIT: TogoVar only indexes diseases that have ClinVar/MGeND
variant associations, so some canonical/parent MONDO terms are simply absent
here (e.g. MONDO_0007254 "breast cancer" does NOT appear in these results).
But a broad/parent MONDO ID still WORKS as a disease_id in search_variant
even when unlisted here — the variant search resolves it via MONDO descendant
expansion (MONDO_0007254 -> ~28,000 variants). So if you know or can resolve
the canonical MONDO ID (e.g. via OLS4 or the mondo RDF database), pass it
straight to search_variant; do not assume this resolver is exhaustive.
Inputs: limit, query. Returns: result
togovar_search_geneSearch genes (TogoVar)ARead-only
Resolve a human gene symbol/alias to its HGNC ID for variant search.
This is the FIRST step of the two-step variant workflow: the hgnc_id
returned here is what search_variant takes as gene_hgnc_id.
The TogoVar endpoint does loose token matching with no relevance order (it
returns the same set for "ALDH2" and the non-existent "ALDH2A1"), so this
tool RE-RANKS client-side: exact symbol match first, then prefix, then other
matches. Each result carries match_type ("exact"|"prefix"|"word"|"fuzzy")
against your query — CHECK IT: if the top hit is not exact, the exact
symbol you asked for does not exist and the rows are loose false positives,
so do not blindly feed the first hgnc_id downstream. (The endpoint echoes
the matched token as symbol and the HGNC approved gene name as name; it
does not expose approved-vs-alias status, so use name to sanity-check.)
Inputs: limit, query. Returns: result
togovar_search_variantSearch human variants (TogoVar)ARead-only
Search TogoVar for human genome variants with population frequencies.
TogoVar integrates allele frequencies from gnomAD, ToMMo (Japanese), NCBN, GEM-J, JGA, BioBank Japan, and JoGo, plus ClinVar + MGeND clinical significance and SIFT/PolyPhen/AlphaMissense predictions — data with no SPARQL counterpart elsewhere in TogoMCP.
All filters are optional and combined with AND. Supply zero filters to browse; but scope tightly — the database holds ~1.2 billion variants.
COUNTS: total is the size of the whole REST backend (1,229,026,068 on
2026-10-09) and is constant across queries; filtered is the count matching
your filters. TogoMCP's togovar SPARQL graph is now about the same size
(1,227,614,941), but the two are not the same set, so do not expect a REST
count and a SPARQL COUNT to agree to the last variant.
PAGING: an INTEGER offset is capped at offset + limit <= 10,000 (HTTP 400
beyond). To page further, use keys: every full page (as many rows as limit)
returns next_offset, the [chromosome, position, reference, alternate] key of
its last row. Pass it back unchanged as offset with the same filters to get the
rows strictly after it, sorted by position — no 10,000 cap. A page shorter than
limit is the last one and carries no next_offset.
STATISTICS SCOPE (stat=True): all facets are scoped to the filtered set and
count VARIANTS, but a variant can fall under several values. type counts
each variant once (sums to filtered); dataset once per cohort;
consequence once per consequence term on any of its transcripts;
significance once per classification label in any of its records (any
condition or submitter). So each value is <= filtered, but consequence/
significance SUMS exceed it, and adding labels (P + LP) double-counts
variants that carry both. See statistics_caveats for the per-facet rule.
ROUND-TRIP TO SPARQL: use variant_iri — it is the subject IRI in the
togovar SPARQL graph and is present on every row except one with a very
long allele. Do NOT gate on tgv_id: most variants have none (it is null),
and they are in SPARQL all the same. About 0.1% of REST variants have no
SPARQL node, so an empty result for one IRI is possible and is not an error.
TWO-STEP WORKFLOW for gene/disease filters:
1. search_gene("ALDH2") -> hgnc_id -> pass as gene_hgnc_id.
2. search_disease("breast cancer") -> mondo_id -> pass as disease_id.
Inputs: stat, stop, limit, start, +16 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools have sharply delimited scope, and the descriptions go out of their way to redirect misuse (search_chembl_molecule vs search_chembl_target vs search_chembl_id_lookup, togoid_getRelation vs tomoid_convertId vs togoid_countId). Real overlap remains: search_chembl_id_lookup's default cross-kind search also resolves compounds and targets, and three separate guidance/meta tools (TogoMCP_Usage_Guide, get_workflow, get_MIE_file) require reading dense text to know which to call when. The 'list available X' family (get_sparql_endpoints, togoid_getAllDataset, ncbi_list_databases) is distinct but easy to blur at a glance.
The dominant pattern is verb_noun snake_case (search_chembl_molecule, get_graph_list, run_sparql), but the TogoID family uses camelCase with a get/getAll distinction (togoid_convertId, togoid_getAllRelation), the TogoVar tools put the domain first (togovar_search_variant) while ChEMBL tools put the verb first (search_chembl_molecule), and one tool is a screaming-snake pseudo-name (TogoMCP_Usage_Guide). Families are individually readable, but the overall surface mixes at least four conventions.
33 tools is heavy for a single server, even a broad multi-database one; roughly a third are meta/guidance (TogoMCP_Usage_Guide, get_workflow, get_MIE_file, get_sparql_endpoints, get_graph_list) and eight belong to a single TogoID sub-API. A toolset this large pushes the burden of selection onto long descriptions rather than clean partitioning.
Coverage is strong: run_sparql plus schema/endpoint discovery covers arbitrary RDF querying, NCBI has the full esearch/esummary/efetch triad, TogoID covers discover/identify/convert/count, and TogoVar and PubCaseFinder have two-step resolve-then-search flows. Minor gaps exist — most of the ~60 SPARQL databases have no dedicated search resolver, and there is no PubCaseFinder/PubMed tool beyond ncbi_esearch — but agents can route around these via run_sparql.
Maintenance
Related MCP Connectors
MCP server for querying BrainKB, a knowledge base for neuroscience knowledge graphs.
Auditable MCP server for PubMed, Europe PMC, ClinicalTrials.gov, and bioRxiv/medRxiv queries
MCP gateway federating 30 biomedical MCP servers behind one endpoint: gnomAD, ClinVar, HPO, VEP.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseBqualityBmaintenanceAn MCP server that provides standardized access to biomedical knowledge bases and resources, enabling AI systems to retrieve verified information from sources like bioRxiv, EuropePMC, and various protein/gene databases.5233Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA unified MCP server for biomedical research that connects AI systems to resources like Ensembl, EuropePMC, STRING, and more, enabling retrieval of verified domain-specific information.Apache 2.0
- AlicenseAqualityBmaintenanceA high-performance MCP server that gives LLMs access to 25 biomedical tools federated across 50+ upstream APIs for genes, variants, drugs, diseases, literature, clinical trials, and structural biology.43233 npm12Apache 2.0
- AlicenseNot gradedqualityCmaintenanceUnified MCP server providing AI-agent-ready access to AlphaFold, PubMed, ChEMBL, Ensembl, and 37+ scientific databases.MIT