Interface SchemaDefinition

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
SchemaDefinition.Jsii$Proxy

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.504Z") @Stability(Stable) public interface SchemaDefinition extends software.amazon.jsii.JsiiSerializable
Schema definition for tool input/output.

Example:

 // Create a gateway first
 Gateway gateway = Gateway.Builder.create(this, "MyGateway")
         .gatewayName("my-gateway")
         .build();
 Function lambdaFunction = Function.Builder.create(this, "MyFunction")
         .runtime(Runtime.NODEJS_22_X)
         .handler("index.handler")
         .code(Code.fromInline("\n    exports.handler = async (event) => {\n      return {\n        statusCode: 200,\n        body: JSON.stringify({ message: 'Hello from Lambda!' })\n      };\n    };\n  "))
         .build();
 GatewayTarget lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", AddLambdaTargetOptions.builder()
         .gatewayTargetName("my-lambda-target")
         .description("Lambda function target")
         .lambdaFunction(lambdaFunction)
         .toolSchema(ToolSchema.fromInline(List.of(ToolDefinition.builder()
                 .name("hello_world")
                 .description("A simple hello world tool")
                 .inputSchema(SchemaDefinition.builder()
                         .type(SchemaDefinitionType.OBJECT)
                         .properties(Map.of(
                                 "name", SchemaDefinition.builder()
                                         .type(SchemaDefinitionType.STRING)
                                         .description("The name to greet")
                                         .build()))
                         .required(List.of("name"))
                         .build())
                 .build())))
         .build());
 
  • Method Details

    • getType

      @Stability(Stable) @NotNull SchemaDefinitionType getType()
      The type of the schema definition.

      This field specifies the data type of the schema.

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      The description of the schema definition.

      This description provides information about the purpose and usage of the schema.

      Default: - No description

    • getItems

      @Stability(Stable) @Nullable default SchemaDefinition getItems()
      The items in the schema definition.

      This field is used for array types to define the structure of the array elements.

      Default: - No items definition

    • getProperties

      @Stability(Stable) @Nullable default Map<String,SchemaDefinition> getProperties()
      The properties of the schema definition.

      These properties define the fields in the schema.

      Default: - No properties

    • getRequired

      @Stability(Stable) @Nullable default List<String> getRequired()
      The required fields in the schema definition.

      These fields must be provided when using the schema.

      Default: - No required fields

    • builder

      @Stability(Stable) static SchemaDefinition.Builder builder()
      Returns:
      a SchemaDefinition.Builder of SchemaDefinition