Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_panglaodb_options

Retrieve available filter options for PanglaoDB marker genes, including unique organ and cell type values to refine biological data queries.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the get_panglaodb_options tool (likely referred to as bc_get_panglaodb_options externally). It fetches unique organ and cell_type filter options from the PanglaoDB dataset using a helper function.
    @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, }
  • Supporting helper function that loads the PanglaoDB marker genes TSV file into a pandas DataFrame, used by the main 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
  • Import statement in core/__init__.py that triggers the import and registration of panglaodb tools via their decorators when the module is loaded.
    from .panglaodb import *
  • Re-exports the tool handler function, allowing it to be imported and registered via panglaodb.__init__.
    from ._get_panglaodb_options import get_panglaodb_options

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