Skip to main content
Glama
jzinno
by jzinno

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
NameRequiredDescriptionDefault
datasetYes
martYes

Implementation Reference

  • 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", "")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/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 that the tool returns a CSV-formatted table, which is useful behavioral context beyond just listing. However, it doesn't cover other aspects like rate limits, error handling, or authentication needs, leaving gaps for a tool with no annotation coverage.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly. The subsequent sentences add necessary context, parameter explanations, return format, and an example without redundancy. Every sentence earns its place, though it could be slightly more streamlined.

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

Completeness3/5

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

Given the tool has 2 parameters, no annotations, and no output schema, the description is moderately complete. It covers purpose, parameters with examples, and return format, but lacks details on behavioral traits like error cases or performance. For a simple list tool, this is adequate but has clear gaps in transparency.

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

Parameters4/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 adds meaning by explaining that 'mart' is an identifier (e.g., 'ENSEMBL_MART_ENSEMBL') and 'dataset' is an identifier (e.g., 'hsapiens_gene_ensembl'), and provides an example with specific values. This clarifies the parameters beyond the schema's basic titles, though it doesn't detail all possible values or constraints.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Lists all available filters for a given dataset' and 'returns all filters that can be applied to the specified dataset.' It specifies the verb ('lists'), resource ('filters'), and scope ('for a given dataset'), but doesn't explicitly differentiate it from sibling tools like list_datasets or list_marts, which is why it's not a 5.

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

Usage Guidelines3/5

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

The description provides some context: 'Filters are used to narrow down the results of a Biomart query' and 'This function returns all filters that can be applied to the specified dataset,' which implies usage in query preparation. However, it lacks explicit guidance on when to use this tool versus alternatives like list_common_attributes or list_all_attributes, and doesn't 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.

Deploy Server

Other Tools

Related Tools