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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'log_action' tool. It takes action_type and details, logs them formatted to the logger, and returns a success message. The function signature and docstring provide the input schema.
    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)
    Registers the log_action function as an MCP tool by calling register_tools, which dynamically applies the @mcp.tool() decorator from FastMCP.
    register_tools(
        [log_action],
        "Logging"
    )
  • Helper function used to register MCP tools, including log_action, by applying the FastMCP decorator and logging the process.
    def register_tools(tools: List[Callable], category: str):
        """Helper to register multiple tools with logging."""
        for tool in tools:
            try:
                mcp.tool()(tool)
                logger.info(f"Registered {category} tool: {tool.__name__}")
            except Exception as e:
                logger.error(f"Failed to register {tool.__name__}: {e}")
                raise
  • app.py:312-313 (registration)
    Includes log_action in the tools_map dictionary used to generate Gradio interfaces for the tool, which are exposed via MCP when mcp_server=True.
        "Utils": [log_action],
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool logs for audit purposes, which implies a write operation, but doesn't disclose behavioral traits like whether it's idempotent, what permissions are needed, how logs are stored, or rate limits. For a write tool with zero annotation coverage, this is a significant gap, though it at least hints at the audit context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by a brief, structured parameter explanation. Every sentence adds value without waste, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no nested objects) and the presence of an output schema (which means return values don't need explanation), the description is mostly complete. It covers purpose and parameters, but lacks behavioral details like error handling or audit specifics, which holds it back from a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining both parameters: 'action_type' as a category with examples (e.g., 'REASONING', 'TRADE_DECISION', 'ERROR') and 'details' as a description of the action. This clarifies semantics beyond the bare schema, though it could provide more detail on format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Logs an agent action or reasoning step for audit purposes.' It specifies the verb ('Logs') and resource ('agent action or reasoning step'), and distinguishes it from siblings by focusing on audit logging rather than financial operations. However, it doesn't explicitly differentiate from potential logging siblings (none exist in the list), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for audit logging of agent actions, but provides no explicit guidance on when to use this tool versus alternatives. There are no similar logging tools among siblings, so no comparison is needed, but it lacks context on prerequisites or exclusions (e.g., when not to log). This results in an implied usage score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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