user8485: So I am implementing an intelligent chess agent but I can't get the checkmate working.
I was wondering if there is a program that takes the chessboard notation and returns a result of yes or no to whether it is a checkmate or not.

user9684: Most engines will read a pgn.  To find if it is checkmate you have to play through the game.  From your comments I think you want the program to do that automatically.  None of the engines that I have looked at have this capability.  
My first suggestion is to rewrite your code to remove your bug(s).
The other is to search for the pgn for (#)the mate symbol.
https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html pgn extract claims to have a match criteria for checkmate and stalemate and many others.

user19648: From Chess Programming Wiki, this article (https://www.chessprogramming.org/Checkmate) explains some rules that you can use to implement checkmate detection.
1) double check - only the king can move on this situation. So, if the king has no valid moves, you have a checkmate. 
2) single check - in this situation, the king may move out of check position, or if the attacker piece is a knight or a pawn, you should detect if they may be captured. For the attacking from queen, rook and bishop, they could be captured or some opposite piece should be placed between the attacked king and the attacker.
-
To start the above, you may create a function that lists the pieces that are attacking the king. If the list is empty, no check. If the list has a single pice, a single check. And, finnaly, if the list has two pieces, you have a double check. 

user598: It's actually quite easy to check for a checkmate: 

Can I move out of mate?
Can I block mate?
Can I take the attacker?

The king only has 8 spots to move. You should already have a list of squares under attack from enemy pieces, just check if that square is in that list.
You should have a list of squares that are movable. Check if one of those blocks every attacker.
You can easily tell who is attacking the king by checking each enemy piece's attacked squares for the king's square. If there's only one attacker, and that piece's squares is in one of your piece's attacked squares, you're all set.

user24536: What I did in my program was to only look for checkmates if the king was in check. I only generate pseudo-legal moves in my move generation function so I simply play out all the moves generated and check if the king still is in check. If this is the case I undo that move and delete it from my list of moves. This is repeated until I find a legal move or the list is exhausted. When the list is exhausted I know it must be checkmate.

user3831: I imagine any chess engine must have such function. Find an open source one in your programming language of choice and draw inspiration from there.
I often use the python-chess package for simple chess programming and data mining tasks, as it offers a good API with many useful functions (available here: https://pypi.python.org/pypi/python-chess). For your purposes, it has a function:

is_checkmate()
  Checks if the current position is a checkmate.

The package is open source, so you can see its code, too. 
You could also try implementing the function yourself! 
Stockfish, for example, has a simple, efficient implementation - it produces a list of legal moves, and if the list is empty and the king is in check, then it clearly is a checkmate. See the code: https://github.com/mcostalba/Stockfish/blob/master/src/search.cpp

8485: <p>So I am implementing an intelligent chess agent but I can't get the checkmate working.</p>

<p>I was wondering if there is a program that takes the chessboard notation and returns a result of yes or no to whether it is a checkmate or not.</p>
 9684: <p>Most engines will read a pgn.  To find if it is checkmate you have to play through the game.  From your comments I think you want the program to do that automatically.  None of the engines that I have looked at have this capability.  </p>

<p>My first suggestion is to rewrite your code to remove your bug(s).</p>

<p>The other is to search for the pgn for (#)the mate symbol.</p>

<p><a href="https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html" rel="nofollow">https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html</a> pgn extract claims to have a match criteria for checkmate and stalemate and many others.</p>
 19648: <p>From Chess Programming Wiki, this article (<a href="https://www.chessprogramming.org/Checkmate" rel="nofollow noreferrer">https://www.chessprogramming.org/Checkmate</a>) explains some rules that you can use to implement checkmate detection.</p>

<p>1) double check - only the king can move on this situation. So, if the king has no valid moves, you have a checkmate. </p>

<p>2) single check - in this situation, the king may move out of check position, or if the attacker piece is a knight or a pawn, you should detect if they may be captured. For the attacking from queen, rook and bishop, they could be captured or some opposite piece should be placed between the attacked king and the attacker.</p>

<p>-</p>

<p>To start the above, you may create a function that lists the pieces that are attacking the king. If the list is empty, no check. If the list has a single pice, a single check. And, finnaly, if the list has two pieces, you have a double check. </p>
 598: <p>It's actually quite easy to check for a checkmate: </p>

<ul>
<li>Can I move out of mate?</li>
<li>Can I block mate?</li>
<li>Can I take the attacker?</li>
</ul>

<p>The king only has 8 spots to move. You should already have a list of squares under attack from enemy pieces, just check if that square is in that list.</p>

<p>You should have a list of squares that are movable. Check if one of those blocks every attacker.</p>

<p>You can easily tell who is attacking the king by checking each enemy piece's attacked squares for the king's square. If there's only one attacker, and that piece's squares is in one of your piece's attacked squares, you're all set.</p>
 24536: <p>What I did in my program was to only look for checkmates if the king was in check. I only generate pseudo-legal moves in my move generation function so I simply play out all the moves generated and check if the king still is in check. If this is the case I undo that move and delete it from my list of moves. This is repeated until I find a legal move or the list is exhausted. When the list is exhausted I know it must be checkmate.</p>
 3831: <p>I imagine any chess engine must have such function. Find an open source one in your programming language of choice and draw inspiration from there.</p>

<p>I often use the python-chess package for simple chess programming and data mining tasks, as it offers a good API with many useful functions (available here: <a href="https://pypi.python.org/pypi/python-chess" rel="noreferrer">https://pypi.python.org/pypi/python-chess</a>). For your purposes, it has a function:</p>

<blockquote>
  <p>is_checkmate()
  Checks if the current position is a checkmate.</p>
</blockquote>

<p>The package is open source, so you can see its code, too. </p>

<p>You could also try implementing the function yourself! 
Stockfish, for example, has a simple, efficient implementation - it produces a list of legal moves, and if the list is empty and the king is in check, then it clearly is a checkmate. See the code: <a href="https://github.com/mcostalba/Stockfish/blob/master/src/search.cpp" rel="noreferrer">https://github.com/mcostalba/Stockfish/blob/master/src/search.cpp</a></p>
