MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / json_rpc_max_body_bytes

Function json_rpc_max_body_bytes

crates/openshell-policy/src/lib.rs:541–548  ·  view source on GitHub ↗
(json_rpc: &Option<JsonRpcConfigDef>, mcp: &Option<McpConfigDef>)

Source from the content-addressed store, hash-verified

539}
540
541fn json_rpc_max_body_bytes(json_rpc: &Option<JsonRpcConfigDef>, mcp: &Option<McpConfigDef>) -> u32 {
542 // The proto has one JSON-RPC-family body limit. Prefer the MCP stanza when
543 // present because MCP policies should not need a shadow `json_rpc` block.
544 mcp.as_ref().map_or_else(
545 || json_rpc.as_ref().map_or(0, |config| config.max_body_bytes),
546 |config| config.max_body_bytes,
547 )
548}
549
550fn mcp_strict_tool_names(mcp: &Option<McpConfigDef>) -> Option<bool> {
551 mcp.as_ref().and_then(|config| config.strict_tool_names)

Callers 1

to_protoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected