pub struct McpToolAdapter {
pub openai_name: String,
pub mcp_tool_name: String,
pub description: String,
pub input_schema: Value,
pub result_cap_bytes: usize,
pub client: Arc<McpClient>,
}Expand description
A Rig dynamic-tool view of one MCP-discovered tool.
openai_name is what the LLM sees and what
ToolDyn::name returns. mcp_tool_name is the original name from
tools/list, used on the wire when dispatching back into the MCP server.
client is shared (via Arc) so multiple adapters fronting the same MCP
server reuse one connection.
Fields§
§openai_name: String§mcp_tool_name: String§description: String§input_schema: Value§result_cap_bytes: usize§client: Arc<McpClient>Implementations§
Source§impl McpToolAdapter
impl McpToolAdapter
Sourcepub async fn from_client_tools(
client: Arc<McpClient>,
result_cap_bytes: usize,
) -> Result<Vec<McpToolAdapter>>
pub async fn from_client_tools( client: Arc<McpClient>, result_cap_bytes: usize, ) -> Result<Vec<McpToolAdapter>>
Build one adapter per tool the server advertises. The server’s local
name (from McpClient::name) becomes the prefix.
Trait Implementations§
Source§impl Clone for McpToolAdapter
impl Clone for McpToolAdapter
Source§fn clone(&self) -> McpToolAdapter
fn clone(&self) -> McpToolAdapter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for McpToolAdapter
impl Debug for McpToolAdapter
Source§impl ToolDyn for McpToolAdapter
impl ToolDyn for McpToolAdapter
Source§fn definition(&self, _prompt: String) -> WasmBoxedFuture<'_, ToolDefinition>
fn definition(&self, _prompt: String) -> WasmBoxedFuture<'_, ToolDefinition>
Returns the provider-facing tool schema.
Auto Trait Implementations§
impl !RefUnwindSafe for McpToolAdapter
impl !UnwindSafe for McpToolAdapter
impl Freeze for McpToolAdapter
impl Send for McpToolAdapter
impl Sync for McpToolAdapter
impl Unpin for McpToolAdapter
impl UnsafeUnpin for McpToolAdapter
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