Grokking the Model Context Protocol (MCP)
Vote

0% completed

​

Testing a Server: Unit, Protocol, and Conformance Tests

Consider a version of the Costbook server in which submit_expense is a Python function with one argument, a dictionary named expense. Its unit tests call the function with a correct dictionary, and every test passes.

Then a host connects. The tool list tells the model only that expense is an object. The model therefore guesses the key report where the function reads report_id, and the call returns "Error executing tool submit_expense".

The function was correct, but no host could use the server, because the unit tests never checked what a host receives

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content