CustomFieldSchema ​
- Type
- Class
- Namespace
- craft\mcp\schema
- Inherits
- craft\mcp\schema\CustomFieldSchema
- Since
- 5.12.0
Public Methods ​
| Method | Description |
|---|---|
| __construct() | |
| forElement() | |
| prepareValues() | Validates custom field values against the schema {@see forElement()} describes, and converts them into the format the fields accept. |
__construct() ​
Arguments ​
$schemaValidator
forElement() ​
Arguments ​
$element
Returns ​
array<string,mixed>
prepareValues() ​
Validates custom field values against the schema {@see forElement()} describes, and converts them into the format the fields accept.
Schemas inferred from a field's GraphQL mutation argument type describe GraphQL input, such as Matrix entries keyed by entry type handle, so their values go through the same normalizers the GraphQL API applies.
Arguments ​
$element$values(array<string,mixed>)
Returns ​
array<string,mixed>
Throws ​
\Mcp\Exception\ToolCallException
if the values don’t match the schema.