#!/bin/bash
# This script attempts to fetch a Trello card via MCP
# Returns JSON to stdout

CARD_ID="6a1d641621b6ffb7c8481d12"

# Check if we have credentials
if [ -z "$TRELLO_API_KEY" ] || [ -z "$TRELLO_API_TOKEN" ]; then
    echo "TRELLO credentials not set. Attempting to use system credentials..." >&2
    # Try to get from environment or config
    export TRELLO_API_KEY="${TRELLO_API_KEY:-.}"
    export TRELLO_API_TOKEN="${TRELLO_API_TOKEN:-.}"
fi

# For now, we'll need to invoke via the MCP tool
# The proper way is through the Claude Code MCP interface
# Since this is a subagent, we'll output what we need

echo "Fetching card $CARD_ID via MCP tool: mcp__trello__get_card"
echo "Parameters: cardId=$CARD_ID, includeMarkdown=true" >&2

