list_filters
Retrieve a CSV-formatted list of all applicable filters for a specified dataset in Biomart. Use this tool to identify filters that refine query results based on attributes like chromosome, start, and end positions.
Instructions
Lists all available filters for a given dataset.
Filters are used to narrow down the results of a Biomart query.
This function returns all filters that can be applied to the specified dataset.
Args:
mart (str): The mart identifier (e.g., "ENSEMBL_MART_ENSEMBL")
dataset (str): The dataset identifier (e.g., "hsapiens_gene_ensembl")
Returns:
str: CSV-formatted table of all filters with their display names and descriptions.
Example:
list_filters("ENSEMBL_MART_ENSEMBL", "hsapiens_gene_ensembl")
>>> "name,description
chromosome_name,Chromosome/scaffold name
start,Gene start (bp)
end,Gene end (bp)
..."
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset | Yes | ||
| mart | Yes |
Implementation Reference
- biomart-mcp.py:180-205 (handler)The handler function for the 'list_filters' MCP tool. It is registered via the @mcp.tool() decorator. The function queries the Biomart server for filters available in the specified dataset and returns them as a CSV string.@mcp.tool() def list_filters(mart: str, dataset: str): """ Lists all available filters for a given dataset. Filters are used to narrow down the results of a Biomart query. This function returns all filters that can be applied to the specified dataset. Args: mart (str): The mart identifier (e.g., "ENSEMBL_MART_ENSEMBL") dataset (str): The dataset identifier (e.g., "hsapiens_gene_ensembl") Returns: str: CSV-formatted table of all filters with their display names and descriptions. Example: list_filters("ENSEMBL_MART_ENSEMBL", "hsapiens_gene_ensembl") >>> "name,description chromosome_name,Chromosome/scaffold name start,Gene start (bp) end,Gene end (bp) ..." """ server = pybiomart.Server(host=DEFAULT_HOST) return server[mart][dataset].list_filters().to_csv(index=False).replace("\r", "")