fix: fix mcp agent filter logic

PiperOrigin-RevId: 759638254
This commit is contained in:
Xiang (Sean) Zhou 2025-05-16 09:10:10 -07:00 committed by Copybara-Service
parent 05a853bc91
commit f384793649

View File

@ -34,11 +34,22 @@ root_agent = LlmAgent(
], ],
), ),
# don't want agent to do write operation # don't want agent to do write operation
# you can also do below
# tool_filter=lambda tool, ctx=None: tool.name
# not in [
# 'write_file',
# 'edit_file',
# 'create_directory',
# 'move_file',
# ],
tool_filter=[ tool_filter=[
'write_file', 'read_file',
'edit_file', 'read_multiple_files',
'create_directory', 'list_directory',
'move_file', 'directory_tree',
'search_files',
'get_file_info',
'list_allowed_directories',
], ],
) )
], ],