Skip to main content
Glama
taehojo
by taehojo

compare_alleles

Analyze effects of multiple genetic mutations at a specific genomic position to understand variant impacts and hotspot variations.

Instructions

Compare different alleles at the same position.

Useful for understanding effects of different mutations at a hotspot position.

Example: "Compare T>C vs T>G vs T>A at chr19:44908684"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chromosomeYes
positionYes
refYes
altsYes

Implementation Reference

  • Core handler function implementing the compare_alleles tool logic: compares multiple alternate alleles at the same genomic position by calling predict_variant_effect for each and compiling results.
    def compare_alleles(client, params: Dict[str, Any]) -> Dict[str, Any]:
        """
        Compare different alleles at the same position.
        """
        chromosome = params.get('chromosome')
        position = params.get('position')
        ref = params.get('ref')
        alts = params.get('alts', [])
    
        results = {}
        for alt in alts:
            try:
                var_params = {
                    'chromosome': chromosome,
                    'position': position,
                    'ref': ref,
                    'alt': alt
                }
                result = predict_variant_effect(client, var_params)
                results[f"{ref}>{alt}"] = {
                    'impact_level': result['interpretation']['impact_level'],
                    'expression_fc': result['predictions'].get('rna_seq', {}).get('fold_change', 0),
                    'clinical_sig': result['interpretation']['clinical_significance']
                }
            except Exception as e:
                print(f"Warning: Failed for allele {alt}: {e}", file=sys.stderr)
                results[f"{ref}>{alt}"] = {'error': str(e)}
    
        return {
            'position': f"{chromosome}:{position}",
            'reference': ref,
            'allele_comparisons': results
        }
  • MCP server tool handler for 'compare_alleles': dispatches to AlphaGenomeClient.compareAlleles and formats response.
    case 'compare_alleles': {
      const result = await getClient().compareAlleles(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Tool schema definition including name, description, and input validation schema for compare_alleles.
    export const COMPARE_ALLELES_TOOL: Tool = {
      name: 'compare_alleles',
      description: `Compare different alleles at the same position.
    
    Useful for understanding effects of different mutations at a hotspot position.
    
    Example: "Compare T>C vs T>G vs T>A at chr19:44908684"`,
      inputSchema: {
        type: 'object',
        properties: {
          chromosome: { type: 'string', pattern: '^chr([1-9]|1[0-9]|2[0-2]|X|Y)$' },
          position: { type: 'number', minimum: 1 },
          ref: { type: 'string', pattern: '^[ATGCatgc]+$' },
          alts: {
            type: 'array',
            items: { type: 'string', pattern: '^[ATGCatgc]+$' },
            minItems: 2,
          },
        },
        required: ['chromosome', 'position', 'ref', 'alts'],
      },
    };
  • src/tools.ts:709-730 (registration)
    Registration of compare_alleles tool in the ALL_TOOLS array, used by MCP server for tool listing.
    export const ALL_TOOLS: Tool[] = [
      PREDICT_VARIANT_TOOL,
      BATCH_SCORE_TOOL,
      ASSESS_PATHOGENICITY_TOOL,
      PREDICT_TISSUE_SPECIFIC_TOOL,
      COMPARE_VARIANTS_TOOL,
      PREDICT_SPLICE_IMPACT_TOOL,
      PREDICT_EXPRESSION_IMPACT_TOOL,
      ANALYZE_GWAS_LOCUS_TOOL,
      COMPARE_ALLELES_TOOL,
      BATCH_TISSUE_COMPARISON_TOOL,
      PREDICT_TF_BINDING_IMPACT_TOOL,
      PREDICT_CHROMATIN_IMPACT_TOOL,
      COMPARE_PROTECTIVE_RISK_TOOL,
      BATCH_PATHOGENICITY_FILTER_TOOL,
      COMPARE_VARIANTS_SAME_GENE_TOOL,
      PREDICT_ALLELE_SPECIFIC_EFFECTS_TOOL,
      ANNOTATE_REGULATORY_CONTEXT_TOOL,
      BATCH_MODALITY_SCREEN_TOOL,
      GENERATE_VARIANT_REPORT_TOOL,
      EXPLAIN_VARIANT_IMPACT_TOOL,
    ];
  • Client method that bridges to Python by calling the alphagenome_bridge.py with 'compare_alleles' action.
    async compareAlleles(params: any): Promise<any> {
      try {
        return await this.callPythonBridge('compare_alleles', params);
      } catch (error) {
        if (error instanceof ApiError) throw error;
        throw new ApiError(`Allele comparison failed: ${error}`, 500);
      }
    }
Behavior2/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 mentions the tool is for 'understanding effects,' which hints at analysis, but doesn't disclose behavioral traits such as whether it performs read-only analysis, requires specific permissions, has rate limits, or what the output format might be. The example adds some context but lacks operational details.

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 purpose, the second provides usage context, and the third gives 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.

Completeness2/5

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

Given the complexity (4 parameters with 0% schema coverage, no annotations, no output schema), the description is incomplete. It lacks details on parameter meanings, behavioral traits, and output expectations. While concise, it doesn't provide enough context for an agent to fully understand how to use the tool effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It doesn't explain any parameters beyond the example mentioning 'chr19:44908684' (which hints at chromosome and position) and 'T>C vs T>G vs T>A' (hinting at ref and alts). However, it fails to define what 'chromosome,' 'position,' 'ref,' and 'alts' mean semantically, leaving parameters largely undocumented.

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: 'Compare different alleles at the same position.' It specifies the verb 'compare' and the resource 'alleles,' and distinguishes itself from siblings like 'compare_variants' by focusing on alleles at a single position. However, it doesn't explicitly differentiate from 'compare_variants_same_gene,' which might overlap in scope.

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: 'Useful for understanding effects of different mutations at a hotspot position.' This implies usage for mutation analysis at specific positions, but it doesn't explicitly state when to use this tool versus alternatives like 'compare_variants' or 'compare_variants_same_gene,' nor does it mention exclusions or prerequisites.

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

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/taehojo/alphagenome-mcp'

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