Class McpSpringAiSchemaModule

java.lang.Object
org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
org.springframework.ai.mcp.annotation.method.tool.utils.McpSpringAiSchemaModule
All Implemented Interfaces:
com.github.victools.jsonschema.generator.Module

public final class McpSpringAiSchemaModule extends org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
JSON Schema Generator Module for Spring AI MCP.

This module provides a set of customizations to the JSON Schema generator to support the Spring AI MCP framework. It allows extracting descriptions from @McpToolParam(description = ...) annotations and to determine whether a property is required based on the presence of a series of annotations.

Since:
1.0.0
Author:
Thomas Vitale, Christian Tzolov
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule

    org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule.Option
  • Constructor Summary

    Constructors
    Constructor
    Description
    McpSpringAiSchemaModule(org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule.Option... options)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @Nullable String
    resolveToolParamDescription(com.github.victools.jsonschema.generator.MemberScope<?,?> member)
     
    protected @Nullable Boolean
    resolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?,?> member)
     

    Methods inherited from class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule

    applyToConfigBuilder

    Methods inherited from class java.lang.Object

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

    • McpSpringAiSchemaModule

      public McpSpringAiSchemaModule(org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule.Option... options)
  • Method Details

    • resolveToolParamDescription

      protected @Nullable String resolveToolParamDescription(com.github.victools.jsonschema.generator.MemberScope<?,?> member)
      Specified by:
      resolveToolParamDescription in class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
    • resolveToolParamRequired

      protected @Nullable Boolean resolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?,?> member)
      Specified by:
      resolveToolParamRequired in class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule