uniprot-mcp-server: search proteins
uniprot_search_proteinsSearch UniProtKB and return curated protein records. Pass text_search for a plain-language query (the 80% case) or query for the full Lucene field syntax (gene:TP53 AND organism_id:9606 AND reviewed:true) — exactly one is required. Reviewed (Swiss-Prot) entries are manually curated; unreviewed (TrEMBL) are computationally predicted and ~30x more numerous, so reviewed defaults to true to avoid drowning in predictions — set it false to search both tiers together (for TrEMBL only, put reviewed:false in query). The organism_id and reviewed filters apply to the whole query. Request facets (e.g. reviewed, model_organism) for server-side count breakdowns. Results page forward with an opaque cursor; UniProtKB has no offset paging. An inactive accession the query names (merged, demerged, or deleted) comes back in inactive[] with the accessions that replace it, never as a result — the reviewed and organism_id filters do not drop it. This is the discovery entry point — chain results[].accession into uniprot_get_entry for full records, or uniprot_get_sequence for FASTA.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "uniprot_search_proteins"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Number of hits per page. Default 25; a value above 500, UniProt's page maximum, returns 500 and says so. | |
| query | No | UniProtKB Lucene query with field prefixes — gene, organism_id, keyword (KW-xxxx), go (GO id), reviewed, protein_name, family, length, existence, accession. Example: "gene:BRCA1 AND organism_id:9606 AND reviewed:true". Provide this OR text_search, not both. | |
| cursor | No | Opaque forward cursor from this tool for the same exact effective query and filters. Size, fields, and facets may change. Older raw cursors are rejected; restart without cursor. Random access to page N is not supported. | |
| facets | No | Comma-separated upstream facet names for count breakdowns, e.g. "reviewed,model_organism,proteins_with". Returns a facets array alongside the hits. | |
| fields | No | Comma-separated UniProtKB return-field names that trim each hit, e.g. "accession,gene_names" to drop the function snippet. Omit for the default hit: name, gene, organism, length, reviewed, score, and a function snippet. The identity fields always come back. Hits carry only these fields: accession, id, protein_name, gene_names, gene_primary, gene_synonym, gene_oln, gene_orf, organism_name, organism_id, length, reviewed, annotation_score, protein_existence, cc_function. Any other field (e.g. ec, ft_act_site, xref_pdb) is not requested and comes back in ignoredFields with a notice — fetch it with uniprot_get_entry. Text that is not a field name fails invalid_query with UniProt's message. | |
| reviewed | No | Restrict to reviewed Swiss-Prot entries. Defaults to true (curated only). false applies no tier filter, returning reviewed and unreviewed TrEMBL entries together; for TrEMBL only, put reviewed:false in query. Ignored when query already contains a reviewed: clause; plain text never overrides this filter. An inactive accession the query names carries no tier and still comes back in inactive[]. | |
| organism_id | No | Restrict to an NCBI taxon and its descendants, including strains and subspecies, e.g. 9606 for human or 562 for E. coli. Applies taxonomy_id to the whole query, except that an inactive accession the query names carries no organism and still comes back in inactive[]; use an explicit organism_id: clause in query for an exact taxon. Resolve names with uniprot_get_taxonomy. | |
| text_search | No | Plain-language search across protein names, gene names, and function, e.g. "kinase apoptosis". Punctuation and uppercase AND/OR/NOT are searched as text, with UniProt tokenization; use query for operators and field syntax. Provide this OR query, not both. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| cursor | No | Forward cursor for the next page. Absent on the last page. | |
| facets | No | Upstream facet count breakdowns. Present only when facets were requested. | |
| notice | No | Guidance: the requested and applied size when size was above the 500-row page maximum; when fields named fields hits do not carry, those fields, where to get them, and the fields hits carry; and, when nothing matched, how to broaden — distinguishing plain text from a structured query. | |
| results | No | Matching active protein hits for this page. Inactive accessions are in inactive. | |
| inactive | No | Matching accessions that are inactive in UniProtKB (merged, demerged, or deleted) — not proteins to read, but pointers to the accessions that replace them. Present only when the page held any. Under the reviewed or organism_id filter these are the accessions query or text_search names, unless the query already spends more than 98 of UniProt's 100 OR conditions (each OR operand or space-separated term is one); with reviewed: false and no organism_id, every inactive accession the query matches comes back. | |
| totalResults | No | Total matches for the query before pagination (from the upstream result count), inactive accessions included — they fall in no facet bucket, so facet counts can sum below it. | |
| ignoredFields | No | Names in fields that hits do not carry, in request order — left out of the UniProt request, so the search answered without them. Absent when every name was returned. | |
| effectiveQuery | No | The query as the server assembled and sent it to UniProtKB. |