Skip to main content

normalize_for_provider

Function normalize_for_provider 

Source
pub fn normalize_for_provider(
    adapter: &dyn SchemaAdapter,
    schema: Value,
) -> Value
Expand description

Verifies that a schema is normalized for a given provider adapter.

After normalization:

  • $schema keyword is removed (all providers reject it)
  • The schema is still a valid JSON object
  • Required provider-specific transformations are applied

§Arguments

  • adapter - The provider’s schema adapter.
  • schema - The raw MCP tool schema.

§Returns

The normalized schema.