A security guard, Moses Wamalwa, said he detected the knife when frisking the man.
The guard added that Mr Ismael was looking suspicious when entering the court.
A 33-year-old man was on Wednesday arrested at Kibera Law Courts with a knife, a day after a convict stabbed a magistrate and two other people in Nakuru.
Police said Mr Mohamed Ismael alias Daddy Isma had the weapon as he entered the court for the mention of an assault case facing him.
“When I asked him what the knife was for, he said it was an exhibit,” said Mr Wamalwa.
“I found the weapon in his bag and immediately informed the court’s executive officer Rixon Shikuku,” said the guard.
Mr Shikuku said when the guard alerted him, he called the police.
“The man was briefly detained in the cells before being escorted to Kilimani police station. The guard is recording a statement,” said Mr Shikuku.
Police said the knife had been taken for safe custody.
Mr Ismael is expected to appear in court tomorrow and could be charged with planning to commit a crime.
Mr Shikuku said security had been beefed in and around the court.
“We are screening everybody before allowing them in,” he said.