Phantom.Tool.JSONSchema (phantom_mcp v0.3.2)

View Source

JSON Schema representing the arguments for the tool, either as input_schema or output_schema.

Learn more at https://json-schema.org/learn/getting-started-step-by-step

Example:

%{
  type: "object",
  properties: %{
    productId: %{
      description: "The unique identifier for a product",
      type: "integer"
    },
    productName: %{
      description: "Name of the product",
      type: "string"
    }
  }
}

Summary

Types

json()

@type json() :: %{required: boolean(), type: String.t(), properties: map()}

t()

@type t() :: %Phantom.Tool.JSONSchema{
  properties: map(),
  required: boolean(),
  type: String.t()
}

Functions

build(attrs)

to_json(json_schema)