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
| Name | Required | Description | Default |
|---|---|---|---|
| gene_id | Yes | Ensembl gene ID (e.g., 'ENSG00000141510') | |
| gene_symbol | Yes | Gene 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}"}
- src/biocontext_kb/app.py:35-39 (registration)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), )
- src/biocontext_kb/core/_server.py:3-6 (registration)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.", )
- src/biocontext_kb/core/__init__.py:17-17 (registration)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"}