MCP Tool Filtering in OpenAI Agents
Large MCP servers can expose more tools than one agent should see. Filtering improves security, tool selection, and prompt efficiency.
Static filters
Use an allowlist when an agent has a fixed responsibility. For example, a read-only support agent may receive get_order and search_customer but not refund_order.
Dynamic filters
Dynamic filtering can depend on run context, user role, tenant, or workflow stage. Keep the policy deterministic and auditable.
Filtering is not server authorization
A hidden tool should still reject unauthorized direct calls. Client filtering reduces exposure; server authorization enforces access.
Best practice: expose the smallest useful tool surface to each agent.