pub struct ToolGenerator;Expand description
Tool generator for creating MCP tools from OpenAPI operations
Implementations§
Source§impl ToolGenerator
impl ToolGenerator
Sourcepub fn generate_tool_metadata(
operation: &Operation,
method: String,
path: String,
spec: &Spec,
) -> Result<ToolMetadata, Error>
pub fn generate_tool_metadata( operation: &Operation, method: String, path: String, spec: &Spec, ) -> Result<ToolMetadata, Error>
Generate tool metadata from an OpenAPI operation
§Errors
Returns an error if the operation cannot be converted to tool metadata
Sourcepub fn generate_openapi_tools(
tools_metadata: Vec<ToolMetadata>,
base_url: Option<Url>,
default_headers: Option<HeaderMap>,
) -> Result<Vec<Tool>, Error>
pub fn generate_openapi_tools( tools_metadata: Vec<ToolMetadata>, base_url: Option<Url>, default_headers: Option<HeaderMap>, ) -> Result<Vec<Tool>, Error>
Generate OpenApiTool instances from tool metadata with HTTP configuration
§Errors
Returns an error if any OpenApiTool cannot be created
Sourcepub fn extract_parameters(
tool_metadata: &ToolMetadata,
arguments: &Value,
) -> Result<ExtractedParameters, ToolCallValidationError>
pub fn extract_parameters( tool_metadata: &ToolMetadata, arguments: &Value, ) -> Result<ExtractedParameters, ToolCallValidationError>
Extract parameter values from MCP tool call arguments
§Errors
Returns an error if the arguments are invalid or missing required parameters
Auto Trait Implementations§
impl Freeze for ToolGenerator
impl RefUnwindSafe for ToolGenerator
impl Send for ToolGenerator
impl Sync for ToolGenerator
impl Unpin for ToolGenerator
impl UnwindSafe for ToolGenerator
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