Backplane.AgentRuntime.InputSchema (backplane_agent_runtime v1.10.4)

Copy Markdown

JSON Schema Draft 2020-12 boundary for MCP tool arguments.

JSONSchex owns schema semantics. This module keeps the runtime contract deliberately small: MCP tool roots are objects, host-authored atom keys are normalized without creating atoms, and external references are loaded only through an explicitly supplied registry or loader.

Summary

Types

options()

@type options() :: [
  schema_registry: map(),
  schema_loader: (String.t() -> {:ok, map() | boolean()} | {:error, term()}),
  loader: (String.t() -> {:ok, map() | boolean()} | {:error, term()}),
  format_assertion: boolean(),
  content_assertion: boolean()
]

Functions

validate(schema, input)

@spec validate(term(), term()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

validate(schema, input, opts)

@spec validate(term(), term(), options()) ::
  {:ok, map()} | {:error, Backplane.AgentRuntime.Error.t()}

validate_schema(schema)

@spec validate_schema(term()) :: :ok | {:error, Backplane.AgentRuntime.Error.t()}

validate_schema(schema, opts)

@spec validate_schema(term(), options()) ::
  :ok | {:error, Backplane.AgentRuntime.Error.t()}