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
| Parameter | Type | Required | Description |
|---|---|---|---|
decision_id | string | Yes | The decision ID to retrieve (from decision_create) |
Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "decision_get",
"arguments": {
"decision_id": "TMEM_abc123..."
}
}
}
Response
Success Response
{
"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
| Field | Type | Description |
|---|---|---|
decision_id | string | The decision envelope identifier |
intent | string | The intent specified when creating the decision |
status | string | Current status: "open", "needs_approval", "approved", "committed", "aborted" |
automation_mode | string | The automation mode: "propose", "approve", "override", or "autonomous" |
created_at | string | ISO 8601 timestamp when the decision was created |
approval_required | boolean | Whether the decision currently requires approval |
closed_at | string | ISO 8601 timestamp when the decision was closed (only present if closed) |
Decision Status Values
open- Decision is active and operations can be performedneeds_approval- Decision requires human approval before proceedingapproved- Approval has been granted, decision can proceedcommitted- Decision has been closed with commit actionaborted- Decision has been closed with abort/rollback action
Error Cases
Missing Decision ID
Error Code: -32600 (Invalid Request)
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "Invalid Request",
"data": "decision_id is required"
}
}
Decision Not Found
Error Code: -32603 (Internal error)
{
"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
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
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
-
Poll for approvals: After requesting approval, poll
decision_getto check when approval is granted or denied -
Check status before operations: Verify the decision is still
"open"before performing operations -
Handle all status values: Be prepared to handle
"committed"and"aborted"statuses appropriately -
Use appropriate polling intervals: Don't poll too frequently (2-5 seconds is reasonable)
-
Set timeout limits: Don't poll indefinitely; set a maximum number of attempts or timeout
Related Methods
decision_create- Create a new decisiondecision_close- Close the decisiondecision_request_approval- Request approval (may change status toneeds_approval)