Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Returning tool results

Focus mode
Returning tool results - Amazon Nova

Once the tool has been invoked by the application, the final step is to provide the tool result to the model. This is done by returning a tool result with the ID of the tool call and the response content. This content follows the ToolResultBlock schema:

{ "toolResult": { "toolUseId": tool['toolUseId'], "content": [{"json": {"song": song, "artist": artist}}], "status": "success" } }

The contents of the ToolResultBlock should be either a single JSON or a mix of text and images.

The status field can be used to indicate to the model the status of the tool execution. If the tool execution failed you can indicate the failure, and Amazon Nova will attempt the modify it's original tool call.

Refer to the ToolResultContentBlock documentation for more details on the schema.

Here is an example of how to use the Converse API to return the tool results:

messages.append({ "role": "user", "content": [ { "toolResult": { "toolUseId": tool['toolUseId'], "content": [{"json": {"song": song, "artist": artist}}], "status": "success" } } ] }) inf_params = {"maxTokens": 1000, "topP": 1, "temperature": 1} # Send the tool result to the model. response = client.converse( modelId="us.amazon.nova-lite-v1:0", messages=messages, toolConfig=tool_config, inferenceConfig=inf_params, additionalModelRequestFields= {"inferenceConfig": {"topK":1}} ) print(response['output']['message'])

For more details on how to leverage tools refer to Amazon Bedrock Tool Use documentation or visit the tool use samples in the Amazon Nova samples repository.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.