Enhancement
Problem
When using FastMCP errors as control flow to guide LLM behavior, every error triggers logger.exception() on the server side, creating noise in production error monitoring systems (Sentry, DataDog, etc.).
Example workflow where this happens:
@mcp.tool
def check_model_status(model_id: str) -> dict:
if not model_registry.is_deployed(model_id):
# This is expected behavior to guide the LLM, not a bug
# But it logs a full stack trace server-side
raise ToolError(f"Model {model_id} not deployed. Call deploy_model first.")
return model_registry.get_status(model_id)
In multi-step LLM workflows, errors often represent normal operation (prerequisite checks, validation, state machine transitions) rather than bugs. The LLM needs to see these error messages to know what to do next, but server operators don't need stack traces for expected behavior.
Currently, there's no way to send an error to the LLM client without also logging it server-side as an exception.
Enhancement
Problem
When using FastMCP errors as control flow to guide LLM behavior, every error triggers
logger.exception()on the server side, creating noise in production error monitoring systems (Sentry, DataDog, etc.).Example workflow where this happens:
In multi-step LLM workflows, errors often represent normal operation (prerequisite checks, validation, state machine transitions) rather than bugs. The LLM needs to see these error messages to know what to do next, but server operators don't need stack traces for expected behavior.
Currently, there's no way to send an error to the LLM client without also logging it server-side as an exception.