Skip to content

Conversation

@ytianaws
Copy link

Description

The retrieveFilter parameter was implemented in the retrieve tool's code but was missing from the TOOL_SPEC inputSchema. This prevented agents from discovering and using the filter functionality, even though the backend code fully supported it.

This PR adds retrieveFilter to the tool's inputSchema with comprehensive documentation of all supported operators based on AWS Bedrock's RetrievalFilter API.

Related Issues

N/A

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • [ ] I ran hatch run prepare
  • All existing tests pass (21/21 retrieve tests passed)
  • Filter validation logic was already present and tested

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ytianaws ytianaws requested a review from a team as a code owner October 27, 2025 04:51
mehtarac
mehtarac previously approved these changes Nov 4, 2025
@mehtarac
Copy link
Member

mehtarac commented Nov 4, 2025

Were you able to test this to ensure that the tool works after this change?

@ytianaws
Copy link
Author

ytianaws commented Nov 6, 2025

Were you able to test this to ensure that the tool works after this change?

HI @mehtarac Yes, I tested this. All 21 retrieve tests pass:

hatch test tests/test_retrieve.py
# 21 passed, 2 errors (unrelated AWS credential issues)

Filter-specific tests that passed:

  • test_retrieve_with_valid_filter - validates filter structures work correctly
  • test_retrieve_with_invalid_filter - ensures invalid filters are rejected

The retrieveFilter functionality was already fully implemented in the backend code with tests. This PR simply adds the missing schema definition so agents can discover it. The change is purely additive and doesn't modify any existing logic.

@gracelang15
Copy link

Hi @mehtarac - I am working on something that would benefit from this change, any chance you can continue this review whenever you have time? Or any additional next steps needed? Happy to help move this along (fyi @ytianaws)

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.

3 participants