OzMcp.Pipeline.Bound (OzMcp v0.9.0)

Copy Markdown View Source

The entity of a request, found by the bind stage of the pipeline (OzMcp.Pipeline.Bind). The stage puts the struct in the field bound of the context and the authorize/3 callback of a verifier receives it as its third argument.

kind is the kind of the entity the request names:

  • :tool for tools/call: name is the tool name, module the tool module and entity the tool configuration. arguments holds the arguments (with the defaults of the input schema applied), input_errors the messages of a schema violation and task the metadata of a task-augmented call.
  • :resource or :template for resources/read and resources/subscribe: name is the uri, uri_params the values of the template variables.
  • :prompt for prompts/get: arguments holds the arguments of the request.
  • :completion for completion/complete: completion holds the reference, the argument and the context of the completion.
  • :task for tasks/get, tasks/list, tasks/cancel and tasks/result: name is the task id when the method carries one.
  • :none for every other method: params holds the params of the request.

The bound entity of a kind that names an entity carries the required_scopes of the entity, whatever form the module gave (the catalog stores a struct) and params holds the params of the request as the bind stage received or adjusted them.

Summary

Types

kind()

@type kind() :: :tool | :resource | :template | :prompt | :completion | :task | :none

t()

@type t() :: %OzMcp.Pipeline.Bound{
  arguments: map(),
  completion: map() | nil,
  entity: struct() | nil,
  input_errors: [String.t()] | nil,
  kind: kind(),
  module: module() | nil,
  name: String.t() | nil,
  params: map(),
  required_scopes: [String.t()],
  task: %{ttl: non_neg_integer() | nil} | nil,
  uri_params: map() | nil
}