Return a copy of this Tool with any fields newer than (or absent from) the negotiated protocol version stripped, so the wire output stays valid for the peer's version. Tool.execution (ToolExecution.taskSupport) exists ONLY in the 2025-11-25 schema: it was never present before 2025-11-25 and was dropped again in the draft schema. It is therefore emitted only when the negotiated version is exactly 2025-11-25, and omitted for every other version (including draft). Mirrors Implementation.forVersion.
Parse the raw annotations Json into a typed ToolAnnotations on demand. The struct stores annotations as untyped Json (so unknown hint keys survive a round-trip); this accessor lazily decodes the known hints via ToolAnnotations.fromJson, returning a default (all-null) ToolAnnotations when annotations is not an object.
Fluent typed setter mirroring toolAnnotations(): encodes a typed ToolAnnotations into the raw annotations Json so callers never have to hand-build the .toJson() themselves (symmetric with the typed Resource/ResourceTemplate.annotations write path). An empty ToolAnnotations clears the field (leaves it Json.undefined), so it is omitted from the serialized form. The raw-Json storage is unchanged, so unknown annotation keys set via annotations directly still round-trip.
optional ToolAnnotations
optional per-tool task-augmented execution descriptor (2025-11-25)
optional icons for display in user interfaces
JSON Schema (object); defaults to empty object schema
optional JSON Schema for structured results
optional _meta object
A tool the server exposes for the model to call.