Skip to main content
Glama

list_common_attributes

Retrieve commonly used attributes for a specific dataset from BioMart databases. Streamlines dataset exploration by providing essential attributes in a CSV format for easy analysis and integration.

Instructions

Lists commonly used attributes available for a given dataset.

This function returns only the most frequently used attributes (defined in COMMON_ATTRIBUTES)
to avoid overwhelming the model with too many options. For a complete list,
use list_all_attributes.

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 common attributes with their display names and descriptions.

Example:
    list_common_attributes("ENSEMBL_MART_ENSEMBL", "hsapiens_gene_ensembl")
    >>> "name,display_name,description
         ensembl_gene_id,Gene stable ID,Ensembl stable ID for the gene
         external_gene_name,Gene name,The gene name
         ..."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYes
martYes

Implementation Reference

  • The handler function for the 'list_common_attributes' tool. It connects to the Biomart server, lists all attributes for the dataset, filters to common ones defined in COMMON_ATTRIBUTES, and returns as CSV.
    @mcp.tool()
    def list_common_attributes(mart: str, dataset: str):
        """
        Lists commonly used attributes available for a given dataset.
    
        This function returns only the most frequently used attributes (defined in COMMON_ATTRIBUTES)
        to avoid overwhelming the model with too many options. For a complete list,
        use list_all_attributes.
    
        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 common attributes with their display names and descriptions.
    
        Example:
            list_common_attributes("ENSEMBL_MART_ENSEMBL", "hsapiens_gene_ensembl")
            >>> "name,display_name,description
                 ensembl_gene_id,Gene stable ID,Ensembl stable ID for the gene
                 external_gene_name,Gene name,The gene name
                 ..."
        """
        server = pybiomart.Server(host=DEFAULT_HOST)
        df = server[mart][dataset].list_attributes()
        df = df[df["name"].isin(COMMON_ATTRIBUTES)]
        return df.to_csv(index=False).replace("\r", "")
  • biomart-mcp.py:120-120 (registration)
    The @mcp.tool() decorator registers the list_common_attributes function as an MCP tool.
    @mcp.tool()
  • Predefined list of common attributes used by the list_common_attributes handler to filter the full attribute list.
    COMMON_ATTRIBUTES = [
        "ensembl_gene_id",
        "external_gene_name",
        "hgnc_symbol",
        "hgnc_id",
        "gene_biotype",
        "ensembl_transcript_id",
        "ensembl_peptide_id",
        "ensembl_exon_id",
        "description",
        "chromosome_name",
        "start_position",
        "end_position",
        "strand",
        "band",
        "transcript_start",
        "transcript_end",
        "transcription_start_site",
        "transcript_length",
    ]
  • Function signature defining input parameters with type annotations, which serves as the input schema for the tool.
    def list_common_attributes(mart: str, dataset: str):
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it explains the tool returns only the most frequently used attributes (defined in COMMON_ATTRIBUTES), specifies the output format (CSV-formatted table), and includes an example. It doesn't mention rate limits or auth needs, but covers core behavior adequately.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by usage guidelines, parameter details, return format, and an example. Every sentence adds value without redundancy, making it efficient and well-structured.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is largely complete: it covers purpose, usage, parameters, return format, and includes an example. It could mention error handling or data sources, but for a read-only list tool, it provides sufficient context for effective use.

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 meaningful semantics by explaining what 'mart' and 'dataset' represent (identifiers), providing examples (e.g., 'ENSEMBL_MART_ENSEMBL', 'hsapiens_gene_ensembl'), and clarifying they are required. This goes well beyond the basic schema, though it could detail constraints or sources further.

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 tool's purpose with specific verbs ('Lists commonly used attributes') and resources ('for a given dataset'), and explicitly distinguishes it from its sibling 'list_all_attributes' by noting it returns only the most frequently used attributes to avoid overwhelming the model.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives: it specifies to use this tool 'to avoid overwhelming the model with too many options' and directs users to 'use list_all_attributes' for a complete list, clearly differentiating from the sibling tool.

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