Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_human_protein_atlas_info

Retrieve tissue expression, subcellular localization, and pathology data from the Human Protein Atlas for a gene by Ensembl ID or symbol.

Instructions

Retrieve Human Protein Atlas information including expression, localization, and pathology data. Provide either gene_id or gene_symbol.

Returns: dict: Protein atlas data with tissue_expression, subcellular_location, pathology, antibodies, RNA/protein levels or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idYesEnsembl gene ID (e.g., 'ENSG00000141510')
gene_symbolYesGene symbol (e.g., 'TP53')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler/decorator function that executes the 'get_human_protein_atlas_info' tool logic. Uses the @core_mcp.tool() decorator and accepts gene_id or gene_symbol, resolves gene_symbol to Ensembl ID if needed, then fetches data from the Human Protein Atlas API (proteinatlas.org/{gene_id}.json).
    from typing import Annotated, Optional
    
    import requests
    from pydantic import Field
    
    from biocontext_kb.core._server import core_mcp
    from biocontext_kb.core.ensembl import get_ensembl_id_from_gene_symbol
    
    
    @core_mcp.tool()
    def get_human_protein_atlas_info(
        gene_id: Annotated[Optional[str], Field(description="Ensembl gene ID (e.g., 'ENSG00000141510')")],
        gene_symbol: Annotated[Optional[str], Field(description="Gene symbol (e.g., 'TP53')")],
    ) -> dict:
        """Retrieve Human Protein Atlas information including expression, localization, and pathology data. Provide either gene_id or gene_symbol.
    
        Returns:
            dict: Protein atlas data with tissue_expression, subcellular_location, pathology, antibodies, RNA/protein levels or error message.
        """
        if gene_id is None and gene_symbol is None:
            return {"error": "At least one of gene_id or gene_symbol must be provided"}
    
        if gene_id is None:
            # If gene_id is not provided, fetch it using gene_symbol
            gene_id_response = get_ensembl_id_from_gene_symbol.fn(gene_symbol=gene_symbol, species="9606")
            if "ensembl_id" in gene_id_response:
                gene_id = gene_id_response["ensembl_id"]
            else:
                return {"error": "Failed to fetch Ensembl ID from gene name"}
    
        url = f"https://www.proteinatlas.org/{gene_id}.json"
    
        try:
            response = requests.get(url)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            return {"error": f"Failed to fetch Human Protein Atlas info: {e!s}"}
  • Input schema defined via Pydantic Field annotations: gene_id (Optional[str], Ensembl gene ID) and gene_symbol (Optional[str], gene symbol). Both are optional but at least one must be provided.
        gene_id: Annotated[Optional[str], Field(description="Ensembl gene ID (e.g., 'ENSG00000141510')")],
        gene_symbol: Annotated[Optional[str], Field(description="Gene symbol (e.g., 'TP53')")],
    ) -> dict:
  • Registration via @core_mcp.tool() decorator on the function, which registers it as an MCP tool on the 'core_mcp' FastMCP server instance.
    @core_mcp.tool()
  • Package-level __init__.py re-exports the function and registers it in __all__, and the core __init__.py (line 17) imports 'from .proteinatlas import *' to include this tool in the core MCP server.
    from ._get_human_protein_atlas_info import get_human_protein_atlas_info
    
    __all__ = [
        "get_human_protein_atlas_info",
    ]
  • Helper function used by the Human Protein Atlas tool to resolve gene_symbol to an Ensembl gene ID (ENSG*) via the Ensembl REST API, when only a gene symbol is provided.
    @core_mcp.tool()
    def get_ensembl_id_from_gene_symbol(
        gene_symbol: Annotated[str, Field(description="Gene name (e.g., 'TP53')")],
        species: Annotated[
            str,
            Field(description="Taxonomy ID (e.g., 9606 for human, 10090 for mouse)"),
        ] = "9606",
    ) -> dict:
        """Get Ensembl gene ID from gene symbol. Returns the stable Ensembl ID (ENSG*) for the given gene symbol and species.
    
        Returns:
            dict: Ensembl gene ID in format {'ensembl_id': 'ENSG...'} or error message.
        """
        # Ensure at least one search parameter was provided
        if not gene_symbol:
            return {"error": "gene_symbol must be provided"}
    
        url = f"https://rest.ensembl.org/xrefs/symbol/{species}/{gene_symbol}"
    
        try:
            response = requests.get(url)
            response.raise_for_status()
    
            # Parse the Ensembl gene ID
            match = re.search(r"\b(ENSG\d+)\b", response.text)
    
            if match:
                return {"ensembl_id": match.group(1)}
            else:
                return {"error": "No Ensembl gene ID found in response"}
        except requests.exceptions.RequestException as e:
            return {"error": f"Failed to fetch Ensembl ID: {e!s}"}
Behavior2/5

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

No annotations are provided, so the description carries full burden. It does not disclose if the operation is read-only, authentication requirements, or behavior on invalid input. The return type is mentioned but lacks deeper behavioral context.

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

Conciseness5/5

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

Two concise sentences: first states action and output types, second specifies parameter condition. No fluff, front-loaded with key info, and includes return structure.

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

Completeness4/5

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

Has output schema (summarized in description), parameter descriptions are complete, and usage condition is clear. Lacks examples or edge-case handling, but is sufficient for a simple retrieval tool.

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

Parameters4/5

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

Schema descriptions already cover both parameters (100% coverage). The description adds value by clarifying the mutual exclusivity ('either') role, which is not captured in the required array (which lists both).

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?

The description uses a specific verb ('Retrieve') and resource ('Human Protein Atlas information'), and clearly distinguishes this tool from sibling tools that deal with drugs, KEGG, STRING, etc.

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

Usage Guidelines4/5

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

It states 'Provide either gene_id or gene_symbol,' giving clear parameter usage condition. While it doesn't explicitly list when not to use, the unique domain makes it clear that this tool is for Human Protein Atlas queries only.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/biocontext-ai/knowledgebase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server