AgentToolsRequest

Agent Tools Request

Encapsulates all parameters for a single provider request. Pass an instance to AgentToolsAgent::sendProviderRequest() or AgentToolsEngineer::sendProviderRequest().

$agent = $at->getPrimaryAgent();

create a new request
$request = new AgentToolsRequest($agent);
$request->systemPrompt = 'You are a concise assistant.';
$request->messages = [['role' => 'user', 'content' => 'List the top 3 templates.']];
$request->options = ['openai' => ['reasoning_effort' => 'high']];

send the request and get a response
$response = $agent->sendProviderRequest($request);

Hook example — modify the request before dispatch:

$wire->addHookBefore('AgentToolsEngineer::sendProviderRequest', function(HookEvent $e) {
$request = $e->arguments(0); // AgentToolsRequest
$request->options['openai']['temperature'] = 0.2;
});

Copyright 2026 Ryan Cramer and Claude (Anthropic) | MIT


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the AgentToolsRequest class also inherits all the methods and properties of: WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
AgentToolsRequest::getAgent()
AgentToolsAgent null

Get the agent this request was populated from, if any

 
AgentToolsRequest::set(string $key, mixed $value)
Wire

Set a property, normalizing 'endpointUrl' to 'endpoint' for AgentToolsAgent compatibility

 
AgentToolsRequest::setAgent(AgentToolsAgent $agent)
self

Populate connection properties from an AgentToolsAgent

 

Properties

NameReturnSummary 
AgentToolsRequest::apiKey string API key for the provider 
AgentToolsRequest::endpoint string Base endpoint URL (OpenAI-compatible providers only) 
AgentToolsRequest::messages array Array of message objects: [['role' => 'user'|'assistant', 'content' => '...'], ...] 
AgentToolsRequest::model string Model ID to use 
AgentToolsRequest::options array Request options: timeout (int), anthropic (array), openai (array) 
AgentToolsRequest::provider string Provider name: 'anthropic' or 'openai' 
AgentToolsRequest::systemPrompt string System prompt, or empty string for none 
AgentToolsRequest::tools array Tool definitions in provider format 

Additional methods and properties

In addition to the methods and properties above, AgentToolsRequest also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.263