Skip to content

[BUG] generate_image tool not working (required key prompt not found) #75

Open
@haritsE

Description

@haritsE

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

0.1.6

Tools Package Version

0.1.4

Tools used

generate_image

Python Version

3.13.4

Operating System

macOS 15.4

Installation Method

pip

Steps to Reproduce

Install strands with pip
Run the following command:

        response = self.agent.tool.generate_image(
            prompt="A futuristic city with flying cars",
            model_id="stability.stable-image-core-v1:1"
        )
        print(response)

Got error:

{'toolUseId': 'tooluse_generate_image_264683723', 'status': 'error', 'content': [{'text': 'Error generating image: An error occurred (ValidationException) when calling the InvokeModel operation: Malformed input request: #: required key [prompt] not found, please reformat your input and try again.'}]}

Expected Behavior

Image to be generator without validation exception, since prompt param is supplied

Actual Behavior

Validation error

Additional Context

Was using the command listed both in the README and in https://github.com/strands-agents/tools/blob/main/src/strands_tools/generate_image.py, but didn't work

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions