Apply Tool Filters • AI Agent SDK
apply_tool_filters: Public API to (re)apply allow/deny tool filters to this instance.
apply_tool_filters
Method
</div>
Public API to (re)apply allow/deny tool filters to this instance.
Lets callers (e.g. the loader) express include/exclude intent without reaching into private state. `allowed_tools wins over disabled_tools` when both are supplied.
Signature
def apply_tool_filters(allowed_tools: Optional[List[str]], disabled_tools: Optional[List[str]]) -> 'MCP'Parameters
ParamField
OptionalOnly these tool names are kept (allowlist).
ParamField
OptionalThese tool names are removed (denylist).
Returns
ResponseField
'MCP'self, to allow fluent chaining.
Source
View on GitHubpraisonaiagents/mcp/mcp.py at line 1151