{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/protocol/list-tasks-request.json",
  "title": "List Tasks Request",
  "description": "Request parameters for the list_tasks AdCP tool. This is a 3.x protocol-namespace alias for the legacy AdCP tasks/list reconciliation surface, not a transport-native MCP/A2A tasks/* method. It lists and filters AdCP application-layer async tasks for state reconciliation while preserving the legacy 3.x payload shape.",
  "x-tool-summary": "List and filter AdCP asynchronous tasks for state reconciliation.",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json"
    }
  ],
  "properties": {
    "account": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/account-ref.json",
      "description": "Account scope for task reconciliation. Sellers MUST only return tasks created for the caller's authenticated account + principal pair. When omitted, the seller MAY use the credential-bound singleton account, but multi-account credentials SHOULD require an explicit account."
    },
    "filters": {
      "type": "object",
      "description": "Filter criteria for querying tasks",
      "properties": {
        "protocol": {
          "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/adcp-protocol.json",
          "description": "Filter by single AdCP protocol"
        },
        "protocols": {
          "type": "array",
          "description": "Filter by multiple AdCP protocols",
          "items": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/adcp-protocol.json"
          },
          "minItems": 1
        },
        "status": {
          "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/task-status.json",
          "description": "Filter by single task status"
        },
        "statuses": {
          "type": "array",
          "description": "Filter by multiple task statuses",
          "items": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/task-status.json"
          },
          "minItems": 1
        },
        "task_type": {
          "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/task-type.json",
          "description": "Filter by single task type"
        },
        "task_types": {
          "type": "array",
          "description": "Filter by multiple task types",
          "items": {
            "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/task-type.json"
          },
          "minItems": 1
        },
        "created_after": {
          "type": "string",
          "format": "date-time",
          "description": "Filter tasks created after this date (ISO 8601)"
        },
        "created_before": {
          "type": "string",
          "format": "date-time",
          "description": "Filter tasks created before this date (ISO 8601)"
        },
        "updated_after": {
          "type": "string",
          "format": "date-time",
          "description": "Filter tasks last updated after this date (ISO 8601)"
        },
        "updated_before": {
          "type": "string",
          "format": "date-time",
          "description": "Filter tasks last updated before this date (ISO 8601)"
        },
        "task_ids": {
          "type": "array",
          "description": "Filter by specific task IDs",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 100
        },
        "context_contains": {
          "type": "string",
          "description": "Filter tasks where context contains this text (searches media_buy_id, signal_id, etc.)"
        },
        "has_webhook": {
          "type": "boolean",
          "description": "Filter tasks that have webhook configuration when true"
        }
      },
      "additionalProperties": true
    },
    "sort": {
      "type": "object",
      "description": "Sorting parameters",
      "properties": {
        "field": {
          "type": "string",
          "enum": [
            "created_at",
            "updated_at",
            "status",
            "task_type",
            "protocol"
          ],
          "default": "created_at",
          "description": "Field to sort by"
        },
        "direction": {
          "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/enums/sort-direction.json",
          "default": "desc",
          "description": "Sort direction"
        }
      },
      "additionalProperties": true
    },
    "pagination": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/pagination-request.json"
    },
    "include_history": {
      "type": "boolean",
      "default": false,
      "description": "Include full conversation history for each task (may significantly increase response size)"
    },
    "context": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/context.json"
    },
    "ext": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/ext.json"
    }
  },
  "additionalProperties": true,
  "examples": [
    {
      "description": "List all pending tasks across protocols",
      "data": {
        "account": {
          "brand": {
            "domain": "acme-corp.example"
          },
          "operator": "acme-corp.example",
          "sandbox": true
        },
        "filters": {
          "statuses": [
            "submitted",
            "working",
            "input-required"
          ]
        }
      }
    },
    {
      "description": "Find media-buy tasks requiring attention",
      "data": {
        "filters": {
          "protocol": "media-buy",
          "statuses": [
            "input-required",
            "failed"
          ]
        },
        "sort": {
          "field": "updated_at",
          "direction": "asc"
        }
      }
    },
    {
      "description": "Recent signal operations",
      "data": {
        "filters": {
          "protocol": "signals",
          "created_after": "2025-01-01T00:00:00Z"
        },
        "pagination": {
          "max_results": 20
        }
      }
    },
    {
      "description": "State reconciliation for specific campaign",
      "data": {
        "filters": {
          "context_contains": "acme_q1_2025"
        },
        "include_history": true
      }
    }
  ]
}
