Class PromptAdapter

java.lang.Object
org.springaicommunity.mcp.adapter.PromptAdapter

public class PromptAdapter extends Object
Utility class for adapting between McpPrompt annotations and McpSchema.Prompt objects.
Author:
Christian Tzolov
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.modelcontextprotocol.spec.McpSchema.Prompt
    asPrompt(McpPrompt mcpPrompt)
    Convert a McpPrompt annotation to a McpSchema.Prompt object.
    static io.modelcontextprotocol.spec.McpSchema.Prompt
    asPrompt(McpPrompt mcpPrompt, Method method)
    Convert a McpPrompt annotation to a McpSchema.Prompt object, including argument information from the method parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • asPrompt

      public static io.modelcontextprotocol.spec.McpSchema.Prompt asPrompt(McpPrompt mcpPrompt)
      Convert a McpPrompt annotation to a McpSchema.Prompt object.
      Parameters:
      mcpPrompt - The McpPrompt annotation
      Returns:
      The corresponding McpSchema.Prompt object
    • asPrompt

      public static io.modelcontextprotocol.spec.McpSchema.Prompt asPrompt(McpPrompt mcpPrompt, Method method)
      Convert a McpPrompt annotation to a McpSchema.Prompt object, including argument information from the method parameters.
      Parameters:
      mcpPrompt - The McpPrompt annotation
      method - The method annotated with McpPrompt
      Returns:
      The corresponding McpSchema.Prompt object with argument information