class GetFileMetadata extends FilesystemTool

Traits

Properties

protected Approval|bool|null $approvalRequirement from  InteractsWithApprovals

Methods

requireApproval(string|null $reason = null)

Indicate that the tool requires approval before execution.

withoutApproval()

Indicate that the tool may execute without approval.

Approval|null
shouldRequestApproval(Request $request)

Determine whether the tool should request approval for the given request.

Approval|bool
needsApproval(Request $request)

Determine whether the tool needs approval for the given request.

__construct(Filesystem|string|null $disk = null)

Create a filesystem tool for the given disk.

bool
fileExists(Filesystem $disk, string $path)

Determine whether the given path points to a file, not a directory.

disk()

Resolve the filesystem disk the tool operates on.

Stringable|string
description()

Get the description of the tool's purpose.

Stringable|string
handle(Request $request)

Execute the tool.

array
schema(JsonSchema $schema)

Get the tool's schema definition.

Details

InteractsWithApprovals requireApproval(string|null $reason = null)

Indicate that the tool requires approval before execution.

Parameters

string|null $reason

Return Value

InteractsWithApprovals

InteractsWithApprovals withoutApproval()

Indicate that the tool may execute without approval.

Return Value

InteractsWithApprovals

Approval|null shouldRequestApproval(Request $request)

Determine whether the tool should request approval for the given request.

Parameters

Request $request

Return Value

Approval|null

protected Approval|bool needsApproval(Request $request)

Determine whether the tool needs approval for the given request.

Parameters

Request $request

Return Value

Approval|bool

in FilesystemTool at line 23
__construct(Filesystem|string|null $disk = null)

Create a filesystem tool for the given disk.

Parameters

Filesystem|string|null $disk

in FilesystemTool at line 30
protected bool fileExists(Filesystem $disk, string $path)

Determine whether the given path points to a file, not a directory.

Parameters

Filesystem $disk
string $path

Return Value

bool

in FilesystemTool at line 38
protected Filesystem disk()

Resolve the filesystem disk the tool operates on.

Return Value

Filesystem

at line 19
Stringable|string description()

Get the description of the tool's purpose.

Return Value

Stringable|string

at line 27
Stringable|string handle(Request $request)

Execute the tool.

Parameters

Request $request

Return Value

Stringable|string

at line 64
array schema(JsonSchema $schema)

Get the tool's schema definition.

Parameters

JsonSchema $schema

Return Value

array