#!/usr/bin/env python3
"""
Attempt to fetch card #911 from Trello using Claude's MCP if available,
or require the user to provide it.
"""
import json
import sys
import os

# Check if we're in a Claude Code MCP-enabled environment
# The MCP client would be available via Claude's internal mechanisms

# For this task, we'll try to fetch via the installed Trello integration
# or signal that the card description is needed

card_id = "6a1d6936057a415b4f12e8a0"

# Try to read from any cached/stored data
possible_locations = [
    f"/tmp/card_{card_id}.json",
    f"/opt/automator/cinik-writer-transtor/files/card_{card_id}.json",
    f"/home/dev/.cache/trello_card_{card_id}.json"
]

for loc in possible_locations:
    if os.path.exists(loc):
        try:
            with open(loc) as f:
                data = json.load(f)
                print(json.dumps(data))
                sys.exit(0)
        except:
            pass

print(json.dumps({
    "error": "Card data not available locally",
    "cardId": card_id,
    "requirement": "Need mcp__trello__get_card with cardId=6a1d6936057a415b4f12e8a0"
}))
sys.exit(1)

