AWS Certified Generative AI Developer – Professional
Converse API tool use and chat history on Bedrock (AIP-C01)
With the Converse API the model never runs a tool. It returns stopReason tool_use with a toolUse block, your code runs the tool, and you send the output back in a toolResult block with the same toolUseId. Converse keeps no session, so every request must carry the full message history.
The tool loop
You describe each tool in toolConfig with a toolSpec: a name, a description and an inputSchema. When the model wants a tool, the response has stopReason tool_use and the assistant message contains a toolUse block with a toolUseId, the tool name and the input.
Your application calls the tool, whether it is an API, a database or a Lambda function. It appends the assistant message and then a user message containing a toolResult block with the matching toolUseId, and calls Converse again. The model then writes its answer using the result.
AWS calls this client-side tool use, and it is the mode for the Converse and InvokeModel APIs. In server-side mode Amazon Bedrock runs the tool itself through a Lambda function or AgentCore Gateway, but that mode is currently available on the Responses API, not Converse.
Reporting a failed tool call
If the tool fails, still send a toolResult for that toolUseId. Put a text description of the error in the content and set status to error. The status field is supported only by Amazon Nova and Anthropic Claude 3 and 4 models. The AWS example code does this when a station lookup raises an error.
This keeps each toolUse and its outcome next to each other in the history, and the model can tell the user or ask for different input.
toolChoice
toolChoice controls whether the model must request a tool. auto is the default and is supported by every model that supports tool use. any (at least one tool) and tool (one named tool) are supported by some models only. An unsupported setting fails with a ValidationException instead of falling back to auto.
Conversation history
Amazon Bedrock doesn't store the text, images or documents you send as content. To keep context, include all earlier messages in each later Converse request, with the role field set to user or assistant.
Example: a chatbot runs in a Lambda function and answers 'Can I move it to Friday?' without knowing which booking the user meant. Storing each session's messages in a DynamoDB item keyed by session ID and resending them on every turn fixes it.
Where the exam catches people
Believing Bedrock calls your Lambda tool when the response says tool_use: in client-side tool use your application must run the tool and return a toolResult.
Believing setting toolChoice makes the tool run: it only forces the model to request the tool. Running it is still your code's job.
Believing a failed tool call should be left out of the history: send a toolResult with the toolUseId, an error description and status error.
Believing Converse remembers earlier turns: Bedrock stores no content, so the application must resend the messages each time.
Believing a prompt cache checkpoint keeps a conversation: caching reduces cost for repeated prefixes, but the messages must still be sent in each request.