{
  "specification": "RedBook Open XML",
  "version": "1.0",
  "capability": "eight-tool",
  "tools": [
    {
      "name": "readme",
      "description": "Open a fresh host-owned independent interaction, or read guidance for a known active interaction.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          },
          "tools": {
            "const": [
              "readme",
              "current_context",
              "list_contexts",
              "enter_context",
              "list_actions",
              "describe_actions",
              "perform_action",
              "navigate_to_view"
            ]
          },
          "context": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
          },
          "guidance": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "available": {
                  "type": "boolean"
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "available"
              ],
              "additionalProperties": false
            }
          },
          "receiptPolicy": {
            "type": "object",
            "properties": {
              "scopeId": {
                "type": "string",
                "minLength": 1
              },
              "expiresAt": {
                "type": "string"
              },
              "minimumRetentionSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "remainingReceiptCapacity": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "expiredScopeBehaviour": {
                "const": "reject"
              }
            },
            "required": [
              "scopeId",
              "expiresAt",
              "minimumRetentionSeconds",
              "remainingReceiptCapacity",
              "expiredScopeBehaviour"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "interactionId",
          "tools",
          "context",
          "guidance",
          "capabilities",
          "receiptPolicy"
        ],
        "additionalProperties": false
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "New session state only; never an authored event. A supplied unknown or expired interactionId is rejected, not recreated.",
      "clause": "4.9"
    },
    {
      "name": "current_context",
      "description": "Read this interaction selection and separately visible presentation.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "interactionId"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "context": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
          },
          "visibleView": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "context",
          "visibleView"
        ],
        "additionalProperties": false
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Read only. Visible presentation is not selection authority.",
      "clause": "4.9"
    },
    {
      "name": "list_contexts",
      "description": "Enumerate selectable Reader, RedBook and Viewbox contexts permitted by the host.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "interactionId"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "$ref": "https://redbook.fun/specification/1.0/schemas/context-descriptor.schema.json"
        }
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Read only; a context being visible does not grant Digital delegation.",
      "clause": "4.9"
    },
    {
      "name": "enter_context",
      "description": "Compare and replace this interaction selection and role.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          },
          "selectionRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "contextId": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "enum": [
              "reader-admin",
              "redbook-admin",
              "digital"
            ]
          },
          "digitalId": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "interactionId",
          "selectionRevision",
          "contextId",
          "role"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Selection changes only after successful host authorization; increment selectionRevision exactly once, even for an explicit reselection. Non-Digital role clears digitalId. No authored edit.",
      "clause": "4.9"
    },
    {
      "name": "list_actions",
      "description": "Discover action names, effects and availability in the selected context.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "interactionId"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "effect": {
              "enum": [
                "read",
                "write",
                "external"
              ]
            },
            "available": {
              "type": "boolean"
            },
            "unavailableReason": {
              "type": "string"
            },
            "capability": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "name",
            "description",
            "effect",
            "available",
            "capability"
          ],
          "additionalProperties": false
        }
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Read only. Distinguish known-but-unavailable from executable actions.",
      "clause": "4.9"
    },
    {
      "name": "describe_actions",
      "description": "Obtain complete input/output contracts and current invocation bindings.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          },
          "names": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "uniqueItems": true
          }
        },
        "required": [
          "interactionId",
          "names"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "action": {
              "$ref": "https://redbook.fun/specification/1.0/schemas/action-descriptor.schema.json"
            },
            "binding": {
              "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
            }
          },
          "required": [
            "action",
            "binding"
          ],
          "additionalProperties": false
        }
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Return descriptions in requested name order. Unknown or role-inaccessible names fail the whole call. No authored edit.",
      "clause": "4.9"
    },
    {
      "name": "perform_action",
      "description": "Invoke one described action against its exact typed binding.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "input": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/value.schema.json#/$defs/map"
          },
          "binding": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
          },
          "requestId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "interactionId",
          "name",
          "input",
          "binding"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "result": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/value.schema.json"
          },
          "context": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
          }
        },
        "required": [
          "result",
          "context"
        ],
        "additionalProperties": false
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Effect follows action descriptor. requestId required for write/external; atomically reserve its scoped identity before execution. Equal in-flight retry waits or returns REQUEST_IN_PROGRESS; conflicting reuse rejects. Commit freshness is checked at the mutation linearization point. Retained terminal replay returns the original response.",
      "clause": "4.9"
    },
    {
      "name": "navigate_to_view",
      "description": "Show a Viewbox without changing interaction selection, role or authorship.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "interactionId": {
            "type": "string",
            "minLength": 1
          },
          "viewboxId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "interactionId",
          "viewboxId"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "visibleView": {
            "type": "string",
            "minLength": 1
          },
          "context": {
            "$ref": "https://redbook.fun/specification/1.0/schemas/binding.schema.json"
          }
        },
        "required": [
          "visibleView",
          "context"
        ],
        "additionalProperties": false
      },
      "errorsSchema": {
        "$ref": "https://redbook.fun/specification/1.0/schemas/interface-error.schema.json"
      },
      "effects": "Host presentation operation only; validate Viewbox before navigation. An unavailable presentation host reports CAPABILITY_UNAVAILABLE.",
      "clause": "4.9"
    }
  ],
  "contractLayer": "RedBook domain interaction; not the public Jellybox WebMCP tool signatures",
  "webmcpAdapterProfile": "jellybox-webmcp-profile.json"
}
