After a sharp and steady decline of many months, orders for new machine tools from American foundries turned upward slightly in October, according to the monthly report of the National Machine Tool Builders Association in McLean.

New orders placed in October for metal forming and metal cutting equipment were valued at $213.8 million. That is an increase of 13 percent over the September total, but it remains far below the March figure of $344.7 million, the high for this year.

Despite the October gain, total orders for the first 10 months of 1981 are down 37 percent from last year, not surprising in a recessionary economy.

In a statement accompanying the monthly report, James A. Gray, president of the tool builders association, said the industry was "encouraged by the indication of new activity" in October, but added it was too early to say if it represented "the beginning of a sustained trend toward business recovery."

He said the recent decline in interest rates, a backlog of need for replacement machine tools and the investment-incentive provisions of the Reagan administration's tax package gave him reason to hope that "1982 should be a good year for the industry."

The industry could use a good year. Its backlog of orders, the contracts that ensure work will continue, declined in October for the 17th straight month, the association reported, leaving only eight months worth of work firmly on the books.