Skip to main content
Glama

uniprot-mcp-server: search proteins

uniprot_search_proteins
Read-onlyIdempotent

Search 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

NameRequiredDescriptionDefault
sizeNoNumber of hits per page. Default 25; a value above 500, UniProt's page maximum, returns 500 and says so.
queryNoUniProtKB 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.
cursorNoOpaque 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.
facetsNoComma-separated upstream facet names for count breakdowns, e.g. "reviewed,model_organism,proteins_with". Returns a facets array alongside the hits.
fieldsNoComma-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.
reviewedNoRestrict 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_idNoRestrict 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_searchNoPlain-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

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
cursorNoForward cursor for the next page. Absent on the last page.
facetsNoUpstream facet count breakdowns. Present only when facets were requested.
noticeNoGuidance: 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.
resultsNoMatching active protein hits for this page. Inactive accessions are in inactive.
inactiveNoMatching 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.
totalResultsNoTotal 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.
ignoredFieldsNoNames 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.
effectiveQueryNoThe query as the server assembled and sent it to UniProtKB.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / organism_id / description
      Previous value: -"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; use an explicit organism_id: clause in query for an exact taxon. Resolve names with uniprot_get_taxonomy."New value: +"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."
    • changedInput schema / properties / reviewed / description
      Previous value: -"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."New value: +"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[]."
    • changedOutput schema / properties / inactive / description
      Previous value: -"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."New value: +"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."
    • addedOutput schema / properties / results / items / properties / functionSnippetMolecule
      Added value: +{
      +  "description": "The isoform, chain, or peptide the functionSnippet annotation is about, as UniProt names it, e.g. \"Glucagon\" or \"Isoform 2\". Omitted when UniProt names none, so the snippet is about the protein the hit describes, and whenever functionSnippet is.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / sequenceFlags
      Added value: +{
      +  "description": "UniProt's sequence flags: \"Fragment\" or \"Fragments\" (several non-adjacent pieces) when the sequence is incomplete, so length counts only the residues UniProt holds, not the whole protein; \"Precursor\" when the sequence is processed into a shorter mature form (signal, propeptide, transit peptide, or initiator methionine cleaved). Omitted when UniProt flags none.",
      +  "items": {
      +    "description": "One flag, as UniProt words it.",
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / totalResults / description
      Previous value: -"Total matches for the query before pagination (from the upstream result count), inactive accessions included."New value: +"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."
  2. Changed10 schema fields changed
    • changedInput schema / properties / fields / description
      Previous value: -"Comma-separated UniProtKB field names to project, e.g. \"accession,gene_names,cc_function\". Omit for a sensible default set covering name, gene, organism, length, reviewed, score, and a function snippet."New value: +"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."
    • changedInput schema / properties / size / description
      Previous value: -"Number of hits per page (max 500). Omit for the server default."New value: +"Number of hits per page. Default 25; a value above 500, UniProt's page maximum, returns 500 and says so."
    • removedInput schema / properties / size / exclusiveMinimum
      Removed value: -0
    • removedInput schema / properties / size / maximum
      Removed value: -500
    • addedInput schema / properties / size / minimum
      Added value: +1
    • addedOutput schema / properties / ignoredFields
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "description": "A requested field name, lowercased, that hits do not carry.",
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when nothing matched, distinguishing plain text from a structured query and suggesting how to broaden."New value: +"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."
    • changedOutput schema / properties / results / items / properties / functionSnippet / description
      Previous value: -"First sentence(s) of the FUNCTION annotation, evidence references stripped. Omitted when no function is annotated."New value: +"Opening of the first FUNCTION annotation, evidence references stripped: whole sentences within 250 characters (at least the first; one over 400 is cut at a word and ends with …). The complete annotation with evidence is uniprot_get_entry function. Omitted when no function is annotated."
    • changedOutput schema / properties / results / items / properties / geneNames / description
      Previous value: -"Gene names and synonyms for the protein."New value: +"Every name of each gene for the protein in UniProt order: gene name, synonyms, ordered-locus names (e.g. \"b3296\", \"JW3258\"), and ORF names (e.g. \"J0580\")."
    • changedOutput schema / properties / results / items / properties / geneNames / items / description
      Previous value: -"A gene name or synonym."New value: +"A gene name, synonym, ordered-locus name, or ORF name."
  3. Changed5 schema fields changed
    • changedInput schema / properties / organism_id / description
      Previous value: -"Restrict to an NCBI taxon ID, e.g. 9606 for human. A convenience filter ANDed onto the whole query; resolve names with uniprot_get_taxonomy."New value: +"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; use an explicit organism_id: clause in query for an exact taxon. Resolve names with uniprot_get_taxonomy."
    • changedInput schema / properties / reviewed / description
      Previous value: -"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 or text_search already contains a reviewed: clause."New value: +"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."
    • changedInput schema / properties / text_search / description
      Previous value: -"Plain-language search across protein names, gene names, and function, e.g. \"kinase apoptosis\". Provide this OR query, not both."New value: +"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."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. `invalid_query`: The query or text_search has unbalanced parentheses (rejected before any request), or UniProtKB rejected the query, text_search, fields, or facets value — the message names the rejected value. `invalid_cursor`: The cursor is malformed, from an older version, belongs to another tool or effective query, or UniProt could not continue from it (HTTP 500). Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. `invalid_query`: The query has unbalanced parentheses (rejected before any request), or UniProtKB rejected the query, text_search, fields, or facets value — the message names the rejected value. `invalid_cursor`: The cursor is malformed, from an older version, belongs to another tool or effective query, or UniProt could not continue from it (HTTP 500). Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when nothing matched — echoes the query and suggests how to broaden."New value: +"Guidance when nothing matched, distinguishing plain text from a structured query and suggesting how to broaden."
  4. Changed2 schema fields changed
    • changedInput schema / properties / cursor / description
      Previous value: -"Opaque forward-pagination cursor from a prior response. Walk pages with this; random access to page N is not supported."New value: +"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."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. `invalid_query`: The query or text_search has unbalanced parentheses (rejected before any request), or UniProtKB rejected the query, text_search, fields, or facets value — the message names the rejected value. `invalid_cursor`: UniProt could not continue from the cursor (it answered HTTP 500) — the cursor is malformed or truncated. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. `invalid_query`: The query or text_search has unbalanced parentheses (rejected before any request), or UniProtKB rejected the query, text_search, fields, or facets value — the message names the rejected value. `invalid_cursor`: The cursor is malformed, from an older version, belongs to another tool or effective query, or UniProt could not continue from it (HTTP 500). Other values are possible when a failure originates below the handler."
  5. Changed7 schema fields changed
    • changedInput schema / properties / organism_id / description
      Previous value: -"Restrict to an NCBI taxon ID, e.g. 9606 for human. A convenience filter ANDed onto the query; resolve names with uniprot_get_taxonomy."New value: +"Restrict to an NCBI taxon ID, e.g. 9606 for human. A convenience filter ANDed onto the whole query; resolve names with uniprot_get_taxonomy."
    • changedInput schema / properties / reviewed / description
      Previous value: -"Restrict to reviewed Swiss-Prot entries. Defaults to true (curated only); set false to include unreviewed TrEMBL. Ignored when query already pins a reviewed: clause."New value: +"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 or text_search already contains a reviewed: clause."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `missing_query`: Neither text_search nor query was provided. `conflicting_query`: Both text_search and query were provided. `invalid_query`: The query or text_search has unbalanced parentheses (rejected before any request), or UniProtKB rejected the query, text_search, fields, or facets value — the message names the rejected value. `invalid_cursor`: UniProt could not continue from the cursor (it answered HTTP 500) — the cursor is malformed or truncated. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "missing_query",
      -  "conflicting_query"
      -]New value: +[
      +  "missing_query",
      +  "conflicting_query",
      +  "invalid_query",
      +  "invalid_cursor"
      +]
    • addedOutput schema / properties / inactive
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "An inactive accession the query matched, with where to go instead.",
      +    "properties": {
      +      "accession": {
      +        "description": "The inactive UniProtKB accession the query matched.",
      +        "type": "string"
      +      },
      +      "deletedReason": {
      +        "description": "Why UniProt deleted the entry, when it says. Present on DELETED only.",
      +        "type": "string"
      +      },
      +      "reason": {
      +        "description": "UniProt inactiveReasonType: MERGED, DEMERGED, or DELETED. Omitted when UniProt names none.",
      +        "type": "string"
      +      },
      +      "replacedBy": {
      +        "description": "Accessions that replace it — the merge target (MERGED) or the demerge products (DEMERGED). Look these up instead.",
      +        "items": {
      +          "description": "A replacement UniProtKB accession.",
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "uniParcId": {
      +        "description": "UniParc ID that still holds the sequence, when UniProt gives one.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "accession"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / results / description
      Previous value: -"Matching protein hits for this page."New value: +"Matching active protein hits for this page. Inactive accessions are in inactive."
    • changedOutput schema / properties / totalResults / description
      Previous value: -"Total matches for the query before pagination (from the upstream result count)."New value: +"Total matches for the query before pagination (from the upstream result count), inactive accessions included."
  6. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/openWorld/idempotent annotations, it discloses non-obvious behavior: opaque forward-only cursor with no offset paging, a 500-hit page ceiling, dropped reviewed/organism filters for inactive accessions, and unrequested fields surfacing in ignoredFields rather than failing the call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and the required one-of choice, then proceeds through filters, facets, paging, inactive accessions, and chaining in a logical order. It is dense and runs long as a single paragraph, with some restatement of schema text (size cap, cursor semantics) that keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter search tool with an output schema, the description still covers what an agent needs: mutually exclusive query modes, default tier behavior, paging model, facet counts, and the inactive[] edge case. Nothing required for a correct first call appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds genuine meaning on top of the already complete schema: the rationale for reviewed defaulting to true (~30x TrEMBL volume), the fact that organism_id and reviewed apply to the whole query, and that a reviewed: clause in query overrides the parameter. These cross-parameter interactions are not obvious from the per-field schema descriptions alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Search UniProtKB and return curated protein records') and explicitly positions itself as 'the discovery entry point', naming the siblings to chain into (uniprot_get_entry, uniprot_get_sequence) with the exact join key results[].accession.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete routing rules: text_search for 'the 80% case' versus query for Lucene syntax, exactly one required; explains when to leave reviewed at its default and when to set it false, including the TrEMBL-only escape hatch via query. It also names the downstream tools and the condition that selects them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.