When designing or evolving API surfaces (function interfaces, host/tool lists, REST/WebSocket payloads, and request headers), make the contract unambiguous and single-sourced.
Apply these rules: 1) Replace positional booleans with named options
load({ refresh: true, userInitiated: true }) over load(true, true).function load(args: { refresh?: boolean; userInitiated?: boolean } = {}) {
const { refresh = false, userInitiated = false } = args;
// ...
}
2) Don’t “almost” follow the spec—encode it unconditionally
"model", implement the visibility filter without exceptions tied to unrelated flags.3) Keep field/header names semantically aligned with their values
ulid in X-Task-ID).4) Avoid duplicated readiness/config flags
These changes prevent silent behavior changes, reduce call-site confusion, and keep client/server integration stable as the codebase evolves.