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)}"
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: it returns all datasets (no filtering), outputs as a CSV string, and includes an example showing the return format. It does not mention performance aspects like rate limits or error handling, but covers the core behavior adequately for a read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded: the first sentence states the purpose, followed by explanatory context, parameter details, return value, and an example. Every sentence adds value without redundancy, and it is appropriately sized for a single-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is nearly complete: it explains purpose, usage, parameters, and return format with an example. A minor gap is the lack of explicit error handling or edge cases, but it suffices for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It fully documents the single parameter 'mart' by explaining its role ('mart identifier to list datasets from'), providing valid values (e.g., ENSEMBL_MART_ENSEMBL), and including an example. This adds significant meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Lists') and resource ('all available biomart datasets for a given mart'), distinguishing it from siblings like list_marts (which lists marts) and list_filters (which lists filters). It specifies the scope ('all datasets available in the specified mart') and output format ('CSV string'), making the purpose highly specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by explaining that 'Each mart contains multiple datasets' and this tool lists them, implying it should be used after selecting a mart. However, it does not explicitly state when to use alternatives like list_marts (for listing marts) or get_data (for fetching dataset contents), nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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