Class HttpToolProvider

java.lang.Object
com.agentforge4j.tools.http.HttpToolProvider
All Implemented Interfaces:
ToolProvider

public final class HttpToolProvider extends Object implements ToolProvider
ToolProvider that fulfils logical capabilities with single governed HTTP calls described by code-defined HttpEndpointDefinitions. It is the tool-SPI-native successor to the legacy endpoint-call command: capability resolution stays with the resolver; this provider maps one capability invocation to one request, applies a transient-only retry/timeout policy that can only tighten the runtime options, and maps the response to a ToolResult.

All definitions are validated at construction (fail-fast) so a bad configuration is rejected at wiring time, not mid-run. Secret header values are resolved through the supplied resolver at invoke time and are never inlined into a definition or routed through arguments.

  • Constructor Details

    • HttpToolProvider

      public HttpToolProvider(String configuredName, List<HttpEndpointDefinition> definitions, Function<String,String> secretResolver, HttpClient httpClient, OutboundEgressGuard egressGuard, ToolExecutionOptions defaultOptions, long defaultMaxResponseBytes, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Creates a provider over a fixed set of endpoint definitions, validating them up front.
      Parameters:
      configuredName - non-blank name; providerId() is "http:" + name
      definitions - endpoint definitions; non-null, each validated up front
      secretResolver - secret-reference key to value resolver, used at invoke time
      httpClient - the JDK HTTP client used for all calls
      egressGuard - SSRF egress guard consulted against each mapped URL before the call
      defaultOptions - fallback execution options when none are supplied at invoke
      defaultMaxResponseBytes - response body read cap for definitions that do not set one
      Throws:
      IllegalArgumentException - if the name is blank or any definition is invalid
  • Method Details