MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / register_tool_request_intercept

Function register_tool_request_intercept

crates/wasm/src/api/mod.rs:1176–1193  ·  view source on GitHub ↗
(
    name: &str,
    priority: i32,
    #[wasm_bindgen(js_name = "breakChain")] break_chain: bool,
    #[wasm_bindgen(
        js_name = "callable",
        unchecked_param_type = "(name: string, arg

Source from the content-addressed store, hash-verified

1174/// - `func` - JS function `(name, args) => transformedArgs`.
1175#[wasm_bindgen(js_name = "registerToolRequestIntercept")]
1176pub fn register_tool_request_intercept(
1177 name: &str,
1178 priority: i32,
1179 #[wasm_bindgen(js_name = "breakChain")] break_chain: bool,
1180 #[wasm_bindgen(
1181 js_name = "callable",
1182 unchecked_param_type = "(name: string, args: Json) => any"
1183 )]
1184 func: Function,
1185) -> Result<(), JsValue> {
1186 relay_registry_api::register_tool_request_intercept(
1187 name,
1188 priority,
1189 break_chain,
1190 callable::wrap_js_tool_request_intercept_fn(func),
1191 )
1192 .map_err(to_js_err)
1193}
1194
1195/// Removes a previously registered tool request intercept by name.
1196///

Calls 1