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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace_id": "<workspace_id>",
"kind": "<kind>",
"name": "<name>",
"version": "<version>"
},
"name": "record_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) |