pub struct Tool {
pub metadata: ToolMetadata,
/* private fields */
}Expand description
Self-contained tool with embedded HTTP client
Fields§
§metadata: ToolMetadataImplementations§
Source§impl Tool
impl Tool
Sourcepub fn new(
metadata: ToolMetadata,
base_url: Option<Url>,
default_headers: Option<HeaderMap>,
) -> Result<Self, Error>
pub fn new( metadata: ToolMetadata, base_url: Option<Url>, default_headers: Option<HeaderMap>, ) -> Result<Self, Error>
Create 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§
Auto Trait Implementations§
impl Freeze for Tool
impl !RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl !UnwindSafe for Tool
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