Skip to main content

take_fields

Function take_fields 

Source
pub fn take_fields(
    object: &mut Map<String, Value>,
    fields: &[&str],
) -> Map<String, Value>
Expand description

Remove fields from object, returning those present as an object of their own.

How a flat body is split into its envelope and its payload: serde’s deny_unknown_fields does not work through #[serde(flatten)], so the envelope’s fields are taken out by name and the rest goes to the payload, which then denies whatever it does not know. The server’s MCP tool parameters split their (optional) envelope the same way.