Skip to main content
Glama
taehojo
by taehojo

compare_protective_risk

Compare protective and risk alleles side-by-side to analyze opposite disease associations for mechanism studies and therapeutic target identification.

Instructions

Compare protective vs risk alleles directly.

Side-by-side comparison of alleles with opposite disease associations.

Perfect for: disease mechanism studies, therapeutic target identification.

Example: "Compare APOE protective allele vs risk allele"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protective_variantYes
risk_variantYes

Implementation Reference

  • Defines the Tool object for 'compare_protective_risk' including name, description, and input schema requiring protective_variant and risk_variant objects.
    export const COMPARE_PROTECTIVE_RISK_TOOL: Tool = {
      name: 'compare_protective_risk',
      description: `Compare protective vs risk alleles directly.
    
    Side-by-side comparison of alleles with opposite disease associations.
    
    Perfect for: disease mechanism studies, therapeutic target identification.
    
    Example: "Compare APOE protective allele vs risk allele"`,
      inputSchema: {
        type: 'object',
        properties: {
          protective_variant: {
            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]+$' },
              alt: { type: 'string', pattern: '^[ATGCatgc]+$' },
            },
            required: ['chromosome', 'position', 'ref', 'alt'],
          },
          risk_variant: {
            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]+$' },
              alt: { type: 'string', pattern: '^[ATGCatgc]+$' },
            },
            required: ['chromosome', 'position', 'ref', 'alt'],
          },
        },
        required: ['protective_variant', 'risk_variant'],
      },
    };
  • src/tools.ts:709-730 (registration)
    Registers COMPARE_PROTECTIVE_RISK_TOOL in the ALL_TOOLS array used by the MCP listTools handler.
    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,
    ];
  • MCP server request handler for 'compare_protective_risk' tool call, invokes AlphaGenomeClient and returns JSON-formatted result.
    case 'compare_protective_risk': {
      const result = await getClient().compareProtectiveRisk(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • AlphaGenomeClient method that forwards compare_protective_risk parameters to the Python bridge via callPythonBridge.
    async compareProtectiveRisk(params: any): Promise<any> {
      try {
        return await this.callPythonBridge('compare_protective_risk', params);
      } catch (error) {
        if (error instanceof ApiError) throw error;
        throw new ApiError(`Protective vs risk comparison failed: ${error}`, 500);
      }
    }
  • Core handler function in Python bridge that implements the tool logic by predicting variant effects for protective and risk variants and returning a comparison dictionary.
    def compare_protective_risk(client, params: Dict[str, Any]) -> Dict[str, Any]:
        """Compare protective vs risk alleles."""
        protective = params.get('protective_variant')
        risk = params.get('risk_variant')
    
        result_protective = predict_variant_effect(client, protective)
        result_risk = predict_variant_effect(client, risk)
    
        return {
            'protective': {
                'variant': result_protective['variant'],
                'impact': result_protective['interpretation']['impact_level'],
                'expression_fc': result_protective['predictions'].get('rna_seq', {}).get('fold_change', 0)
            },
            'risk': {
                'variant': result_risk['variant'],
                'impact': result_risk['interpretation']['impact_level'],
                'expression_fc': result_risk['predictions'].get('rna_seq', {}).get('fold_change', 0)
            }
        }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'side-by-side comparison' but doesn't disclose behavioral traits like what data is returned, format of results, computational requirements, rate limits, or error conditions. The description is minimal and lacks essential operational context for a tool with complex nested parameters.

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 concise with four short sentences and an example. It's front-loaded with the core purpose, followed by usage context. However, the example could be integrated more smoothly, and some sentences feel slightly fragmented.

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 (2 nested object parameters, 0% schema coverage, no output schema, no annotations), the description is incomplete. It lacks parameter explanations, behavioral details, and output information. For a tool comparing genetic variants, this leaves significant gaps in understanding how to use it 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 the parameters at all—no mention of 'protective_variant' or 'risk_variant' objects, their required fields (chromosome, position, ref, alt), or what these represent. The example 'Compare APOE protective allele vs risk allele' hints at usage but doesn't clarify parameter structure or semantics.

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 protective vs risk alleles directly' and 'Side-by-side comparison of alleles with opposite disease associations.' This specifies the verb (compare) and resource (alleles with opposite disease associations). However, it doesn't explicitly differentiate from sibling tools like 'compare_alleles' or 'compare_variants,' which appear to have overlapping functionality.

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 usage context with 'Perfect for: disease mechanism studies, therapeutic target identification' and an example, which implies when to use this tool. However, it doesn't explicitly state when NOT to use it or mention alternatives among the many sibling tools (e.g., compare_alleles, compare_variants), leaving the agent to infer proper usage.

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