MCPcopy Create free account
hub / github.com/dallay/agentsync / json_map_from_server_refs

Function json_map_from_server_refs

src/mcp.rs:221–233  ·  view source on GitHub ↗

Build a JSON object from server configs.

(
    servers: &BTreeMap<&str, &McpServerConfig>,
    mut server_to_value: F,
)

Source from the content-addressed store, hash-verified

219
220/// Build a JSON object from server configs.
221fn json_map_from_server_refs<F>(
222 servers: &BTreeMap<&str, &McpServerConfig>,
223 mut server_to_value: F,
224) -> Map<String, Value>
225where
226 F: FnMut(&McpServerConfig) -> Value,
227{
228 json_map_from_pairs(
229 servers
230 .iter()
231 .map(|(name, config)| ((*name).to_string(), server_to_value(config))),
232 )
233}
234
235/// Build a JSON object from existing JSON values.
236fn json_map_from_values(values: BTreeMap<String, Value>) -> Map<String, Value> {

Callers 2

format_standard_mcpFunction · 0.85
formatMethod · 0.85

Calls 1

json_map_from_pairsFunction · 0.85

Tested by

no test coverage detected