Skip to content

usm/mcp-contracts ​

MCP contracts tool — extracts the contracts array from a feature .usm file, including id, description, applies_after, and must_have.

Why this exists ​

Agents need to review a feature's contracts to plan tests or verify guarantees. The contracts tool returns the full contracts array from a feature file, formatted for easy agent consumption.

How it works ​

Get feature contracts (get-contracts) ​

Agent retrieves all contracts for a feature

  1. Get — feature .usm file path
  2. Parse — contracts array
  3. Observe — contract count and details

Guarantees ​

contracts-feature-only ​

Contracts tool only works on feature files

Acceptance criteria:

  • [ ] Returns error if file is not a feature
  • [ ] Returns contractCount and full contracts array
  • [ ] Each contract includes id, description, must_have

Test specifications ​

contracts-from-feature ​

Given:

  • feature_with_contracts: true

Then:

  • assertion: contracts array returned with correct count

contracts-from-service ​

Given:

  • service_usm_file: true

Then:

  • assertion: error returned "not a feature file"

Implementation ​

  • Primary: src/mcp/contracts.ts
  • Test code status: none

See Also ​

  • usm/mcp-flows