class SearchTools extends Tool

Traits

Properties

static protected array<string, null|list<object>|object> $attributeCache from  ReadsAttributes
protected null|array<string, mixed> $meta from  HasMeta
protected string $name
protected string $title
protected string $description from  Primitive

Methods

mixed
resolveAttribute(string $attributeClass)

Resolve the nearest matching attribute in the class hierarchy.

array
resolveAttributes(string $attributeClass)

Resolve all matching attributes in the class hierarchy.

static void
flushState()

Flush all static state.

array
resolvedIcons()

Resolve icons from attributes and the primitive's icons method.

from  HasIcons
void
setMeta(array|string $meta, mixed $value = null)

Set response metadata using an array or key-value pair.

from  HasMeta
array
mergeMeta(array $baseArray)

Merge metadata into the given response array.

from  HasMeta
string
name()

Get the primitive name.

string
title()

Get the primitive title.

string
description()

Describe tool search.

array|null
meta()

Get the primitive metadata.

array
icons()

Get the primitive icons.

array
mergeIcons(array $baseArray)

Merge the resolved icons into the primitive array.

bool
eligibleForRegistration()

Determine whether the primitive may be registered for this request.

array
toMethodCall()

Convert the tool to a method call.

from  Tool
array
toArray()

Get the tool's array representation.

from  Tool
array
annotations()

Get the primitive annotations.

array
allowedAnnotations()

Get the annotation types allowed on this primitive.

array
schema(JsonSchema $schema)

Define the search arguments.

array
outputSchema(JsonSchema $schema)

Define the output schema for this tool's results.

from  Tool
__construct(ToolSearch $catalog)

Create the catalog search tool.

handle(Request $request)

Search the catalog with validated arguments.

Details

in ReadsAttributes at line 24
protected mixed resolveAttribute(string $attributeClass)

Resolve the nearest matching attribute in the class hierarchy.

Parameters

string $attributeClass

Return Value

mixed

in ReadsAttributes at line 56
protected array resolveAttributes(string $attributeClass)

Resolve all matching attributes in the class hierarchy.

Parameters

string $attributeClass

Return Value

array

in ReadsAttributes at line 82
static void flushState()

Flush all static state.

Return Value

void

in HasIcons at line 19
array resolvedIcons()

Resolve icons from attributes and the primitive's icons method.

Return Value

array

in HasMeta at line 21
void setMeta(array|string $meta, mixed $value = null)

Set response metadata using an array or key-value pair.

Parameters

array|string $meta
mixed $value

Return Value

void

in HasMeta at line 46
array mergeMeta(array $baseArray)

Merge metadata into the given response array.

Parameters

array $baseArray

Return Value

array

in Primitive at line 34
string name()

Get the primitive name.

Return Value

string

in Primitive at line 44
string title()

Get the primitive title.

Return Value

string

at line 30
string description()

Describe tool search.

Return Value

string

in Primitive at line 66
array|null meta()

Get the primitive metadata.

Return Value

array|null

in Primitive at line 76
array icons()

Get the primitive icons.

Return Value

array

in Primitive at line 89
protected array mergeIcons(array $baseArray)

Merge the resolved icons into the primitive array.

Parameters

array $baseArray

Return Value

array

in Primitive at line 103
bool eligibleForRegistration()

Determine whether the primitive may be registered for this request.

Return Value

bool

in Tool at line 44
array toMethodCall()

Convert the tool to a method call.

Return Value

array

in Tool at line 63
array toArray()

Get the tool's array representation.

Return Value

array

in HasAnnotations at line 19
array annotations()

Get the primitive annotations.

Return Value

array

in HasAnnotations at line 68
protected array allowedAnnotations()

Get the annotation types allowed on this primitive.

Return Value

array

at line 38
array schema(JsonSchema $schema)

Define the search arguments.

Parameters

JsonSchema $schema

Return Value

array

in Tool at line 34
array outputSchema(JsonSchema $schema)

Define the output schema for this tool's results.

Parameters

JsonSchema $schema

Return Value

array

at line 23
__construct(ToolSearch $catalog)

Create the catalog search tool.

Parameters

ToolSearch $catalog

at line 49
Response handle(Request $request)

Search the catalog with validated arguments.

Parameters

Request $request

Return Value

Response