Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_human_protein_atlas_info

Retrieve Human Protein Atlas data including tissue expression, subcellular localization, and pathology information using gene identifiers.

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')

Implementation Reference

  • The main handler function for the tool, decorated with @core_mcp.tool(), which defines the schema via Annotated parameters and implements the logic: resolves Ensembl ID if only gene_symbol provided, fetches JSON from Protein Atlas API.
    @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}"}
  • Registers the core_mcp server (named 'BC', slugified to 'bc') into the main mcp_app, prefixing its tools with 'bc_' to create 'bc_get_human_protein_atlas_info'.
    for mcp in [core_mcp, *(await get_openapi_mcps())]: await mcp_app.import_server( mcp, slugify(mcp.name), )
  • Defines the core_mcp FastMCP instance named 'BC' where the tool is registered via decorator.
    core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )
  • Imports proteinatlas tools into core module, executing the @tool decorator to register get_human_protein_atlas_info on core_mcp.
    from .proteinatlas import *
  • Uses the ensembl tool 'get_ensembl_id_from_gene_symbol' to resolve gene_symbol to Ensembl ID if needed.
    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"}

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