Package org.mcpjava.server.prompts
Interface PromptResponse
- All Superinterfaces:
MetaCarrier
Represents the result of a
prompts/get call.
The result contains a list of messages which should be used to prompt the LLM.
Returning a PromptResponse from a Prompt-annotated method gives more control over
the response that's returned to the client.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for creating a prompt response -
Method Summary
Modifier and TypeMethodDescriptionstatic PromptResponse.Builderbuilder()Create a builder for a newPromptResponseA description of the promptmessages()The prompt messagesstatic PromptResponseof(Role role, ContentBlock content) Create a newPromptResponsewith a single messageMethods inherited from interface org.mcpjava.server.MetaCarrier
metadata
-
Method Details
-
description
A description of the prompt- Returns:
- the description, or an empty
Optionalif not provided
-
messages
List<PromptMessage> messages()The prompt messages- Returns:
- the messages
-
builder
Create a builder for a newPromptResponse- Returns:
- the new
PromptResponsebuilder
-
of
Create a newPromptResponsewith a single message- Parameters:
role- the role for the messagecontent- the content of the message- Returns:
- the new prompt response
-