Is intention the result of rational or logical thinking or some other?
Lets take 2 examples where the action are the same:


A surgeon takes a knife and cuts through a person's stomach to save his life
A robber takes a knife and cuts through a person's stomach kill him and take his belongings


In both cases the action is the same but what differs is the intentions. Hence it is the intention that counts.

Now lets take another example.

A baby squirrel falls into the sea and is washed away. The mother squirrel dips her tail into the sea and runs to the shaking off water with the intention of drying water of the whole sea.

The intention is good but irrational. Regardless of rationality the Karmic effects would nevertheless good as the intention is good.