BB.MCP.ArgumentType (bb_mcp v0.3.3)

Copy Markdown View Source

How a BB command argument's declared type appears on the MCP wire.

BB.MCP.JsonSchema advertises a command's arguments and BB.MCP.PeriSchema validates what comes back against the same command, so the two have to agree on the rendering exactly — a value advertised as "gentle" but validated as :gentle is rejected for looking like what we asked for. They share this module rather than each deciding for themselves.

Summary

Functions

The base type every member of an {:in, values} enum shares, or :any when they have none in common.

Render one member of an {:in, values} enum as the value a client sends.

Functions

enum_base(values)

@spec enum_base([term()]) :: :integer | :float | :string | :any

The base type every member of an {:in, values} enum shares, or :any when they have none in common.

wire_value(value)

@spec wire_value(term()) :: term()

Render one member of an {:in, values} enum as the value a client sends.

JSON has no atoms, so an atom member travels as its name.