Skip to main content
Glama
taehojo
by taehojo

batch_pathogenicity_filter

Filter genomic variants by pathogenicity threshold to identify pathogenic variants from large lists for clinical prioritization and VCF filtering.

Instructions

Filter variants by pathogenicity threshold.

Efficiently identifies pathogenic variants from large lists.

Perfect for: VCF filtering, prioritizing clinical variants.

Example: "Filter 100 variants for pathogenicity > 0.7"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variantsYes
thresholdNoPathogenicity threshold (0-1, default: 0.5)

Implementation Reference

  • Core handler function that processes a batch of variants, assesses pathogenicity for each using assess_pathogenicity helper, filters those above threshold, sorts by score, and returns summary.
    def batch_pathogenicity_filter(client, params: Dict[str, Any]) -> Dict[str, Any]:
        """Filter variants by pathogenicity threshold."""
        variants_data = params.get('variants', [])
        threshold = params.get('threshold', 0.5)
    
        pathogenic_variants = []
        for v in variants_data:
            try:
                result = assess_pathogenicity(client, v)
                if result['pathogenicity_score'] >= threshold:
                    pathogenic_variants.append({
                        'variant': result['variant'],
                        'score': result['pathogenicity_score'],
                        'classification': result['classification']
                    })
            except Exception as e:
                print(f"Warning: Failed for variant: {e}", file=sys.stderr)
                continue
    
        pathogenic_variants.sort(key=lambda x: x['score'], reverse=True)
        return {
            'total_analyzed': len(variants_data),
            'pathogenic_count': len(pathogenic_variants),
            'pathogenic_variants': pathogenic_variants
        }
  • Defines the Tool object with name, description, and inputSchema for validating batch variant inputs and threshold.
    export const BATCH_PATHOGENICITY_FILTER_TOOL: Tool = {
      name: 'batch_pathogenicity_filter',
      description: `Filter variants by pathogenicity threshold.
    
    Efficiently identifies pathogenic variants from large lists.
    
    Perfect for: VCF filtering, prioritizing clinical variants.
    
    Example: "Filter 100 variants for pathogenicity > 0.7"`,
      inputSchema: {
        type: 'object',
        properties: {
          variants: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                chromosome: { type: 'string' },
                position: { type: 'number' },
                ref: { type: 'string' },
                alt: { type: 'string' },
              },
              required: ['chromosome', 'position', 'ref', 'alt'],
            },
            minItems: 1,
          },
          threshold: {
            type: 'number',
            minimum: 0,
            maximum: 1,
            description: 'Pathogenicity threshold (0-1, default: 0.5)',
          },
        },
        required: ['variants'],
      },
    };
  • src/index.ts:228-233 (registration)
    Registers the tool in the MCP server request handler switch statement, calling the client method.
    case 'batch_pathogenicity_filter': {
      const result = await getClient().batchPathogenicityFilter(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Client proxy method that invokes the Python bridge with action 'batch_pathogenicity_filter'.
    async batchPathogenicityFilter(params: any): Promise<any> {
      try {
        return await this.callPythonBridge('batch_pathogenicity_filter', params);
      } catch (error) {
        if (error instanceof ApiError) throw error;
        throw new ApiError(`Batch pathogenicity filter failed: ${error}`, 500);
      }
    }
  • src/tools.ts:709-730 (registration)
    Exports the full list of tools including BATCH_PATHOGENICITY_FILTER_TOOL, used by the MCP server for listTools.
    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,
    ];
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 efficiency for large lists and gives an example, but doesn't disclose critical behavioral traits such as performance characteristics (e.g., speed, limitations), error handling, or what 'pathogenicity' means in this context (e.g., based on a specific algorithm or database). This is a significant gap 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 with four sentences: a purpose statement, efficiency note, usage examples, and an illustrative example. Each sentence adds value, and it's front-loaded with the core purpose. Minor improvements could include more structured formatting, but it's efficient overall.

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's complexity (filtering variants with a threshold), no annotations, no output schema, and 50% schema coverage, the description is moderately complete. It covers purpose and usage but lacks details on behavior, parameter semantics (especially for 'variants'), and output format. This leaves gaps for an AI agent to invoke it correctly without additional context.

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

Parameters3/5

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

Schema description coverage is 50% (only 'threshold' has a description). The description adds some value by implying 'variants' are filtered based on pathogenicity, but doesn't explain the structure or semantics of the 'variants' array beyond what the schema provides (e.g., what pathogenicity scores are associated with each variant). It partially compensates for the coverage gap but not fully.

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: 'Filter variants by pathogenicity threshold' and 'Efficiently identifies pathogenic variants from large lists.' It specifies the verb ('filter'), resource ('variants'), and key constraint ('pathogenicity threshold'). However, it doesn't explicitly differentiate from sibling tools like 'assess_pathogenicity' or 'batch_score_variants', which might 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 Guidelines4/5

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

The description provides clear usage context with 'Perfect for: VCF filtering, prioritizing clinical variants' and an example, giving practical scenarios. However, it lacks explicit guidance on when to use this tool versus alternatives like 'assess_pathogenicity' or 'batch_score_variants', which could be relevant for similar tasks.

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