interface SchemaDefinition
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.SchemaDefinition |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#SchemaDefinition |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.SchemaDefinition |
Python | aws_cdk.aws_bedrock_agentcore_alpha.SchemaDefinition |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป SchemaDefinition |
Schema definition for tool input/output.
Example
// Create a gateway first
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
const lambdaFunction = new lambda.Function(this, "MyFunction", {
runtime: lambda.Runtime.NODEJS_22_X,
handler: "index.handler",
code: lambda.Code.fromInline(`
exports.handler = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({ message: 'Hello from Lambda!' })
};
};
`),
});
const lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", {
gatewayTargetName: "my-lambda-target",
description: "Lambda function target",
lambdaFunction: lambdaFunction,
toolSchema: agentcore.ToolSchema.fromInline([
{
name: "hello_world",
description: "A simple hello world tool",
inputSchema: {
type: agentcore.SchemaDefinitionType.OBJECT,
properties: {
name: {
type: agentcore.SchemaDefinitionType.STRING,
description: "The name to greet",
},
},
required: ["name"],
},
},
]),
});
Properties
| Name | Type | Description |
|---|---|---|
| type | Schema | The type of the schema definition. |
| description? | string | The description of the schema definition. |
| items? | Schema | The items in the schema definition. |
| properties? | { [string]: Schema } | The properties of the schema definition. |
| required? | string[] | The required fields in the schema definition. |
type
Type:
Schema
The type of the schema definition.
This field specifies the data type of the schema.
description?
Type:
string
(optional, default: No description)
The description of the schema definition.
This description provides information about the purpose and usage of the schema.
items?
Type:
Schema
(optional, default: No items definition)
The items in the schema definition.
This field is used for array types to define the structure of the array elements.
properties?
Type:
{ [string]: Schema }
(optional, default: No properties)
The properties of the schema definition.
These properties define the fields in the schema.
required?
Type:
string[]
(optional, default: No required fields)
The required fields in the schema definition.
These fields must be provided when using the schema.

.NET
Go
Java
Python
TypeScript (