# `BB.MCP.JsonSchema`
[🔗](https://github.com/beam-bots/bb_mcp/blob/main/lib/bb/mcp/json_schema.ex#L5)

Converts BB command argument definitions into JSON Schema fragments.

Used to advertise command argument types to MCP clients via the
`list_commands` tool, so agents can know what to pass to `invoke_command`.

Maps Spark `:type` values to JSON Schema types:

    :integer        -> %{"type" => "integer"}
    :float, :number -> %{"type" => "number"}
    :boolean        -> %{"type" => "boolean"}
    :string         -> %{"type" => "string"}
    :atom           -> %{"type" => "string", "description" => "atom"}
    :map, {:map, fields} -> %{"type" => "object"}
    :keyword_list   -> %{"type" => "object"}
    :any            -> %{}
    module          -> %{"description" => "complex type: #{inspect(module)}"}

# `for_argument`

```elixir
@spec for_argument(BB.Dsl.Command.Argument.t()) :: map()
```

Build a JSON Schema fragment for a single command argument, including
description and default value where present.

# `for_command`

```elixir
@spec for_command(BB.Dsl.Command.t()) :: map()
```

Build a JSON Schema object describing a command's arguments.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
