# InlineToolSchema

Class to define a Tool Schema from an inline string.

The schema can be provided directly as a string in either JSON or YAML format.

Extends: ToolSchema › InlineToolSchema

- 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#L272)
- Type last changed: v2.255.0 · 19 May 2026

## Example

```ts
const 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"],
      },
    }]);
```

## Initializer

```ts
new InlineToolSchema(schema: ToolDefinition[])
```

## 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` — Bind the schema to a construct.

- `fromInline(schema: ToolDefinition[]): InlineToolSchema // chainable` (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.
