Annotation Interface McpPrompt


Marks a method as a MCP Prompt.
Author:
Christian Tzolov, Vadzim Shurmialiou, Craig Walls
  • Element Details

    • name

      String name
      Unique identifier for the prompt
      Default:
      ""
    • title

      String title
      Optional human-readable name of the prompt for display purposes.
      Default:
      ""
    • description

      String description
      Optional human-readable description.
      Default:
      ""
    • metaProvider

      Class<? extends MetaProvider> metaProvider
      Optional meta provider class that implements the MetaProvider interface. Used to provide additional metadata for the prompt. Defaults to DefaultMetaProvider.class if not specified.
      Default:
      org.springframework.ai.mcp.annotation.context.DefaultMetaProvider.class
    • icons

      McpIcon[] icons
      Optional icons for clients that render a catalogue.
      Since:
      2.1.0
      Default:
      {}
    • requiredCapabilities

      McpClientCapability[] requiredCapabilities
      Client capabilities the prompt cannot work without. A client whose request does not declare all of them is answered with JSON-RPC error -32021 Missing required client capability, listing the missing ones, before the method runs.

      Input the prompt can do without is requested only when McpModernSyncRequestContext.clientCapabilities() declares its capability, and needs no entry here.

      Only honoured by the 2026-07-28 ("modern") MCP server. The legacy servers ignore it, because their request context checks the capabilities the client sent at initialization.

      experimental and extension capabilities cannot be required this way; a method that depends on one is registered programmatically with ClientCapabilities.

      Since:
      2.1.0
      Default:
      {}