call method
Validates, then dispatches — in one place, so no presentation can skip a step — inside the audit recording of this call.
The scope gates are not asked here. They are asked of each target the call resolves, through AgentToolContext.guard, because the exclusion gate is a fact about the target: a write cannot be refused as read-only before anyone has looked at whether its target is excluded outright. The call's declaration — isWrite — travels with it in a zone, so every target is guarded as what the tool does to it.
Implementation
FutureOr<Object?> call(C context, Map<String, Object?> raw) =>
AgentAuditRecording.run(
name,
context,
raw,
() => runZoned(
() => _invoke(context, arguments.validate(raw)),
zoneValues: {_callWritesKey: isWrite},
),
);