Is there an idiom which would convey
I'm afraid I can't do that
Literally translating, It would become
Ich fürchte, ich kann das nicht tun
Would that make sense?
One of the most common ways of saying this in German would be:
Your original sentence is correct, but perhaps not the most idiomatic: it reminds me of HAL 9000 from 2001: A Space Odyssey, although in reality the famous phrase "I'm afraid I can't do that, Dave" was simply rendered, "Das kann ich nicht tun, Dave" - take that as you will.
Those sound more natural to me, you can omit the "tun":
... is perfectly fine and idomatic. In comparison,
as proposed by "Milchgesicht" simply drops the "I'm afraid" phrase.
I'd therefore go with the former, which is closer to the connotation of the English version.