Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_panglaodb_options

Retrieve filter options for marker genes in the PanglaoDB dataset, including species, organ, cell type, and gene symbols, enabling precise data exploration.

Instructions

Retrieves the available options for filtering marker genes in the PanglaoDB dataset.

Returns: A dictionary containing lists of unique values for species, organ, cell type, and gene symbols.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function decorated as a tool that retrieves available organs and cell types from PanglaoDB data.
    @core_mcp.tool() def get_panglaodb_options() -> Dict[str, List[str] | str]: """Retrieve available filter options for PanglaoDB marker genes. Returns unique values for organs and cell types. Returns: dict: Lists of unique organ and cell_type values available in PanglaoDB dataset or error message. """ panglao_db_df = get_panglaodb_df() if panglao_db_df is None: return {"error": "PanglaoDB data is not loaded. Check server logs."} # Get unique values for each column, handling NaN values organ = panglao_db_df["organ"].dropna().str.lower().unique().tolist() cell_type = panglao_db_df["cell type"].dropna().str.lower().unique().tolist() return { "organ": organ, "cell_type": cell_type, }
  • Helper function to load and preprocess the PanglaoDB dataset from TSV file, called by the tool handler.
    def get_panglaodb_df() -> pd.DataFrame | None: """Load the PanglaoDB dataset into a pandas DataFrame. Returns: pd.DataFrame | None: The loaded DataFrame or None if loading fails. """ # Construct the path to the TSV file panglao_db_path = Path(__file__).parent / "data" / "PanglaoDB_markers_27_Mar_2020.tsv" # Load the database into a pandas DataFrame try: panglao_db_df = pd.read_csv(panglao_db_path, sep="\t", engine="python", header=0) # Replace empty strings and other potential non-values with NaN for consistency panglao_db_df = panglao_db_df.replace("", pd.NA) return panglao_db_df except FileNotFoundError: print(f"Error: PanglaoDB file not found at {panglao_db_path}") return None except Exception as e: print(f"Error loading PanglaoDB file: {e}") return None
  • Package init file that imports the tool functions, triggering their registration via decorators when the module is imported.
    from ._get_panglaodb_marker_genes import get_panglaodb_marker_genes from ._get_panglaodb_options import get_panglaodb_options __all__ = [ "get_panglaodb_marker_genes", "get_panglaodb_options", ]

Other Tools

Related 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