record_contract
Store service contracts (OpenAPI, gRPC, event schemas) in a code graph for AI coding agents to reference and use with bind_contract operations.
Instructions
Persist a service contract (OpenAPI, proto, event schema, etc.) to the code graph. Returns a contract_id to use with bind_contract.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | Workspace to store contract in | |
| kind | Yes | Contract type — matches the parser output kind | |
| name | Yes | Human-readable contract name (e.g. "Payment Service API") | |
| version | Yes | Contract version (e.g. "1.2.0" or "payments.v1") | |
| spec_url | No | Optional URL to the raw spec file (OpenAPI URL, proto repo link, etc.) | |
| schema | No | Parsed schema snapshot as JSON — set by the contract parser (M4) |