Skip to main content
Glama

Substitutability Check

substitutability_check
Read-only

Check whether a replacement component can substitute another by re-running assembly gates after swapping it in; green gates mean interchangeable, failed gates require a new part number.

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?

Annotations already indicate readOnlyHint=true and openWorldHint=false, and the description adds substantial behavioral detail: deterministic execution, no judgment, baseline verification, and the special third answer for unverified performance contracts. This goes well beyond the structured annotations.

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 long but front-loaded with the core purpose and each section adds necessary detail about the procedure, performance edge case, and return contract. It is dense rather than padded, though some internal references and ticket numbers add length without immediate operational value.

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 must explain return values, and it does: substitutable, verdict, broken_gates, classification, and performance details. It also covers the non-obvious performance_unproven case and the meaning of a null result, making the tool safe to invoke without further documentation.

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 carries the full burden for parameters. It explains all four parameters in context, including the one-source rule for variant, the meaning of slot, and the default behavior of verify_baseline. This compensates fully for the empty schema descriptions.

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?

The description names a specific verb and resource: it performs a Liskov-substitutability gate by swapping variants and re-running merge_assembly plus gates. It clearly distinguishes itself from related tools like merge_assembly and verify_performance by explaining its unique decision logic and output.

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 gives clear context: use it when an assembly gates green with variant A and you need to know whether variant B is interchangeable. It explains prerequisites and the verify_baseline flag, though it does not explicitly name alternatives or state when not to use the tool.

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