ApiTestTool class

A tool for testing API endpoints by sending HTTP requests.

Includes built-in SSRF protection via a configurable hostnameBlacklist and automatic body truncation to prevent prompt history bloat.

Inheritance

Constructors

ApiTestTool({List<String> hostnameBlacklist = const ['localhost', '127.0.0.1', '0.0.0.0', 'metadata.google.internal']})

Properties

description String
A description of what the tool does, for the agent's understanding.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hostnameBlacklist List<String>
Blacklist of sensitive hostnames to prevent SSRF.
final
name String
The name of the tool, used for identification in tool calls.
no setteroverride
parameters Map<String, dynamic>
JSON Schema describing the parameters this tool accepts.
no setteroverride
requiresConfirmation bool
Whether this tool requires human confirmation before execution.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
Maximum time this tool is allowed to run before being cancelled. Defaults to 30 seconds.
no setterinherited

Methods

execute(ApiTestArgs args) Future<String>
Executes the tool with the given arguments.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseArgs(Map<String, dynamic> json) ApiTestArgs
Parses the JSON arguments into the typed arguments object.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited