Exceptions
Exceptions of the MCPServer app.
SmarterMCPServerException is the base of every exception that the app raises. The two
kinds that callers handle are:
SmarterMCPServerIndexError, when a repository or the blog cannot be indexed. The indexer records it in the index’serror, rather than failing its Celery task.SmarterMCPServerServiceError, when a service ofsmarter.apps.mcpserver.servicescannot do what it was asked, e.g. read a file that does not exist. Its message is written for the caller, so that they can correct the request.SmarterMCPServerNotFoundErroradds what the caller may have meant.SmarterMCPServerToolError, when a tool cannot do what it was asked. The MCP server returns it to the LLM as the tool’s result, rather than as a JSON-RPC error. The tools ofsmarter.apps.mcpserver.protocol.toolsturn a service error into one.
Note
Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.
- exception smarter.apps.mcpserver.exceptions.SmarterMCPServerException(message='')[source]
Bases:
SmarterExceptionBase class of every exception of the MCPServer app.
Catch it to handle any of the app’s errors. Raise one of its subclasses, which say what failed.
- exception smarter.apps.mcpserver.exceptions.SmarterMCPServerIndexError(message='')[source]
Bases:
SmarterMCPServerExceptionA repository could not be indexed, e.g. GitHub could not be reached, or its archive is too large.
When GitHub or the blog fails, the indexer catches it, records its message in the index’s
errorand sendsmcpserver_repository_index_failed, so that the previous index, if any, is still searched. Only a repository name that is not one of The Smarter Project’s reaches the caller.
- exception smarter.apps.mcpserver.exceptions.SmarterMCPServerNotFoundError(message, suggestions)[source]
Bases:
SmarterMCPServerServiceErrorA file, folder or blog post that was asked for does not exist, with what the caller may have meant.
- Parameters:
- exception smarter.apps.mcpserver.exceptions.SmarterMCPServerServiceError(message='')[source]
Bases:
SmarterMCPServerExceptionA service could not do what it was asked, e.g. a file does not exist, or a repository is not indexed yet.
The services of
smarter.apps.mcpserver.servicesraise it, with a message that tells the caller what was wrong, and what to do instead, e.g. “Did you mean: …?”. They know nothing of MCP:smarter.apps.mcpserver.protocol.tools.public.PublicTool.call()andsmarter.apps.mcpserver.protocol.tools.staff.StaffTool.call()turn it into aSmarterMCPServerToolError, which the LLM reads as the tool’s result.
- exception smarter.apps.mcpserver.exceptions.SmarterMCPServerToolError(message='')[source]
Bases:
SmarterMCPServerExceptionA tool could not do what it was asked, e.g. a file does not exist.
The error is returned to the LLM as the tool’s result, with
isErrorset, so that it can correct its arguments. Because a tool raises it, rather than returning the message, a failed tool call is never cached (seesmarter.apps.mcpserver.protocol.caching).