pub struct UseAwsTool { /* private fields */ }Expand description
Tool for making AWS API calls using SigV4 signing.
This tool provides a universal interface to AWS services, allowing agents to invoke any AWS API operation dynamically. It supports:
- All AWS services accessible via JSON-based APIs
- Multiple credential sources (environment, profiles, IAM roles, SSO)
- SigV4 request signing for authentication
- Automatic region-specific endpoint resolution
- Extensible service target prefix configuration
§Construction
This tool requires async initialization due to AWS credential loading.
Use UseAwsTool::new().await or UseAwsTool::builder()...build().await.
Note: Unlike other tools in this crate, UseAwsTool does not implement
Default because it requires async credential loading. Attempting to use
an uninitialized tool will result in credential errors.
§Safety
Operations that match mutative prefixes (Create, Delete, Update, etc.) will include a warning in the output. The calling application should implement appropriate confirmation mechanisms.
Implementations§
Source§impl UseAwsTool
impl UseAwsTool
Sourcepub async fn new() -> Result<Self, ToolError>
pub async fn new() -> Result<Self, ToolError>
Create a new UseAwsTool with default configuration.
This loads credentials from the default AWS credential chain:
- Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
- Shared credentials file (~/.aws/credentials)
- IAM instance profile (on EC2)
- Container credentials (in ECS/Fargate)
- SSO credentials (if configured)
§Errors
Returns an error if no AWS credentials are found.
Sourcepub fn builder() -> UseAwsToolBuilder
pub fn builder() -> UseAwsToolBuilder
Create a builder for custom configuration.
Trait Implementations§
Source§impl Tool for UseAwsTool
impl Tool for UseAwsTool
Source§type Input = UseAwsInput
type Input = UseAwsInput
Deserialize and JsonSchema.Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§async fn execute(&self, input: Self::Input) -> Result<ToolResult, ToolError>
async fn execute(&self, input: Self::Input) -> Result<ToolResult, ToolError>
Source§fn format_output_plain(&self, result: &ToolResult) -> String
fn format_output_plain(&self, result: &ToolResult) -> String
Source§fn format_output_ansi(&self, result: &ToolResult) -> String
fn format_output_ansi(&self, result: &ToolResult) -> String
Source§fn format_output_markdown(&self, result: &ToolResult) -> String
fn format_output_markdown(&self, result: &ToolResult) -> String
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
Source§fn format_input_plain(&self, params: &Value) -> String
fn format_input_plain(&self, params: &Value) -> String
Auto Trait Implementations§
impl Freeze for UseAwsTool
impl !RefUnwindSafe for UseAwsTool
impl Send for UseAwsTool
impl Sync for UseAwsTool
impl Unpin for UseAwsTool
impl UnsafeUnpin for UseAwsTool
impl !UnwindSafe for UseAwsTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more