Skip to main content
Glama

substitutability_check

Swap a component variant into a gated assembly and rerun all gates to test Form/Fit/Function substitutability, deciding whether to reuse the part number or assign a new one.

Instructions

Liskov-substitutability gate — Form/Fit/Function as code (§7.1, #147). Take an assembly that gates green with variant A in a slot, swap in variant B (a different family row, or any part claiming the same interface), and re-run merge_assembly + all the gates. Still green ⇒ B is interchangeable with A — by construction a compatible (MINOR/PATCH) change ⇒ revise the existing part number; a gate now fails ⇒ the swap broke Form/Fit/Function ⇒ a new part number. Purely deterministic (no API, no judgment); the substitutability test #138 (B1 families) and #146 (the interface registry) call.

manifest: path to a manifest that gates green with variant A in slot. slot: the component id to swap (variant A → variant B). variant: the replacement component spec — a dict with exactly one of file/manifest/library (the same one-source rule merge_assembly enforces). verify_baseline: re-merge the base assembly first and require it green so the premise is honest (default True).

Function, not just Form and Fit (#261): if the swapped-in variant declares a PERFORMANCE contract (#226), it is part of the comparison. A contract measured as NOT met breaks the performance gate like any other. A contract with NO recorded verdict yields a THIRD answer — substitutable: null, verdict 'performance_unproven' — because an unverified spec is not a passed spec, and handing an unproven part an existing part number is the silent pass #226 prevents.

Returns {schema, slot, variant, baseline_ok, swap_ok, substitutable (True | False | null), verdict ('substitutable' | 'not_substitutable' | 'baseline_not_green' | 'performance_unproven'), broken_gates (the NAMED gate(s) the swap broke), broken (gate→violations), classification (compatibility/semver/decision), performance? (only when a component declares a contract), reports}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYes
variantYes
manifestYes
verify_baselineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/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 and meets it: it declares the tool is purely deterministic (no API, no judgment), discloses the baseline-verification default, and enumerates the exact outcome space including the subtle third answer (substitutable: null, 'performance_unproven') and the failure verdicts. The unproven-contract rule (#226) is a non-obvious behavior that an agent could not infer from structured fields.

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?

Front-loaded with the core concept, then params, then the performance subtlety and return shape. Dense and mostly earning its place, though the parenthetical issue references (§7.1, #147, #261, #226) add some noise an agent doesn't need for invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

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

With no output schema, the description fully specifies the return shape (schema, slot, variant, baseline_ok, swap_ok, substitutable, verdict, broken_gates, broken, classification, performance?, reports) and all four params. For a complex multi-outcome gate, nothing needed to call or interpret it is missing.

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

Parameters5/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 and does: it defines manifest (a manifest that gates green with A in the slot), slot (the component id to swap), variant (a dict with exactly one of file/manifest/library, echoing the one-source rule merge_assembly enforces), and verify_baseline (default True, re-merges base first). Every parameter gains meaning beyond the bare schema.

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?

States a precise verb+resource: a Liskov-substitutability gate that swaps a variant into a slot and re-runs the gates. It distinguishes itself from siblings by naming the mechanism (merge_assembly + all gates) and the two outcomes (revise part number vs. new part number). An agent can tell exactly what this does without opening the schema.

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 mechanics give clear when-to-use context: an assembly that gates green with variant A, swap in B, re-run. It also identifies the callers (#138 B1 families, #146 interface registry) and notes the performance-contract interplay. It stops short of explicitly contrasting with nearby siblings like component_contract_check, interface_align_check, or verify_performance, so no explicit alternative routing.

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

Deploy Server

Other Tools