aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

[AWS::Bedrock::Prompt] - [BUG] - ToolInputSchema converting all values in JSON to string, resulting in errors

Open
#2,303 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::Bedrock::Prompt

### Resource Name

AWS::Bedrock::Prompt

### Issue Description

Hello there team,

This is to report a bug in ```AWS::Bedrock::Prompt``` resource in CloudFormation.

When provisioning this resource, "ToolInputSchema" -> https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrock-prompt-toolinputschema.html

which is to be provided in JSON format has values which are boolean, integer, etc., which when deployed, the resource gets created successfully. However, the prompt when viewed from console, shows the JSON block with these integer and boolean values converted into strings.

This results in errors like below:
```
The model returned the following errors: tools.0.input_schema: JSON schema is invalid - please consult https://json-schema.org or our documentation at https://docs.anthropic.com/en/docs/tool-use
```

Replicatble template uploaded (please change the account id in Variants/ModelId
[ReplicableTemplate.yaml.txt](https://github.com/user-attachments/files/19838847/ReplicableTemplate.yaml.txt)

Please rectify this error so that end users can use CFN to provision the resource without any issues.

Also, do provide the ETA for this fix

### Expected Behavior

Prompt should parse the JSON in such a way that it retains the data type.

### Observed Behavior

the prompt when viewed from console, shows the JSON block with these integer and boolean values converted into strings.

### Test Cases

{"additionalProperties": false} (a boolean)
becomes...
{"additionalProperties": "false"} (a string).

properties like below are being impacted:
- additionalProperties (boolean)
- minItems (number)
- maxItems (number)

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the AWS::Bedrock::Prompt ToolInputSchema documentation and the attached ReplicableTemplate.yaml.txt, checking how boolean and numeric values are represented in the deployed prompt. Confirm the issue is resolved when values such as additionalProperties, minItems, and maxItems retain their JSON types and the prompt passes schema validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.