Skip to content
v2.278.0

ToolDefinition Struct ​

Tool definition for inline payload.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';

declare const schemaDefinition_: bedrock_agentcore_alpha.SchemaDefinition;
const toolDefinition: bedrock_agentcore_alpha.ToolDefinition = {
  description: 'description',
  inputSchema: {
    type: bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

    // the properties below are optional
    description: 'description',
    items: schemaDefinition_,
    properties: {
      propertiesKey: schemaDefinition_,
    },
    required: ['required'],
  },
  name: 'name',

  // the properties below are optional
  outputSchema: {
    type: bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

    // the properties below are optional
    description: 'description',
    items: schemaDefinition_,
    properties: {
      propertiesKey: schemaDefinition_,
    },
    required: ['required'],
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

# schema_definition_: bedrock_agentcore_alpha.SchemaDefinition

tool_definition = bedrock_agentcore_alpha.ToolDefinition(
    description="description",
    input_schema=bedrock_agentcore_alpha.SchemaDefinition(
        type=bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

        # the properties below are optional
        description="description",
        items=schema_definition_,
        properties={
            "properties_key": schema_definition_
        },
        required=["required"]
    ),
    name="name",

    # the properties below are optional
    output_schema=bedrock_agentcore_alpha.SchemaDefinition(
        type=bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

        # the properties below are optional
        description="description",
        items=schema_definition_,
        properties={
            "properties_key": schema_definition_
        },
        required=["required"]
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

SchemaDefinition schemaDefinition_;

ToolDefinition toolDefinition = ToolDefinition.builder()
        .description("description")
        .inputSchema(SchemaDefinition.builder()
                .type(SchemaDefinitionType.STRING)

                // the properties below are optional
                .description("description")
                .items(schemaDefinition_)
                .properties(Map.of(
                        "propertiesKey", schemaDefinition_))
                .required(List.of("required"))
                .build())
        .name("name")

        // the properties below are optional
        .outputSchema(SchemaDefinition.builder()
                .type(SchemaDefinitionType.STRING)

                // the properties below are optional
                .description("description")
                .items(schemaDefinition_)
                .properties(Map.of(
                        "propertiesKey", schemaDefinition_))
                .required(List.of("required"))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

SchemaDefinition schemaDefinition_;

var toolDefinition = new ToolDefinition {
    Description = "description",
    InputSchema = new SchemaDefinition {
        Type = SchemaDefinitionType.STRING,

        // the properties below are optional
        Description = "description",
        Items = schemaDefinition_,
        Properties = new Dictionary<string, SchemaDefinition> {
            { "propertiesKey", schemaDefinition_ }
        },
        Required = new [] { "required" }
    },
    Name = "name",

    // the properties below are optional
    OutputSchema = new SchemaDefinition {
        Type = SchemaDefinitionType.STRING,

        // the properties below are optional
        Description = "description",
        Items = schemaDefinition_,
        Properties = new Dictionary<string, SchemaDefinition> {
            { "propertiesKey", schemaDefinition_ }
        },
        Required = new [] { "required" }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

var schemaDefinition_ SchemaDefinition

toolDefinition := &ToolDefinition{
	Description: jsii.String("description"),
	InputSchema: &SchemaDefinition{
		Type: bedrock_agentcore_alpha.SchemaDefinitionType_STRING,

		// the properties below are optional
		Description: jsii.String("description"),
		Items: schemaDefinition_,
		Properties: map[string]SchemaDefinition{
			"propertiesKey": schemaDefinition_,
		},
		Required: []*string{
			jsii.String("required"),
		},
	},
	Name: jsii.String("name"),

	// the properties below are optional
	OutputSchema: &SchemaDefinition{
		Type: bedrock_agentcore_alpha.SchemaDefinitionType_STRING,

		// the properties below are optional
		Description: jsii.String("description"),
		Items: schemaDefinition_,
		Properties: map[string]SchemaDefinition{
			"propertiesKey": schemaDefinition_,
		},
		Required: []*string{
			jsii.String("required"),
		},
	},
}

Properties ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string required #
The description of the tool.

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

inputSchemaSchemaDefinitioninput_schemaSchemaDefinitioninputSchemaSchemaDefinitionInputSchemaSchemaDefinitionInputSchemaSchemaDefinition required #
The input schema for the tool.

This schema defines the structure of the input that the tool accepts.

namestringnamestrnameStringNamestringName*string required #
The name of the tool.

This name identifies the tool in the Model Context Protocol.

outputSchemaoptionalSchemaDefinitionoutput_schemaoptionalSchemaDefinitionoutputSchemaoptionalSchemaDefinitionOutputSchemaoptionalSchemaDefinitionOutputSchemaoptionalSchemaDefinition #
The output schema for the tool.

Default: No output schema

This schema defines the structure of the output that the tool produces.