Skip to main content
Glama

list_datasets

Retrieve a CSV-formatted list of all available datasets in a specified Biomart mart, including display names and descriptions, to simplify dataset discovery and selection.

Instructions

Lists all available biomart datasets for a given mart.

Each mart contains multiple datasets. This function returns all datasets
available in the specified mart as a CSV string.

Args:
    mart (str): The mart identifier to list datasets from.
        Valid values include: ENSEMBL_MART_ENSEMBL, ENSEMBL_MART_MOUSE,
        ENSEMBL_MART_ONTOLOGY, ENSEMBL_MART_GENOMIC, ENSEMBL_MART_SNP,
        ENSEMBL_MART_FUNCGEN

Returns:
    str: CSV-formatted table of all datasets with their display names and descriptions.

Example:
    list_datasets("ENSEMBL_MART_ENSEMBL")
    >>> "name,display_name,description
         hsapiens_gene_ensembl,Human genes,Human genes (GRCh38.p13)
         mmusculus_gene_ensembl,Mouse genes,Mouse genes (GRCm39)
         ..."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
martYes

Implementation Reference

  • The handler function for the 'list_datasets' tool. It is decorated with @mcp.tool(), takes a 'mart' parameter, retrieves the Biomart server, lists datasets for the given mart, and returns the result as a CSV string with error handling.
    @mcp.tool()
    def list_datasets(mart: str):
        """
        Lists all available biomart datasets for a given mart.
    
        Each mart contains multiple datasets. This function returns all datasets
        available in the specified mart as a CSV string.
    
        Args:
            mart (str): The mart identifier to list datasets from.
                Valid values include: ENSEMBL_MART_ENSEMBL, ENSEMBL_MART_MOUSE,
                ENSEMBL_MART_ONTOLOGY, ENSEMBL_MART_GENOMIC, ENSEMBL_MART_SNP,
                ENSEMBL_MART_FUNCGEN
    
        Returns:
            str: CSV-formatted table of all datasets with their display names and descriptions.
    
        Example:
            list_datasets("ENSEMBL_MART_ENSEMBL")
            >>> "name,display_name,description
                 hsapiens_gene_ensembl,Human genes,Human genes (GRCh38.p13)
                 mmusculus_gene_ensembl,Mouse genes,Mouse genes (GRCm39)
                 ..."
        """
        try:
            server = get_server()
            return server[mart].list_datasets().to_csv(index=False).replace("\r", "")
        except Exception as e:
            print(f"Error listing datasets for mart {mart}: {str(e)}", file=sys.stderr)
            return f"Error: {str(e)}"

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

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/jzinno/biomart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server