AgentTool
class AgentTool implements Approvable, Tool, Transient
Traits
Properties
| protected Approval|bool|null | $approvalRequirement | from InteractsWithApprovals |
Methods
Indicate that the tool requires approval before execution.
Indicate that the tool may execute without approval.
Determine whether the tool should request approval for the given request.
Get the name of the tool.
Get the description of the tool's purpose.
Report the sub-agent's failure and get the result the parent agent receives.
Details
in
InteractsWithApprovals at line 17
InteractsWithApprovals
requireApproval(string|null $reason = null)
Indicate that the tool requires approval before execution.
in
InteractsWithApprovals at line 27
InteractsWithApprovals
withoutApproval()
Indicate that the tool may execute without approval.
in
InteractsWithApprovals at line 37
Approval|null
shouldRequestApproval(Request $request)
Determine whether the tool should request approval for the given request.
at line 134
protected Approval|bool
needsApproval(Request $request)
Determine whether the tool needs approval for the given request.
at line 29
__construct(Agent $agent)
Create a tool that delegates work to the given agent.
at line 36
string
name()
Get the name of the tool.
at line 46
Stringable|string
description()
Get the description of the tool's purpose.
at line 59
Stringable|string
handle(Request $request)
Execute the tool.
at line 102
protected string
failedResult(Throwable $throwable)
Report the sub-agent's failure and get the result the parent agent receives.
at line 116
array
schema(JsonSchema $schema)
Get the tool's schema definition.
at line 126
Agent
agent()
Get the underlying agent instance.