# Function createValidator

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

- createValidator<T>(
  schema: ZodType<T>,
  ): (args: unknown) => Result<T, ValidationError>

  Creates a validation function bound to a specific schema.

  Useful for reusing the same schema across multiple tools.

  #### Type Parameters

  - T

    The expected type after validation

  #### Parameters

  - schema: ZodType<T>

    The Zod schema to bind

  #### Returns (args: unknown) => Result<T, ValidationError>

  A validation function for the schema

  #### Example

      const validateTask = createValidator(TaskSchema);

      // Later in tool handlers:
      const result = validateTask(args);

  - Defined in packages/nexus-agents/src/mcp/middleware/validation.ts:83