log_action
Records agent actions and reasoning steps for audit trails and compliance tracking in quantitative finance workflows.
Instructions
Logs an agent action or reasoning step for audit purposes.
Args:
action_type: Category (e.g., 'REASONING', 'TRADE_DECISION', 'ERROR').
details: Description of the action.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action_type | Yes | ||
| details | Yes |
Implementation Reference
- tools/logger.py:41-52 (handler)The core handler function for the 'log_action' tool. It takes action_type and details as strings, logs the formatted message using the application logger, and returns a success confirmation.def log_action(action_type: str, details: str) -> str: """ Logs an agent action or reasoning step for audit purposes. Args: action_type: Category (e.g., 'REASONING', 'TRADE_DECISION', 'ERROR'). details: Description of the action. """ # Clean up details to remove excessive newlines or emojis if needed clean_details = details.strip() logger.info(f"[{action_type.upper()}] {clean_details}") return "Action logged successfully."
- server.py:400-403 (registration)MCP tool registration of log_action in the FastMCP server using the register_tools helper function, which applies @mcp.tool() decorator.register_tools( [log_action], "Logging" )
- app.py:312-313 (registration)Inclusion of log_action in the tools_map dictionary under 'Utils' category for Gradio UI toolbox interfaces. The app launches with mcp_server=True, making tools available via MCP."Utils": [log_action], }