{
  "protocol": "a2a/1.0",
  "name": "AgencyAIPilot",
  "description": "Specialized A2A agent for digital agencies - content, reporting, publishing, and swarm execution.",
  "url": "https://smmmcdniucoeyogrintl.supabase.co/functions/v1/a2a-rpc",
  "provider": {
    "organization": "AgencyAIPilot",
    "url": "https://agencyaipilot.com"
  },
  "version": "1.1.0",
  "features": {
    "structuredOutputs": true,
    "taskChaining": true,
    "webhooks": true,
    "parallelExecution": true,
    "batchExecution": true,
    "sessions": true,
    "envelope": {
      "description": "Every skill result is wrapped in a consistent envelope with status, data, confidence (0-1), estimated_cost (USD), suggested_next_steps (skill hints for chaining), and tags.",
      "fields": ["status", "data", "confidence", "estimated_cost", "suggested_next_steps", "tags", "task_id", "parent_task_id", "session_id"]
    },
    "chaining": {
      "description": "Pass params.parent_task_id on tasks/send to chain a new task to a prior task's result. The parent's `data` is injected into the child input as `parent_result` when the child does not provide the equivalent field.",
      "usage": "{ method: 'tasks/send', params: { skill: 'generate_social_posts', parent_task_id: '<blog-task-id>', input: {} } }"
    },
    "parallel": {
      "description": "Run multiple skills concurrently in a single request by passing a `tasks` array to tasks/send. Results are returned in the same order with a batch envelope.",
      "usage": "{ method: 'tasks/send', params: { session_id?: '...', parallel: true, tasks: [ { skill: 'generate_blog_post', input: { topic: 'AI agencies' } }, { skill: 'analyze_competitors', input: { industry: 'marketing' } } ] } }"
    },
    "batch": {
      "description": "Alternatively call the `batch_execute` skill with { tasks: [...], parallel?: true } for a self-describing single-skill call. Limit: 20 tasks per request.",
      "usage": "{ method: 'tasks/send', params: { skill: 'batch_execute', input: { parallel: true, tasks: [ ... ] } } }"
    },
    "sessions": {
      "description": "Create a session with sessions/create, then pass session_id on every tasks/send. Session memory (JSON) is injected into each skill input as `session_memory`, and callers can patch memory in-flight via `memory_patch`.",
      "methods": ["sessions/create", "sessions/get"],
      "usage": "{ method: 'tasks/send', params: { session_id: '...', memory_patch: { brand: 'Acme' }, skill: 'generate_blog_post', input: { topic: 'X' } } }"
    }
  },
  "documentationUrl": "https://agencyaipilot.com/developers",
  "endpoints": {
    "rpc": "https://smmmcdniucoeyogrintl.supabase.co/functions/v1/a2a-rpc",
    "agentCard": "https://agencyaipilot.com/.well-known/agent-card.json"
  },
  "authentication": {
    "schemes": ["bearer"],
    "instructions": "Create an API key at https://agencyaipilot.com/developers and pass it as `Authorization: Bearer aap_...` on every request."
  },
  "capabilities": {
    "streaming": false,
    "pushNotifications": false,
    "stateTransitionHistory": true
  },
  "defaultInputModes": ["application/json"],
  "defaultOutputModes": ["application/json"],
  "skills": [
    {
      "id": "generate_blog_post",
      "name": "Generate SEO Blog Post",
      "description": "Produce a publish-ready, SEO-optimized long-form blog post for a given topic. Returns a structured object with title, markdown body, meta description, suggested tags, and target keywords. Ideal for content pipelines and WordPress publishing.",
      "tags": ["content", "seo", "blog", "long-form"],
      "input": {
        "type": "object",
        "required": ["topic"],
        "properties": {
          "topic": { "type": "string", "description": "Blog topic or working title." },
          "keywords": { "type": "array", "items": { "type": "string" }, "description": "Target SEO keywords." },
          "tone": { "type": "string", "enum": ["professional", "casual", "authoritative"], "default": "professional" }
        }
      },
      "examples": [
        "Generate an authoritative SEO blog post about how agencies use AI to scale content in 2026, targeting the keywords ai marketing and agency growth."
      ]
    },
    {
      "id": "generate_social_posts",
      "name": "Generate Social Posts",
      "description": "Generate a batch of platform-tailored social posts (Twitter/X and LinkedIn) around a topic, respecting each platform's tone and length conventions. Returns an array of posts with platform, body, and suggested hashtags.",
      "tags": ["content", "social", "twitter", "linkedin"],
      "input": {
        "type": "object",
        "required": ["topic"],
        "properties": {
          "topic": { "type": "string" },
          "platforms": { "type": "array", "items": { "type": "string", "enum": ["twitter", "linkedin"] }, "default": ["twitter", "linkedin"] },
          "count": { "type": "integer", "minimum": 1, "maximum": 10, "default": 3 }
        }
      },
      "examples": [
        "Create three social posts for Twitter/X and LinkedIn about launching an AI-first agency."
      ]
    },
    {
      "id": "fetch_ga4_metrics",
      "name": "Fetch GA4 Metrics",
      "description": "Retrieve Google Analytics 4 metrics (sessions, users, engagement, top pages, traffic sources) for the caller's configured GA4 property over a given window. Falls back to an empty structured payload when GA4 is not yet connected.",
      "tags": ["analytics", "ga4", "reporting"],
      "input": {
        "type": "object",
        "properties": {
          "days": { "type": "integer", "enum": [7, 28, 90], "default": 7, "description": "Look-back window in days." }
        }
      },
      "examples": ["Fetch GA4 metrics for the last 7 days."]
    },
    {
      "id": "generate_weekly_report",
      "name": "Generate Weekly Report",
      "description": "Run the full weekly agency automation: pull GA4 metrics, generate blog + social content, and compile a client-ready executive report. Returns run status, artifact links, and per-step results.",
      "tags": ["reports", "analytics", "automation", "weekly"],
      "input": { "type": "object", "properties": {} },
      "examples": ["Generate this week's agency performance report with analytics, content, and social recommendations."]
    },
    {
      "id": "list_tasks",
      "name": "List Tasks",
      "description": "List recent A2A task executions for the authenticated API key. Useful for observability, debugging, and swarm orchestration.",
      "tags": ["meta", "observability"],
      "input": {
        "type": "object",
        "properties": {
          "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }
        }
      },
      "examples": ["List the 10 most recent A2A task executions for this API key."]
    },
    {
      "id": "analyze_competitors",
      "name": "Analyze Competitors",
      "description": "Given a website or a set of keywords, produce a competitive landscape analysis: top competitors, positioning, content gaps, and strategic recommendations. Returns structured JSON suitable for downstream planning agents.",
      "tags": ["research", "competitive-intelligence", "seo"],
      "input": {
        "type": "object",
        "properties": {
          "website": { "type": "string", "description": "Target website URL to benchmark." },
          "keywords": { "type": "array", "items": { "type": "string" }, "description": "Focus keywords or niche descriptors." },
          "industry": { "type": "string" }
        }
      },
      "output": {
        "type": "object",
        "properties": {
          "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": {"type":"string"}, "url": {"type":"string"}, "strengths": {"type":"array"}, "weaknesses": {"type":"array"} } } },
          "content_gaps": { "type": "array", "items": { "type": "string" } },
          "recommendations": { "type": "array", "items": { "type": "string" } }
        }
      },
      "examples": ["Analyze competitors for https://example.com in the marketing agencies industry."]
    },
    {
      "id": "create_content_calendar",
      "name": "Create Content Calendar",
      "description": "Generate a structured content calendar for a niche over a given time window. Returns a per-day plan with content type, platform, working title, key message, and hashtags — ready to be handed to publishing agents.",
      "tags": ["content", "planning", "calendar"],
      "input": {
        "type": "object",
        "required": ["niche"],
        "properties": {
          "niche": { "type": "string" },
          "period": { "type": "string", "enum": ["week", "month", "quarter"], "default": "month" },
          "platforms": { "type": "array", "items": { "type": "string" }, "default": ["twitter", "linkedin", "blog"] }
        }
      },
      "output": {
        "type": "object",
        "properties": {
          "period": { "type": "string" },
          "entries": { "type": "array", "items": { "type": "object", "properties": { "date": {"type":"string"}, "platform": {"type":"string"}, "content_type": {"type":"string"}, "title": {"type":"string"}, "message": {"type":"string"}, "hashtags": {"type":"array"} } } }
        }
      },
      "examples": ["Create a monthly content calendar for AI marketing agencies across Twitter/X, LinkedIn, and blog content."]
    },
    {
      "id": "generate_client_report_summary",
      "name": "Generate Client Report Summary",
      "description": "Convert raw performance data (analytics, campaign metrics, deliverables) into a clean executive summary suitable for client-facing reports. Highlights wins, risks, and next actions.",
      "tags": ["reporting", "executive-summary"],
      "input": {
        "type": "object",
        "properties": {
          "client_name": { "type": "string" },
          "period": { "type": "string" },
          "data": { "type": "object", "description": "Arbitrary metrics/deliverables payload." }
        }
      },
      "output": {
        "type": "object",
        "properties": {
          "headline": { "type": "string" },
          "wins": { "type": "array", "items": { "type": "string" } },
          "risks": { "type": "array", "items": { "type": "string" } },
          "next_actions": { "type": "array", "items": { "type": "string" } },
          "narrative": { "type": "string" }
        }
      },
      "examples": ["Generate an executive client report summary for Acme Co covering Q3 2026 with 12,400 sessions and 87 leads."]
    }
  ]
}