Annotation Interface McpPrompt
Marks a method as a MCP Prompt.
- Author:
- Christian Tzolov, Vadzim Shurmialiou, Craig Walls
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionOptional human-readable description.McpIcon[]Optional icons for clients that render a catalogue.Class<? extends MetaProvider>Optional meta provider class that implements the MetaProvider interface.Unique identifier for the promptClient capabilities the prompt cannot work without.Optional human-readable name of the prompt for display purposes.
-
Element Details
-
name
String nameUnique identifier for the prompt- Default:
- ""
-
title
String titleOptional human-readable name of the prompt for display purposes.- Default:
- ""
-
description
String descriptionOptional human-readable description.- Default:
- ""
-
metaProvider
Class<? extends MetaProvider> metaProviderOptional meta provider class that implements the MetaProvider interface. Used to provide additional metadata for the prompt. Defaults toDefaultMetaProvider.classif not specified.- Default:
- org.springframework.ai.mcp.annotation.context.DefaultMetaProvider.class
-
icons
McpIcon[] iconsOptional icons for clients that render a catalogue.- Since:
- 2.1.0
- Default:
- {}
-
requiredCapabilities
McpClientCapability[] requiredCapabilitiesClient 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.
experimentaland extension capabilities cannot be required this way; a method that depends on one is registered programmatically withClientCapabilities.- Since:
- 2.1.0
- Default:
- {}
-