# AssetToolSchema

Tool Schema from a local asset.

The asset is uploaded to an S3 staging bucket, then moved to its final location
by CloudFormation during deployment.

Extends: ToolSchema › AssetToolSchema

- Source: [`aws-bedrockagentcore/lib/gateway/targets/schema/tool-schema.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/gateway/targets/schema/tool-schema.ts#L214)
- Type last changed: v2.255.0 · 19 May 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as interfaces_kms } from 'aws-cdk-lib/interfaces';

declare const dockerImage: cdk.DockerImage;
declare const grantable: iam.IGrantable;
declare const keyRef: interfaces_kms.IKeyRef;
declare const localBundling: cdk.ILocalBundling;
const assetToolSchema = new bedrockagentcore.AssetToolSchema('path', /* all optional props */ {
  assetHash: 'assetHash',
  assetHashType: cdk.AssetHashType.SOURCE,
  bundling: {
    image: dockerImage,

    // the properties below are optional
    bundlingFileAccess: cdk.BundlingFileAccess.VOLUME_COPY,
    command: ['command'],
    entrypoint: ['entrypoint'],
    environment: {
      environmentKey: 'environment',
    },
    local: localBundling,
    network: 'network',
    outputType: cdk.BundlingOutput.ARCHIVED,
    platform: 'platform',
    securityOpt: 'securityOpt',
    user: 'user',
    volumes: [{
      containerPath: 'containerPath',
      hostPath: 'hostPath',

      // the properties below are optional
      consistency: cdk.DockerVolumeConsistency.CONSISTENT,
    }],
    volumesFrom: ['volumesFrom'],
    workingDirectory: 'workingDirectory',
  },
  deployTime: false,
  displayName: 'displayName',
  exclude: ['exclude'],
  followSymlinks: cdk.SymlinkFollowMode.NEVER,
  ignoreMode: cdk.IgnoreMode.GLOB,
  readers: [grantable],
  sourceKMSKey: keyRef,
});
```

## Initializer

```ts
new AssetToolSchema(path: string, options?: AssetOptions)
```

## Properties

- `bucketOwnerAccountId`: string — The account ID of the S3 bucket owner for cross-account access.

- `inlineSchema`: [ToolDefinition](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.ToolDefinition.html)[] — The inline tool schema definition as a string, if using an inline schema.

  Can be in JSON or YAML format.

- `s3File`: [Location](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Location.html) — The S3 location of the tool schema file, if using an S3-based schema.

  Contains the bucket name and object key information.

## Methods

- `bind(scope: Construct): void` — Binds this tool schema to a construct scope.

  This method initializes the S3 asset if it hasn't been initialized yet.
  Must be called before rendering the schema as CFN properties.

  **Parameters**

  - `scope` — - The construct scope to bind to.

- `fromInline(schema: ToolDefinition[]): InlineToolSchema` (static) — Creates a Tool Schema from an inline string.

  **Parameters**

  - `schema` — - the JSON or YAML payload defining the OpenAPI schema for the action group.

- `fromLocalAsset(path: string): ToolSchema` (static) — Creates a tool Schema from a local file.

  **Parameters**

  - `path` — - the path to the local file containing the function schema for the tool.

- `fromS3File(bucket: IBucket, objectKey: string, bucketOwnerAccountId?: string): S3ToolSchema` (static) — Creates a Tool Schema from an S3 File.

  **Parameters**

  - `bucket` — - the bucket containing the local file containing the OpenAPI schema for the action group.
  - `objectKey` — - object key in the bucket.
  - `bucketOwnerAccountId` — - optional The account ID of the Amazon S3 bucket owner.

- `grantPermissionsToRole(role: IRole): void` — Grant permissions to the role.
