Skip to content

usm/mcp-read

MCP read tool — reads and parses a .usm file, returning the full object plus metadata (id, type, version, summary, type-specific counts).

Intent

Agents need to read the full content of a specific .usm file to understand a service, feature, or system. The read tool parses the file and returns both the complete data and extracted metadata for quick agent scanning.

Flows

Read a .usm file (read-file)

Agent reads a specific .usm file

  1. get → file path
  2. parse → YAML content into typed object
  3. observe → metadata (type-specific counts for features/flows/contracts/tests)

Contracts

read-returns-full-data

Read must return both the full parsed object and metadata

Acceptance criteria:

  • [ ] Metadata includes id, type, version, summary
  • [ ] System files include featureCount, serviceCount
  • [ ] Feature files include flowCount, contractCount, testCount

Tests

read-feature-file

Given:

  • valid_feature_usm: true

Then:

  • assertion: response includes full parsed data
  • assertion: metadata includes flowCount, contractCount, testCount

Implementation

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

See Also

  • usm/mcp