icon

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.

Members

Variables

mimeType
string mimeType;

optional MIME type, e.g. "image/png" (empty = unset)

sizes
string[] sizes;

optional size strings, e.g. ["48x48", "96x96"]

src
string src;

URI or data: URL of the icon (required)

theme
string theme;

optional theme preference: "light" or "dark" (empty = unset)

Examples

@tool("draw", "Draw something")
@icon("https://example.com/draw.png", "image/png", ["48x48"], "dark")
string draw(string spec) { ... }