MCPcopy Create free account
hub / github.com/AI45Lab/Code / normalize_mcp_transport_alias

Function normalize_mcp_transport_alias

sdk/python/src/lib.rs:6367–6383  ·  view source on GitHub ↗
(transport: &mut serde_json::Value)

Source from the content-addressed store, hash-verified

6365}
6366
6367fn normalize_mcp_transport_alias(transport: &mut serde_json::Value) {
6368 match transport {
6369 serde_json::Value::String(kind) => {
6370 if matches!(kind.as_str(), "streamable_http" | "streamableHttp") {
6371 *kind = "streamable-http".to_string();
6372 }
6373 }
6374 serde_json::Value::Object(obj) => {
6375 if let Some(serde_json::Value::String(kind)) = obj.get_mut("type") {
6376 if matches!(kind.as_str(), "streamable_http" | "streamableHttp") {
6377 *kind = "streamable-http".to_string();
6378 }
6379 }
6380 }
6381 _ => {}
6382 }
6383}
6384
6385/// Convert Python attachment dicts to Rust Attachment vec.
6386fn py_attachments_to_rust(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected