Skip to main content
Glama

diversity_kinship

Compute a VanRaden genomic relationship matrix from genotype data to identify related sample pairs and inbreeding ranges, supporting diversity analysis and relatedness checks.

Instructions

VanRaden genomic relationship (kinship) matrix.

Computes G = ZZ'/(2 Σp(1-p)) from alt dosage. Writes the full matrix as kinship_matrix.csv (samples × samples) and reports the most-related pairs and the diagonal (self-relationship / inbreeding) range. For large sets pass method="allelematrix" + max_markers to avoid a full VCF export.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoGenotype source: 'vcf' (full export, cached) or 'allelematrix' (paged, server-side subset).vcf
regionNoRestrict analysis to a genomic window: 'chrom' or 'chrom:start-end' (1-based).
top_pairsNoHow many most-related sample pairs to report.
output_dirNoDirectory for the output CSV(s) (default ./gigwa_results/<module>/).
max_markersNoCap analysis to the first N markers in canonical Gigwa search order; omit to use all.
variant_set_db_idYesBrAPI variantSetDbId identifying the run (MODULE§project§run) -- copy the exact string from list_variant_sets / list_content, never assemble one by hand: the middle segment is a numeric project index, not the project's name, and a wrong guess fails with an opaque HTTP 500 rather than a clear error.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv1.9.1
    • changedInput schema / properties / max_markers / description
      Previous value: -"Cap the number of markers analysed (evenly-spaced subsample); omit to use all."New value: +"Cap analysis to the first N markers in canonical Gigwa search order; omit to use all."
    • changedInput schema / properties / variant_set_db_id / description
      Previous value: -"BrAPI variantSetDbId identifying the run (MODULE§project§run); from list_variant_sets / list_content."New value: +"BrAPI variantSetDbId identifying the run (MODULE§project§run) -- copy the exact string from list_variant_sets / list_content, never assemble one by hand: the middle segment is a numeric project index, not the project's name, and a wrong guess fails with an opaque HTTP 500 rather than a clear error."
  2. First observedv1.4.16

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does a solid job: it discloses the mathematical formula, the side effect of writing 'kinship_matrix.csv', the reported values (most-related pairs and diagonal range), and the large-set performance strategy. It does not mention deeper caveats like memory usage, file overwrite behavior, or failure modes, but the core behavior is transparent.

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 compact and well-structured: definition, formula, outputs, then an important performance note. Every sentence contributes new information, and the most essential identity of the tool is front-loaded in the first sentence.

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?

The description covers the core behavior, outputs, and a key performance consideration, and an output schema apparently exists to handle return-value details. It is slightly incomplete because it lacks explicit guidance about when to choose kinship analysis over related diversity/QC modules, but for invoking the tool with correct parameters it is sufficiently complete.

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 input schema already documents all parameters at 100% coverage, so the baseline is 3. The description adds real value beyond the schema by explaining why 'method' and 'max_markers' matter together ('avoid a full VCF export') and by framing the input as 'alt dosage', which helps parameter interpretation. This raises the score above baseline.

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 names the resource ('VanRaden genomic relationship (kinship) matrix'), states the computation ('Computes G = ZZ'/(2 Σp(1-p)) from alt dosage'), and specifies concrete outputs. It is specific enough to distinguish from most siblings, but it does not explicitly differentiate itself from closely related diversity_* or QC tools.

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 gives practical configuration guidance ('For large sets pass method="allelematrix" + max_markers to avoid a full VCF export'), but it never states when a user should choose this tool over siblings like diversity_pca, diversity_fst, or qc_duplicate_accessions. Usage context is implied by the kinship focus rather than made explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/gkanogiannis/Gigwa-MCP'

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