Get recommendation
Retrieve the status and results of a recommendation. Poll this operation until the recommendation reaches a terminal state (COMPLETED or FAILED).
Code samples
Example
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
|
|
String |
Yes |
The recommendation ID returned by |
Response
| Field | Type | Description |
|---|---|---|
|
|
String |
Unique identifier for the recommendation. |
|
|
String |
ARN of the recommendation. |
|
|
String |
The recommendation name. |
|
|
String |
|
|
|
String |
Current status: |
|
|
Object |
The configuration you submitted. |
|
|
Object |
Present when status is |
|
|
Timestamp |
When the recommendation was created. |
|
|
Timestamp |
When the recommendation was last updated. |
System prompt result fields
Present in recommendationResult.systemPromptRecommendationResult when type is SYSTEM_PROMPT_RECOMMENDATION:
| Field | Type | Description |
|---|---|---|
|
|
String |
The optimized system prompt text. |
|
|
Object |
Present when the input was a configuration bundle. Contains |
|
|
String |
Present on failure. Error code. |
|
|
String |
Present on failure. Human-readable description. |
Tool description result fields
Present in recommendationResult.toolDescriptionRecommendationResult when type is TOOL_DESCRIPTION_RECOMMENDATION:
| Field | Type | Description |
|---|---|---|
|
|
List |
Per-tool results. Each entry contains |
|
|
Object |
Present when the input was a configuration bundle. Contains |
|
|
String |
Present on failure. Error code. |
|
|
String |
Present on failure. Human-readable description. |
Example responses
Completed system prompt recommendation (inline input):
{ "recommendationId": "MyPromptRec-Ab1Cd2Ef3G", "recommendationArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:recommendation/MyPromptRec-Ab1Cd2Ef3G", "name": "my-prompt-rec", "type": "SYSTEM_PROMPT_RECOMMENDATION", "status": "COMPLETED", "recommendationConfig": { ... }, "recommendationResult": { "systemPromptRecommendationResult": { "recommendedSystemPrompt": "<optimized system prompt text>" } }, "createdAt": "2025-03-15T10:00:00Z", "updatedAt": "2025-03-15T10:05:30Z" }
Completed system prompt recommendation (configuration bundle input):
{ "recommendationId": "MyBundleRec-Xy9Zw8Vq1R", "recommendationArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:recommendation/MyBundleRec-Xy9Zw8Vq1R", "name": "my-bundle-prompt-rec", "type": "SYSTEM_PROMPT_RECOMMENDATION", "status": "COMPLETED", "recommendationConfig": { ... }, "recommendationResult": { "systemPromptRecommendationResult": { "recommendedSystemPrompt": "<optimized system prompt text>", "configurationBundle": { "bundleArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:configuration-bundle/myBundle-Ab1Cd2Ef3G", "versionId": "12345678-1234-1234-1234-123456789012" } } }, "createdAt": "2025-03-15T10:00:00Z", "updatedAt": "2025-03-15T10:06:12Z" }
Completed tool description recommendation:
{ "recommendationId": "MyToolRec-Qr5St6Uv7W", "recommendationArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:recommendation/MyToolRec-Qr5St6Uv7W", "name": "my-tool-rec", "type": "TOOL_DESCRIPTION_RECOMMENDATION", "status": "COMPLETED", "recommendationConfig": { ... }, "recommendationResult": { "toolDescriptionRecommendationResult": { "tools": [ { "toolName": "<tool-name-1>", "recommendedToolDescription": "<optimized description for tool 1>" }, { "toolName": "<tool-name-2>", "recommendedToolDescription": "<optimized description for tool 2>" } ] } }, "createdAt": "2025-03-15T11:00:00Z", "updatedAt": "2025-03-15T11:04:45Z" }
Failed recommendation:
{ "recommendationId": "MyFailedRec-Mn3Op4Qr5S", "recommendationArn": "arn:aws:bedrock-agentcore:us-west-2:123456789012:recommendation/MyFailedRec-Mn3Op4Qr5S", "name": "my-failed-rec", "type": "SYSTEM_PROMPT_RECOMMENDATION", "status": "FAILED", "recommendationConfig": { ... }, "recommendationResult": { "systemPromptRecommendationResult": { "errorCode": "<error-code>", "errorMessage": "<human-readable error description>" } }, "createdAt": "2025-03-15T12:00:00Z", "updatedAt": "2025-03-15T12:01:10Z" }
Errors
| Error | HTTP status | Description |
|---|---|---|
|
|
404 |
No recommendation found with the specified ID. |
|
|
400 |
Invalid recommendation ID format. |
|
|
403 |
Insufficient permissions. |
|
|
429 |
Request rate exceeded. |
|
|
500 |
Service-side error. |