Skip to main content
Glama

get_certification_history

Retrieve recent certification decisions for AI agent actions, including risk zones and timestamps, to monitor safety audit trails.

Instructions

Retrieve the recent certification history.

This tool returns a list of recent certifications, most recent first. The history includes decision, zone, timestamp, and other metadata. Up to 50 certifications are stored; older ones are discarded.

Args: limit: Maximum number of certifications to return (default 10, max 50)

Returns: Dictionary with keys: - certifications: List of recent certification summaries - total_count: Total certifications in history - timestamp: Current time (ISO 8601)

Each certification entry contains: - certificate_id: Unique certificate identifier - action_id: Action that was certified - agent_id: Agent that proposed the action - decision: Final decision ("Certified", "CertifiedWithWarning", etc.) - zone: Risk zone ("Safe", "Caution", "Danger") - timestamp: When the certification occurred - description: Optional action description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The get_certification_history tool implementation, which retrieves recent certifications from a deque and returns them as a JSON-compatible dictionary.
    def get_certification_history(limit: int = 10) -> Dict[str, Any]:
        """
        Retrieve the recent certification history.
    
        This tool returns a list of recent certifications, most recent first.
        The history includes decision, zone, timestamp, and other metadata.
        Up to 50 certifications are stored; older ones are discarded.
    
        Args:
            limit: Maximum number of certifications to return (default 10, max 50)
    
        Returns:
            Dictionary with keys:
            - certifications: List of recent certification summaries
            - total_count: Total certifications in history
            - timestamp: Current time (ISO 8601)
    
        Each certification entry contains:
            - certificate_id: Unique certificate identifier
            - action_id: Action that was certified
            - agent_id: Agent that proposed the action
            - decision: Final decision ("Certified", "CertifiedWithWarning", etc.)
            - zone: Risk zone ("Safe", "Caution", "Danger")
            - timestamp: When the certification occurred
            - description: Optional action description
        """
        try:
            limit = min(max(limit, 1), 50)  # Clamp to [1, 50]
    
            # Reverse to get most recent first
            recent = list(reversed(list(_certification_history)))[:limit]
    
            response = {
                "certifications": recent,
                "total_count": len(_certification_history),
                "limit": limit,
                "timestamp": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
            }
    
            logger.info(f"Retrieved {len(recent)} certifications from history")
    
            return response
    
        except Exception as e:
            logger.error(f"Error in get_certification_history: {e}")
            return {
                "error": f"Failed to retrieve history: {str(e)}",
                "timestamp": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"),
            }

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/tb8412/qae-claude-mcp-example'

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