Skip to content

feat(bedrock): Add AWS Bedrock system tools support.#4469

Open
sktech730 wants to merge 1 commit intocrewAIInc:mainfrom
sktech730:feature/bedrock-system-tools
Open

feat(bedrock): Add AWS Bedrock system tools support.#4469
sktech730 wants to merge 1 commit intocrewAIInc:mainfrom
sktech730:feature/bedrock-system-tools

Conversation

@sktech730
Copy link

@sktech730 sktech730 commented Feb 12, 2026

Summary

Adds support for AWS Bedrock system tools (like Nova Web Grounding) to the CrewAI SDK with full agent integration.

Key Features

  • ✅ System tools configuration support
  • ✅ Full AWS response preservation
  • ✅ Agent integration (sync and async)
  • ✅ Backward compatible

Motivation

AWS Bedrock recently introduced system tools, including Nova Web Grounding, which allows models to search the web for current information. This feature is essential for:

  • Finding current information (pricing, news, updates)
  • Accessing real-time data
  • Grounding responses in factual sources
  • Reducing hallucinations

However, the existing CrewAI SDK doesn't support system tools, preventing users from leveraging this powerful capability.

Related Issue :

Addresses the need for AWS Bedrock system tools support. Alternative to PR #4365 which has breaking changes.
Issue #4363.

Files Modified

  1. lib/crewai/src/crewai/llms/providers/bedrock/completion.py (~200 lines)

    • Added system_tools parameter
    • Implemented system tool detection
    • Conditional response type
  2. lib/crewai/src/crewai/llms/providers/bedrock/system_tools.py (new file)

    • Helper functions for system tools
  3. lib/crewai/src/crewai/agents/crew_agent_executor.py (10 lines)

    • Dict response handling (sync + async)
  4. lib/crewai/src/crewai/experimental/crew_agent_executor_flow.py (5 lines)

    • Dict response handling
  5. lib/crewai/src/crewai/lite_agent.py (5 lines)

    • Dict response handling

Total: ~220 lines added, 0 lines removed, 0 breaking changes


Note

Medium Risk
Changes the Bedrock provider’s tool/request/response behavior and introduces an alternate return type (str vs dict), which can affect downstream parsing and integrations if not consistently handled (notably across sync/async code paths).

Overview
Enables AWS Bedrock system tools to be configured and sent via Converse by extending Bedrock tool typing/serialization to accept systemTool entries and merging them with regular tools at request time.

Updates Bedrock response handling to detect system-tool content (e.g., server_tool_use, citationsContent, toolResult) and, when configured, return the full raw Bedrock response augmented with a convenience processed_text field; agent executors (CrewAgentExecutor, flow executor, and LiteAgent) are updated to accept this dict shape by extracting processed_text before parsing.

Adds a system_tools.py helper for Nova Web Grounding configuration and introduces unit tests around system-tool/citation-style responses.

Written by Cursor Bugbot for commit 6358c9f. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if "text" in content_block:
text_content += content_block["text"]

# Handle tool use - corrected structure according to AWS API docs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async acall omits system tools from request body

High Severity

The sync call() method was updated to merge self.system_tools into all_tools alongside the tools parameter before building the tool config, but the async acall() method was not updated — it still only checks if tools: and never includes self.system_tools. This means system tools configured via the constructor are silently omitted from async Bedrock API requests, completely breaking async system tools support. The response handling in _ahandle_converse expects system tool content but the tools are never sent.

Additional Locations (1)

Fix in Cursor Fix in Web

)
else:
logging.warning("Extracted empty text content from Bedrock response")
text_content = "I apologize, but I couldn't generate a proper response. Please try again."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty text fallback overwrites system tool response content

Low Severity

The empty-text fallback at lines 652–666 runs before the system tools dict-return check at line 678 and doesn't consult has_system_tool_content. When a system tool response contains results in citationsContent/toolResult blocks but no text block, text_content is empty, so the fallback replaces it with the ReAct guidance (or generic error) message. That misleading string then becomes processed_text in the returned dict, causing the agent to see a canned fallback instead of the system tool's actual content. The same issue applies in the async _ahandle_converse.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant