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
ConstructorsConstructorDescriptionMcpSpringAiSchemaModule(org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule.Option... options) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable StringresolveToolParamDescription(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) protected @Nullable BooleanresolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) Methods inherited from class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
applyToConfigBuilder
-
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:
resolveToolParamDescriptionin classorg.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
-
resolveToolParamRequired
protected @Nullable Boolean resolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) - Specified by:
resolveToolParamRequiredin classorg.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
-