How exactly your character is going to be, I think heavily depends on what kind of story you are telling but good points to remember for any character but especially this kind of characters are these:
1)They must be flawed. (Unless thats what you are going for)
2)They cant be on top of everything all the time. (Unless thats what you are going for)
1) The most common problem in my opinion with those "chessmaster" as you say, characters is that they usually aren't characters at all, at best they are merely plot solving deus ex machinas(which i dont think is ever fine), or crazy empowerment characters with no actual flaw whatsoever (which could be fine if your story is about exploring this kind of character, which I find rather hard to do it right), leading to a character which is neither relatable nor believable most of the time.
2)This has more to do with the actual story and not the character itself but it is equally important, escpecially in stories where solving conflicts/mysteries is an integral part of the appeal of the show, which from your description is what i guess you are going for. You must make sure that there are NEVER asspulls. Nothing breaks immersion more than having your character do something either practically impossible or "figuring out" things nobody could possibly figure out. Outsmarting the opponents must feel natural and not forced. In that train of thought, you should also make sure that your characters are in danger. They have to ACTUALLY! be in danger and not just seem like it. The best way BY FAR to accomplish this is to have your protaginsts lose. People dont neceserilly have to die when things dont go the way of your protagonists but THERE MUST BE consequences to them losing otherwise its meaningless.
I'd say this sums up the most important pitfalls in these kind of characters.
TL;DR: Flaws , danger and vulnerability.
And for some examples of characters like that:
THe very first character that came to mind is this: http://codegeass.wikia.com/wiki/Lelouch_vi_Britannia

The series litteraly starts with the main character playing chess :3
I'd say the series tries and succeeds in making a characters that both feels human with real flaws and ambitions who is also able to out smart his opponents , ussually just in the nick of time. The bad things I'd say is that many times the means he uses often feel like asspulls , but the real issue is that the opponents often feel completely and utterly useless.It can be said that this fact reinforces the theme of the show, that nobility an the aristocratic systam promotes people in power that aren't the right people for the job, but regardless this simply cheapens the encounters and make the main character feel completely over powered and unrealistc.
Lesson to learn: Your adversariers must actually be clever and resourcefull and not simply cannon fodder for your protaginst to beat otherwise it simply cheapens the experience
Other notable characters:
Sherlock Holmes ( For a character who doesnt usually lose and is clearly "over powered " but stil delivers great stories) (Any of the Sherlock holmes stories , series, books, movies)
Protagonist of aldnoah zero:
https://myanimelist.net/anime/22729/AldnoahZero
(For a character similar like sherlock but maybe not done quite as right i.e. omniscient plot device)
Antagonist from Captain America Civil War (Cant eloborate without spoilers)
Francis Underwood from house of cards.

I tried to give several examples of varied characters from different shows to both inspire you and also iterate that there are many many ways to write this type of character. Cheers xD (Couldn't think of anyone thats is also goofy and foolish maybe tobi from naruto but i think thats a bit of a stretch)
Edit: I forgot something important, if you want you can completely ignore both what i said and most other common "rules" for writing characters as long as you know what you are doing and you have a reason to do it. It will certainly though make your job of writing a well structured and interesting story much harder I'd say.