# ToolDefinition

Tool definition for inline payload.

Used as argument in: [InlineToolSchema (initializer)](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.InlineToolSchema.html#initializer), [ToolSchema.fromInline](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ToolSchema.html#frominline)

- Source: [`lib/gateway/targets/schema/tool-schema.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/targets/schema/tool-schema.ts#L99)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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" }
    }
};
```

Golang:

```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

- `description`: string (required) — The description of the tool.

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

- `inputSchema`: [SchemaDefinition](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.SchemaDefinition.html) (required) — The input schema for the tool.

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

- `name`: string (required) — The name of the tool.

  This name identifies the tool in the Model Context Protocol.

- `outputSchema`: [SchemaDefinition](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.SchemaDefinition.html) — The output schema for the tool.

  **Default:** No output schema

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