Skip to main content

use_aws_mcp/
lib.rs

1pub mod error;
2pub mod mcp_server;
3pub mod use_aws;
4
5pub use error::McpError;
6pub use mcp_server::AwsMcpServer;
7pub use use_aws::{UseAws, UseAwsRequest, UseAwsResponse};
8
9/// Maximum size for tool response output
10pub const MAX_TOOL_RESPONSE_SIZE: usize = 100_000;
11
12/// Output kind for tool responses
13#[derive(Debug, Clone)]
14pub enum OutputKind {
15    Text(String),
16    Json(serde_json::Value),
17}
18
19impl Default for OutputKind {
20    fn default() -> Self {
21        Self::Text(String::new())
22    }
23}
24
25/// Tool invocation output
26#[derive(Debug, Default)]
27pub struct InvokeOutput {
28    pub output: OutputKind,
29}
30
31impl InvokeOutput {
32    pub fn as_str(&self) -> &str {
33        match &self.output {
34            OutputKind::Text(s) => s.as_str(),
35            OutputKind::Json(j) => j.as_str().unwrap_or_default(),
36        }
37    }
38}