# records.limits

Inspect protocol and current contributor-safe service write bounds.

Capability: op_sys_records_limits
Protocol: op-sys.capabilities.v1
Runtime: 0.3.0
Availability: Local or hosted ledger operations, including cross-ledger discovery, search and feed.
Optional integration: false
Canonical page: /docs/reference/op_sys_records_limits

## Authority

The authenticated issuer-qualified principal must hold the requested ledger permission.

## Invocation

CLI, SDK and MCP use the same operation and arguments; where a hosted HTTP binding exists, its route carries the same domain contract. Host paths and environment references refer to the runtime host. Request template: replace placeholder IDs and supply complete contract-specific objects before use. This is not a complete runnable workflow.

### CLI

```sh
op-sys --output json tools call op_sys_records_limits \
  --arguments '{"ledger_id":"<ledger_id>"}'
```

### Python SDK

```python
import json
from op_sys import OpSys

client = OpSys()
arguments = json.loads("{\"ledger_id\":\"<ledger_id>\"}")
result = client.capabilities.call(
    "op_sys_records_limits", arguments
)
print(result)
```

### MCP (initialized connection)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "op_sys_records_limits",
    "arguments": {
      "ledger_id": "<ledger_id>"
    }
  }
}
```

### HTTP

```sh
curl --fail-with-body --request GET "$VEYLAR_ENDPOINT/v1/ledgers/$LEDGER_ID/records/limits" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Veylar-Tenant: $TENANT_ID"
```

Named CLI command: op-sys records limits (use --help for flags).

SDK convenience: client.records.limits(…). The capability adapter may wrap the result.

## Parameters

### ledger_id

Required; string. Stable ledger identity, local or hosted. A display name is not interchangeable with this ID.

minLength: 1; maxLength: 128

### Complete input schema

```json
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "ledger_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "ledger_id"
  ]
}
```

## Behavior

- Requires records.append; attached files additionally require files.read. Append-only participants receive no hidden schema details.
- Uses the current authority and does not guarantee future acceptance.
- Inspect the admitted contract before writing.
- Accepted records retain immutable identity and acceptance facts.
- Pending contributions are separate from accepted history.

## Response

Returns RecordWriteLimits. Service choices pair payload and indexed-input bounds; both dimensions must fit one choice. No prices or account billing metadata are included.

### Complete result JSON Schema

```json
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "ledger_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "revision": {
      "type": "integer",
      "minimum": 1
    },
    "protocol": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "payload_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "json_depth": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "json_nodes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "file_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "file_chunk_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "attachments": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "record_request_bytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "payload_bytes",
        "json_depth",
        "json_nodes",
        "file_bytes",
        "file_chunk_bytes",
        "attachments",
        "record_request_bytes"
      ]
    },
    "service": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "not_applicable",
            "configured",
            "unavailable"
          ]
        },
        "choices": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "payload_bytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "indexed_bytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "payload_bytes",
              "indexed_bytes"
            ]
          },
          "description": "A contribution must fit BOTH dimensions of at least one choice. These are size bounds, not prices or account billing metadata."
        }
      },
      "required": [
        "state",
        "choices"
      ]
    }
  },
  "required": [
    "ledger_id",
    "revision",
    "protocol",
    "service"
  ]
}
```


[Runtime output field catalog](/docs/output-contracts.json) (descriptive contracts, not JSON Schema validators).

CLI: use --output json. For tools call, read the operation result at payload.tool.result; payload.tool.name identifies the capability. The outer envelope is {schema_version: "v1", payload: {tool: {name, result}}}.

Python: client.capabilities.call(name, arguments) returns the operation result. SDK exceptions preserve reason and code.

MCP: tools/call returns JSON text and structuredContent. Application failures set isError; inspect reason/code instead of matching message text.

Related resource schemas (not necessarily a complete operation response):
- [ledger-core.v1.schema.json](/docs/schemas/ledger-core.v1.schema.json)

## Errors and recovery

[Ledger limits and operation catalog](/docs/ledger-core.json)

Canonical operation: records.limits

Permissions: records.append

Retry: read_only; concurrency: none

Codes: invalid_input, contract_invalid, payload_invalid, contract_not_admitted, permission_denied, not_found, revision_conflict, operation_conflict, unsupported, authority_unavailable, outcome_uncertain, outcome_expired, validation_context_unavailable, file_unavailable, integrity_failure, ledger_archived, ledger_deleted, resnapshot_required, identity_changed, authority_fenced, withdrawal_requires_resolution, limit_exceeded, rate_limited, payment_required

[HTTP status mappings and schemas](/docs/ledger-core.openapi.json)

- permission_denied: Inspect the selected principal and ledger grants.
- payload_invalid: Correct the input against the admitted contract.

Family reasons are representative, not exhaustive.

A timeout is not proof that a write failed. Reuse the documented retry identity, batch, offset or mutation ID. If this operation has no documented retry identity, inspect its state before repeating it.

On authorization failure, correct the configured identity or grants; do not change the local actor to impersonate a hosted principal. On validation failure, correct the input against the published schema and selected contract.

On a revision or state conflict, retrieve current state and reconcile intent. Do not automatically overwrite a competing update. Preserve unknown additive response fields when building consumers.

## Source manuals

- [local-records](/docs/raw/manuals/local-records.md)
- [public-capabilities](/docs/raw/manuals/public-capabilities.md)
- [command-output-schema](/docs/raw/manuals/command-output-schema.md)
