Skip to main content
Glama

sign_action

Create signed audit records for AI agent actions to enable governance, policy enforcement, and compliance reporting through quantum-safe audit trails.

Instructions

Create a signed audit record for an AI agent action.

Args:
    agent_id: The agent performing the action
    action_type: Type of action (e.g. "data:read", "api:call")
    action_id: Unique identifier for this action
    payload: Optional JSON payload describing the action details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYes
action_typeYes
action_idYes
payloadNo

Implementation Reference

  • The `sign_action` function is the handler for the 'sign_action' tool. It prepares a payload, sends a POST request to the Asqav API, and returns the signature result.
    async def sign_action(
        agent_id: str, action_type: str, action_id: str, payload: str | None = None
    ) -> str:
        """Create a signed audit record for an AI agent action.
    
        Args:
            agent_id: The agent performing the action
            action_type: Type of action (e.g. "data:read", "api:call")
            action_id: Unique identifier for this action
            payload: Optional JSON payload describing the action details
        """
        try:
            import json
    
            body: dict[str, Any] = {
                "agent_id": agent_id,
                "action_type": action_type,
                "action_id": action_id,
            }
            if payload:
                try:
                    body["payload"] = json.loads(payload)
                except json.JSONDecodeError:
                    body["payload"] = {"raw": payload}
    
            result = await _request("POST", "/sign", json=body)
            sig_id = result.get("signature_id", "unknown")
            algorithm = result.get("algorithm", "unknown")
            return f"Signed: {sig_id} (algorithm: {algorithm})"
        except Exception as e:
            return f"Error signing action: {e}"
  • The 'sign_action' tool is registered via the @mcp.tool() decorator.
    @mcp.tool()
    async def sign_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/jagmarques/asqav-mcp'

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