Skip to main content

resolve_explicit_namespace

Function resolve_explicit_namespace 

Source
pub fn resolve_explicit_namespace(
    params: &Value,
    default_namespace: &str,
) -> Result<Namespace, RuntimeError>
Expand description

Resolve and validate a caller-supplied namespace argument the same way on every MCP ingress path.

  • Absent namespace key → parse default_namespace.
  • Present namespace: "<string>" → parse the caller’s value.
  • Present non-string namespace (null, number, bool, array, object) → fail closed with RuntimeError::InvalidInput. ADR-018 requires this: a malformed explicit value must never be silently coerced to the default namespace.

Single chokepoint for both VerbRegistry::dispatch and the multi-backend coordinator intercept — see docs/api/pack.md#resolve_explicit_namespace.