← Back

The code below shows how the change_infiltration_by_mult tool is registered in server.py using the @mcp.tool() decorator.

FastMCP
Registering the change_infiltration_by_mult tool in server.py.

This wrapper function calls the corresponding change_infiltration_by_mult method from EnergyPlusManager and includes error handling for common exceptions like FileNotFoundError. Each method in EnergyPlusManager requires a similar wrapper function. When adding new functionality, developers must:

  1. Implement the method in EnergyPlusManager
  2. Create a corresponding decorated async wrapper function in server.py with error handling and logging

An LLM agent could potentially help automate this process by generating the boilerplate wrapper code.