Class McpJsonSchemaGenerator
java.lang.Object
org.springframework.ai.mcp.annotation.method.tool.utils.McpJsonSchemaGenerator
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateForMethodInput(Method method) static StringgenerateFromClass(Class<?> clazz) Generate a JSON Schema for a class type.static StringgenerateFromType(Type type) Generate a JSON Schema for a generic type.static booleanhasCallToolRequestParameter(Method method) Check if a method has a CallToolRequest parameter.
-
Method Details
-
generateForMethodInput
-
generateFromClass
Generate a JSON Schema for a class type. Delegates toJsonSchemaGenerator.generateForType(java.lang.reflect.Type, org.springframework.ai.util.json.schema.JsonSchemaGenerator.SchemaOption...).- Parameters:
clazz- the class to generate a schema for- Returns:
- the JSON Schema as a string
-
generateFromType
Generate a JSON Schema for a generic type. Delegates toJsonSchemaGenerator.generateForType(java.lang.reflect.Type, org.springframework.ai.util.json.schema.JsonSchemaGenerator.SchemaOption...).- Parameters:
type- the type to generate a schema for- Returns:
- the JSON Schema as a string
-
hasCallToolRequestParameter
Check if a method has a CallToolRequest parameter.- Parameters:
method- The method to check- Returns:
- true if the method has a CallToolRequest parameter, false otherwise
-