pub struct OpenApiTool {
pub metadata: ToolMetadata,
/* private fields */
}Expand description
Self-contained OpenAPI tool with embedded HTTP client
Fields§
§metadata: ToolMetadataImplementations§
Source§impl OpenApiTool
impl OpenApiTool
Sourcepub fn new(
metadata: ToolMetadata,
base_url: Option<Url>,
default_headers: Option<HeaderMap>,
) -> Result<Self, OpenApiError>
pub fn new( metadata: ToolMetadata, base_url: Option<Url>, default_headers: Option<HeaderMap>, ) -> Result<Self, OpenApiError>
Create OpenAPI tool with HTTP configuration
Sourcepub async fn call(
&self,
arguments: &Value,
) -> Result<CallToolResult, ToolCallError>
pub async fn call( &self, arguments: &Value, ) -> Result<CallToolResult, ToolCallError>
Execute tool and return MCP-compliant result
Sourcepub async fn execute(
&self,
arguments: &Value,
) -> Result<HttpResponse, ToolCallError>
pub async fn execute( &self, arguments: &Value, ) -> Result<HttpResponse, ToolCallError>
Execute tool and return raw HTTP response
Trait Implementations§
Source§impl Clone for OpenApiTool
impl Clone for OpenApiTool
Source§fn clone(&self) -> OpenApiTool
fn clone(&self) -> OpenApiTool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<&OpenApiTool> for Tool
MCP compliance - Convert OpenApiTool to rmcp::model::Tool
impl From<&OpenApiTool> for Tool
MCP compliance - Convert OpenApiTool to rmcp::model::Tool
Source§fn from(openapi_tool: &OpenApiTool) -> Self
fn from(openapi_tool: &OpenApiTool) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpenApiTool
impl !RefUnwindSafe for OpenApiTool
impl Send for OpenApiTool
impl Sync for OpenApiTool
impl Unpin for OpenApiTool
impl !UnwindSafe for OpenApiTool
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
Mutably borrows from an owned value. Read more