decision_get

Retrieves the current status and summary of a decision envelope.

Overview

The decision_get method allows you to check the status of a decision envelope, including whether it's open, requires approval, or has been closed. This is useful for polling approval status or checking decision state.

Request

Parameters

ParameterTypeRequiredDescription
decision_idstringYesThe decision ID to retrieve (from decision_create)

Example Request

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "decision_get",
    "arguments": {
      "decision_id": "TMEM_abc123..."
    }
  }
}

Response

Success Response

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"decision_id\": \"TMEM_abc123...\", \"intent\": \"customer.order.create\", \"status\": \"open\", \"automation_mode\": \"propose\", \"created_at\": \"2026-01-07T12:00:00Z\", \"approval_required\": false}"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
decision_idstringThe decision envelope identifier
intentstringThe intent specified when creating the decision
statusstringCurrent status: "open", "needs_approval", "approved", "committed", "aborted"
automation_modestringThe automation mode: "propose", "approve", "override", or "autonomous"
created_atstringISO 8601 timestamp when the decision was created
approval_requiredbooleanWhether the decision currently requires approval
closed_atstringISO 8601 timestamp when the decision was closed (only present if closed)

Decision Status Values

  • open - Decision is active and operations can be performed
  • needs_approval - Decision requires human approval before proceeding
  • approved - Approval has been granted, decision can proceed
  • committed - Decision has been closed with commit action
  • aborted - Decision has been closed with abort/rollback action

Error Cases

Missing Decision ID

Error Code: -32600 (Invalid Request)

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32600,
    "message": "Invalid Request",
    "data": "decision_id is required"
  }
}

Decision Not Found

Error Code: -32603 (Internal error)

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": "Decision not found"
  }
}

Common causes:

  • Invalid decision ID format
  • Decision belongs to a different tenant
  • Decision has been deleted

Permission Denied

HTTP Status: 403 Forbidden

Occurs when:

  • The decision belongs to a different agent
  • The API key doesn't have permission to access this decision

Authentication Errors

HTTP Status: 401 Unauthorized

Occurs when:

  • API key is missing
  • API key is invalid
  • API key has been revoked

Usage Examples

Check Decision Status

python
import requests
import time

def check_decision_status(decision_id, api_key):
    response = requests.post('https://mcp.tracemem.com',
        headers={'Authorization': f'Agent {api_key}'},
        json={
            "jsonrpc": "2.0",
            "id": 1,
            "method": "tools/call",
            "params": {
                "name": "decision_get",
                "arguments": {
                    "decision_id": decision_id
                }
            }
        })
    
    result = response.json()
    decision_data = json.loads(result["result"]["content"][0]["text"])
    return decision_data

# Poll for approval
decision_id = "TMEM_abc123..."
for _ in range(30):  # Poll up to 30 times
    status = check_decision_status(decision_id, api_key)
    
    if status["status"] == "approved":
        print("Decision approved!")
        break
    elif status["status"] == "aborted":
        print("Decision was rejected")
        break
    
    time.sleep(2)  # Wait 2 seconds between polls

Check if Approval is Required

python
status = check_decision_status(decision_id, api_key)

if status["approval_required"]:
    print("This decision requires approval")
    # Request approval or wait for it
elif status["status"] == "open":
    print("Decision is open and ready for operations")

Best Practices

  1. Poll for approvals: After requesting approval, poll decision_get to check when approval is granted or denied

  2. Check status before operations: Verify the decision is still "open" before performing operations

  3. Handle all status values: Be prepared to handle "committed" and "aborted" statuses appropriately

  4. Use appropriate polling intervals: Don't poll too frequently (2-5 seconds is reasonable)

  5. Set timeout limits: Don't poll indefinitely; set a maximum number of attempts or timeout

Related Methods

TraceMem is trace-native infrastructure for AI agents