Skip to main content
Glama

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
NameRequiredDescriptionDefault
action_typeYes
detailsYes

Implementation Reference

  • 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], }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/N-lia/MonteWalk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server