Class McpServerUtils

java.lang.Object
io.meeds.mcp.server.util.McpServerUtils

public class McpServerUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The optional argument every tool answering a list takes (returnsList(ToolCallback)), unless it declares one of its own with that name: the comma-separated top-level keys to keep in each item of a list result.
    static final String
    The description of the FIELDS_ARGUMENT argument, as clients list it.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.springframework.ai.tool.ToolCallback>
    aggregateToolCallbacks(org.springframework.beans.factory.ObjectProvider<List<org.springframework.ai.tool.ToolCallback>> toolCalls, List<org.springframework.ai.tool.ToolCallback> toolCallbacksList, List<org.springframework.ai.tool.ToolCallbackProvider> toolCallbackProvider)
     
    static org.springframework.util.MimeType
    getMimeType(String toolName)
     
    static Map<String,String>
     
    static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification>
    toAsyncToolSpecification(List<org.springframework.ai.tool.ToolCallback> tools)
     
    static io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification
    toAsyncToolSpecification(org.springframework.ai.tool.ToolCallback toolCallback, org.springframework.util.MimeType mimeType)
     
    static io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification
    toSyncToolSpecification(org.springframework.ai.tool.ToolCallback toolCallback, org.springframework.util.MimeType mimeType)
     
    static List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification>
    toSyncToolSpecifications(List<org.springframework.ai.tool.ToolCallback> tools)
     

    Methods inherited from class Object

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

    • FIELDS_ARGUMENT

      public static final String FIELDS_ARGUMENT
      The optional argument every tool answering a list takes (returnsList(ToolCallback)), unless it declares one of its own with that name: the comma-separated top-level keys to keep in each item of a list result.
      See Also:
    • FIELDS_DESCRIPTION

      public static final String FIELDS_DESCRIPTION
      The description of the FIELDS_ARGUMENT argument, as clients list it.
      See Also:
  • Method Details

    • getToolResponseMimeType

      public static Map<String,String> getToolResponseMimeType()
    • toSyncToolSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> toSyncToolSpecifications(List<org.springframework.ai.tool.ToolCallback> tools)
    • toAsyncToolSpecification

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification> toAsyncToolSpecification(List<org.springframework.ai.tool.ToolCallback> tools)
    • aggregateToolCallbacks

      public static List<org.springframework.ai.tool.ToolCallback> aggregateToolCallbacks(org.springframework.beans.factory.ObjectProvider<List<org.springframework.ai.tool.ToolCallback>> toolCalls, List<org.springframework.ai.tool.ToolCallback> toolCallbacksList, List<org.springframework.ai.tool.ToolCallbackProvider> toolCallbackProvider)
    • toAsyncToolSpecification

      public static io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification toAsyncToolSpecification(org.springframework.ai.tool.ToolCallback toolCallback, org.springframework.util.MimeType mimeType)
    • toSyncToolSpecification

      public static io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification toSyncToolSpecification(org.springframework.ai.tool.ToolCallback toolCallback, org.springframework.util.MimeType mimeType)
    • getMimeType

      public static org.springframework.util.MimeType getMimeType(String toolName)