# Function evaluatePolicy

MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

- evaluatePolicy(
  firewall: IPolicyFirewall,
  ctx: FirewallPolicyContext,
  ): Result<void, PolicyError>

  Evaluates a policy context and returns a Result.

  This is a convenience function that wraps the firewall evaluation in a Result type for easier error handling.

  #### Parameters

  - firewall: IPolicyFirewall

    The policy firewall to use

  - ctx: FirewallPolicyContext

    The policy context to evaluate

  #### Returns Result<void, PolicyError>

  Result containing void on success or PolicyError on denial

  - Defined in packages/nexus-agents/src/mcp/middleware/policy.ts:273