MCP PHP SDK

ToolChoice implements JsonSerializable

FinalYes

Controls how the model uses tools during sampling.

since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. Integrate with an LLM provider's API directly instead.

Table of Contents

Interfaces

JsonSerializable

Properties

$mode  : ToolChoiceMode

Methods

__construct()  : mixed
fromArray()  : self
jsonSerialize()  : array{mode: string}

Properties

Methods

fromArray()

public static fromArray(array{mode?: string} $data) : self
Parameters
$data : array{mode?: string}
Return values
self

jsonSerialize()

public jsonSerialize() : array{mode: string}
Return values
array{mode: string}
On this page

Search results