Marker UDA declaring the destructiveHint behavioral hint (ToolAnnotations.destructiveHint). Presence = true; absence = unset.
Marker UDA declaring the idempotentHint behavioral hint (ToolAnnotations.idempotentHint). Presence = true; absence = unset.
Marker UDA declaring the openWorldHint behavioral hint (ToolAnnotations.openWorldHint). Presence = true; absence = unset.
Marker UDA declaring the readOnlyHint behavioral hint (the MCP spec's ToolAnnotations.readOnlyHint). Attach alongside @tool; presence sets the hint to true, absence leaves it unset (omitted from the wire form).
Factory producing the @schemaDefault UDA so the element type is inferred from the supplied value (@schemaDefault(false) rather than @schemaDefault!bool(false)).
Field-level UDA declaring a default value (the JSON Schema default keyword) for a struct field. Named @schemaDefault to avoid clashing with D's default keyword. When jsonSchemaOf!T reflects over a struct, a field annotated with @schemaDefault(v) emits "default": v on its property schema, serializing the value (an enum value is emitted as its wire string, a bool as a JSON boolean, etc.).
Positional value UDA declaring the intended audience for a @resource- or @resourceTemplate-annotated method (the MCP Annotations.audience field). Pass one or more roles, e.g. @audience("user") or @audience("user", "assistant"). Absence leaves the audience unset.
UDA declaring a per-resource / per-template draft CacheableResult freshness hint for a @resource- or @resourceTemplate-annotated method. The reflection layer plumbs it through to the matching low-level registration so a draft resources/read carries ttlMs / cacheScope. Has no effect on pre-draft protocol versions (the server only emits cache fields when negotiated to draft).
Optional per-parameter description, attached to a function parameter or used alongside @tool to document a named argument.
Field-level UDA declaring the JSON Schema string format keyword (e.g. "email", "uri", "date-time") for a struct/elicitation field. Emitted verbatim onto the property schema by jsonSchemaOf.
Positional value UDA setting the annotation-level display title (ToolAnnotations.title), distinct from @tool's 3rd argument (Tool.title). Attach alongside @tool.
UDA declaring a display icon for a @tool, @resource, or @resourceTemplate-annotated method (the MCP Icons mixin: Tool.icons, Resource.icons). Attach one or more @icon UDAs to the same method; each becomes an entry in the descriptor's icons array. src is required; mimeType, sizes, and theme are optional.
Positional value UDA declaring the ISO 8601 lastModified timestamp for a @resource- or @resourceTemplate-annotated method (the MCP Annotations.lastModified field). Absence leaves it unset.
Field-level UDA declaring the JSON Schema maxItems keyword (maximum array length) for a struct/elicitation array field.
Field-level UDA declaring the JSON Schema maxLength keyword (maximum string length) for a struct/elicitation string field.
Field-level UDA declaring a numeric upper bound (the JSON Schema maximum keyword) for a struct field. See @minimum for usage; a field annotated with @maximum(v) emits "maximum": v on its property schema.
UDA marking a @tool parameter as mirrored into an HTTP request header.
UDA attaching a descriptor-level _meta object to a @tool, @resource, or @resourceTemplate-annotated method (the MCP _meta field on Tool, Resource, ResourceTemplate). The supplied JSON must be an object; it is emitted verbatim as the descriptor's _meta.
Field-level UDA declaring the JSON Schema minItems keyword (minimum array length) for a struct/elicitation array field.
Field-level UDA declaring the JSON Schema minLength keyword (minimum string length) for a struct/elicitation string field.
Field-level UDA declaring a numeric lower bound (the JSON Schema minimum keyword) for a struct field. When jsonSchemaOf!T reflects over a struct, a field annotated with @minimum(v) emits "minimum": v on its property schema. Intended for numeric / integer fields (e.g. tool input or elicitation form schemas); applying it to a non-numeric field has no defined meaning but the bound is still emitted verbatim.
Field-level UDA declaring the JSON Schema pattern keyword (an ECMA-262 regular expression a string must match) for a struct/elicitation field.
Positional value UDA declaring the importance priority (0.0..1.0) for a @resource- or @resourceTemplate-annotated method (the MCP Annotations.priority field). Absence leaves the priority unset.
UDA marking a method as an MCP prompt. The method returns the prompt's messages (a PromptMessage[], a GetPromptResult, or a string).
UDA marking a method as a static MCP resource. The method takes no arguments and returns the resource contents (string, or a ResourceContents).
UDA marking a method as a resource template (URI contains {var} placeholders). The method receives the captured parameters as its arguments.
Field-level UDA declaring a human-readable display title (the JSON Schema title keyword) for a struct field. When jsonSchemaOf!T reflects over a struct, a field annotated with @title("…") emits "title": "…" on its property schema.
UDA marking a method as an MCP tool. Apply to a member function; the input schema is derived from the parameter types, and the return value is wrapped into a tool result.
UDA declaring a @tool-annotated method's per-tool task-augmented execution support (the MCP 2025-11-25 Tool.execution descriptor). Attach alongside @tool; taskSupport must be "optional" or "required". Using "forbidden" (or omitting this UDA entirely) leaves the execution field absent from the wire form — both are equivalent to the spec default.