Skip to main content

Filter tools by name

import { filterToolsByIdentity } from "@averta-security/sdk-core";

const forwardedTools = filterToolsByIdentity(
  originalTools,
  decision.blockedTools,
  (tool) => tool.name
);
Use this after a restrict_tools decision and before the upstream provider call. The helper preserves original tool ordering and returns a shallow copy when no tools are blocked.