| 539 | } |
| 540 | |
| 541 | fn 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 | |
| 550 | fn mcp_strict_tool_names(mcp: &Option<McpConfigDef>) -> Option<bool> { |
| 551 | mcp.as_ref().and_then(|config| config.strict_tool_names) |