Function recordToolExecution