close
Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.78 KB

File metadata and controls

61 lines (51 loc) · 1.78 KB
name discover-domain
description Queries a target domain's .well-known endpoint to discover remote agent capabilities.

Domain Discovery Skill

This skill allows the agent to reach out across organizational boundaries and discover what tools, MCP servers, and endpoints another team has exposed.

Usage

/skill:discover-domain api.networking.internal

Execution Script

#!/bin/bash
DOMAIN=$1

if [ -z "$DOMAIN" ]; then
  echo "❌ Error: Please provide a domain to discover (e.g., api.team-b.internal)"
  exit 1
fi

ENDPOINT="https://$DOMAIN/.well-known/agent-capabilities.json"

echo "📡 Initiating cross-org discovery for: $DOMAIN"
echo "Fetching $ENDPOINT..."

# In a real scenario, this would use curl. For the demo, we simulate a response
# if the user passes 'demo.internal', otherwise we attempt a real curl.

if [ "$DOMAIN" == "demo.internal" ]; then
  cat << 'EOF' > .discovery-result.json
{
  "org_id": "demo-networking-core",
  "mcp_servers": {
    "terraform": {
      "endpoint": "https://mcp.demo.internal/v1/terraform",
      "auth_required": ["oauth2"],
      "scopes": ["tf:plan"]
    }
  },
  "supported_protocols": ["mcp-v1.2"],
  "contact": "platform-engineering@demo.internal"
}
EOF
  echo "✅ Discovery successful (Simulated)."
else
  curl -sSf -m 5 "$ENDPOINT" > .discovery-result.json
  if [ $? -ne 0 ]; then
    echo "❌ Failed to reach $ENDPOINT. The domain may not exist or does not expose capabilities."
    exit 1
  fi
  echo "✅ Discovery successful."
fi

echo ""
echo "--- DISCOVERED CAPABILITIES ---"
cat .discovery-result.json
echo "-------------------------------"
echo "🧠 AGENT ACTION: Read the capabilities above. If the user asked to perform an action on this domain, inform them of the required MCP endpoints and authentication scopes needed."