# Function createPolicyContext

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

- createPolicyContext(
  toolName: string,
  args: unknown,
  options?: {
  mode?: ExecutionMode;
  artifacts?: Map<string, FirewallArtifact<unknown>>;
  workflowId?: string;
  allowedPaths?: readonly string[];
  },
  ): FirewallPolicyContext

  Creates a policy context from tool invocation parameters.

  #### Parameters

  - toolName: string

    Name of the tool being invoked

  - args: unknown

    Tool arguments

  - `Optional` options: {
    mode?: ExecutionMode;
    artifacts?: Map<string, FirewallArtifact<unknown>>;
    workflowId?: string;
    allowedPaths?: readonly string[];
    }

    Additional context options

  #### Returns FirewallPolicyContext

  A PolicyContext object

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