{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/capabilities-work/json-schema/capabilities-work-search-result-schema.json",
  "title": "SearchResult",
  "description": "The best answer and alternatives for one problem.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/capabilities-work-solutions-api-openapi.yml#/components/schemas/SearchResult",
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "confidence": {
      "type": "string",
      "enum": [
        "strong",
        "weak"
      ]
    },
    "relevance": {
      "type": "number"
    },
    "best": {
      "$ref": "#/$defs/Solution"
    },
    "alternatives": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Solution"
      }
    }
  },
  "required": [
    "query",
    "confidence"
  ],
  "additionalProperties": true,
  "$defs": {
    "Action": {
      "type": "object",
      "description": "The exact operation to call.",
      "properties": {
        "method": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "api": {
          "type": "string"
        }
      }
    },
    "ProviderRef": {
      "type": "object",
      "description": "The company behind the solution.",
      "properties": {
        "slug": {
          "type": "string",
          "description": "The apis.io slug."
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "slug"
      ]
    },
    "Solution": {
      "type": "object",
      "description": "One answer: a single API operation, or a multi-step recipe (Arazzo workflow).",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable id: provider:METHOD:path for an operation, or a recipe id."
        },
        "solves": {
          "type": "string",
          "description": "What it does, phrased the way people ask for it."
        },
        "kind": {
          "type": "string",
          "description": "The kind of job, e.g. \"Get something done\"."
        },
        "capability": {
          "type": "string",
          "description": "The business capability it belongs to."
        },
        "provider": {
          "$ref": "#/$defs/ProviderRef"
        },
        "asks": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Questions people ask that this answers."
        },
        "say_it_like": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "How to ask an agent for it."
        },
        "type": {
          "type": "string",
          "enum": [
            "operation",
            "recipe"
          ]
        },
        "action": {
          "$ref": "#/$defs/Action"
        },
        "agent_ready": {
          "type": "boolean",
          "description": "Whether the provider scores agent-ready on apis.io."
        },
        "mcp": {
          "type": [
            "object",
            "null"
          ],
          "description": "The provider's MCP server, when it has one."
        },
        "links": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "format": "uri"
          },
          "description": "self: the human page; engineers: the apis.io page."
        }
      },
      "required": [
        "id",
        "solves"
      ],
      "additionalProperties": true
    }
  }
}