{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zairalabs-ai/json-schema/zairalabs-ai-tool-detail-schema.json",
  "title": "ToolDetail",
  "description": "Complete tool entry with decision logic, constraints, health metrics, and agent-readiness data. Returned by GET /tools/{slug} and GET /compare. Cross-reference fields (alternatives, worksWith) are enriched with tagline + agent-readiness when the slug resolves so a single round trip carries enough triage data for follow-up routing.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/klaxon-api-guide-openapi.json#/components/schemas/ToolDetail",
  "type": "object",
  "properties": {
    "entryKind": {
      "type": "string",
      "enum": [
        "tool"
      ]
    },
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "tagline": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "2-3 sentences describing what the tool is, who it's for, what makes it distinctive."
    },
    "vendor": {
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "secondaryCategories": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "artifactKind": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "open_source",
        "managed_service",
        null
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Tool homepage."
    },
    "docsUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "repositoryUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "install": {
      "type": [
        "string",
        "null"
      ],
      "description": "Primary install command, single ecosystem (e.g., `npm install stripe`)."
    },
    "pricingModel": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "free",
        "freemium",
        "paid",
        null
      ]
    },
    "hasFreeTier": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "minFreeTier": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the free tier actually includes."
    },
    "trialCredits": {
      "type": [
        "string",
        "null"
      ],
      "description": "One-time credits or time-limited trials for new customers (never standing allowances)."
    },
    "pricingUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "statusUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "ardCatalogUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "The vendor's published ARD (Agentic Resource Discovery) capability manifest (ai-catalog.json), fetched and shape-validated during ingestion."
    },
    "license": {
      "type": [
        "string",
        "null"
      ],
      "description": "SPDX identifier for open-source; 'Proprietary' for closed-source; mixed strings (e.g., 'MIT (SDK), Proprietary (service)') for hybrids."
    },
    "deployment": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Languages the tool itself is written in or natively supports."
    },
    "sdkLanguages": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "Languages with official SDK support."
    },
    "edgeCompatible": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "selfHostable": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "mcpSupport": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "none",
        "community",
        "official",
        null
      ]
    },
    "mcpServerUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "The MCP server an agent connects to when mcpSupport is `community` or `official`: the verified remote endpoint, otherwise the repository or package for a locally run server. Never a docs page."
    },
    "mcpDocsUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "The vendor's own MCP docs or setup page, when one is live and on-topic. Complements mcpServerUrl; never a substitute for it."
    },
    "compliance": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "lifecycle": {
      "type": [
        "object",
        "null"
      ],
      "description": "Whether the product is still a going concern. null for an active tool; otherwise the status (maintenance mode, deprecated, or ended), its dates, the successors the vendor names (with a guide slug when the successor has an entry), and the vendor's own notice as `source`.",
      "required": [
        "status",
        "source"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "maintenance",
            "deprecated",
            "ended"
          ]
        },
        "since": {
          "type": "string",
          "format": "date",
          "description": "When the status began or was announced."
        },
        "endDate": {
          "type": "string",
          "format": "date",
          "description": "The announced or actual end of the product or its support."
        },
        "successors": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string",
                "description": "The successor's guide slug, when it has an entry."
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "source": {
          "type": "string",
          "format": "uri",
          "description": "The vendor's own notice."
        },
        "note": {
          "type": "string",
          "maxLength": 280
        }
      }
    },
    "useWhen": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "3-5 specific conditions where this tool is the right choice."
    },
    "avoidWhen": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "2-4 specific conditions where this tool is the wrong choice."
    },
    "bestFor": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "tradeoffs": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "object",
          "properties": {
            "pros": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "cons": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Balanced tradeoff claims — either a flat list or {pros, cons}."
    },
    "faqs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          }
        }
      },
      "description": "Five question/answer pairs grounded in the entry's own decision data."
    },
    "alternatives": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/EnrichedRelatedTool"
      },
      "description": "Comparable tools the agent could route to instead. Enriched with tagline + agent-readiness when slug resolves."
    },
    "worksWith": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/EnrichedRelatedTool"
      },
      "description": "Tools this integrates well with. Enriched with tagline + agent-readiness when slug resolves."
    },
    "conflictsWith": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RelatedTool"
      },
      "description": "Known incompatibilities. Negative references — never carry a slug, never enriched (we don't route traffic toward an incompatibility)."
    },
    "githubStars": {
      "type": [
        "integer",
        "null"
      ]
    },
    "githubForks": {
      "type": [
        "integer",
        "null"
      ]
    },
    "monthlyDownloads": {
      "type": [
        "integer",
        "null"
      ]
    },
    "latestRelease": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 date."
    },
    "lastCommit": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 date."
    },
    "contributorCount": {
      "type": [
        "integer",
        "null"
      ]
    },
    "busFactor": {
      "type": [
        "integer",
        "null"
      ]
    },
    "dependentPackages": {
      "type": [
        "integer",
        "null"
      ]
    },
    "openssfScorecard": {
      "type": [
        "number",
        "null"
      ],
      "description": "OpenSSF Scorecard score, 0-10."
    },
    "securityAdvisories": {
      "type": [
        "integer",
        "null"
      ]
    },
    "securityAdvisoryIds": {
      "type": [
        "array",
        "null"
      ],
      "maxItems": 10,
      "description": "Up to 10 of the advisories behind securityAdvisories, newest first. null when the entry has no advisory count or the count is zero.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The advisory id (GHSA over CVE over the source's own id)."
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "moderate",
              "medium",
              "low"
            ]
          },
          "published": {
            "type": "string",
            "format": "date",
            "description": "When the advisory was published."
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "securityAdvisoriesUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "The full advisory list: the repository's GitHub advisories page or an OSV list. null with securityAdvisoryIds."
    },
    "repoArchived": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Open-source lane only. true when the source repository is archived (read-only on GitHub). null otherwise; false is never returned."
    },
    "versionTable": {
      "type": [
        "object",
        "null"
      ],
      "description": "The version table of the releases this tool ships, on the few tools that ship a language's releases (.NET for C#, Node.js for JavaScript). null on every other tool.",
      "properties": {
        "supportModel": {
          "type": "string",
          "enum": [
            "fixed_windows",
            "last_n",
            "latest_only",
            "set_by_runtime",
            "none_published"
          ]
        },
        "supportedCount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "statusAsOf": {
          "type": "string",
          "format": "date",
          "description": "The day each version's status was computed for: the day of the request."
        },
        "versions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "cycle": {
                "type": "string"
              },
              "released": {
                "type": "string",
                "format": "date"
              },
              "latest": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "latestReleased": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "activeSupportUntil": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "eol": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "lts": {
                "type": "boolean"
              },
              "status": {
                "type": "string",
                "enum": [
                  "not_yet_released",
                  "supported",
                  "security_fixes_only",
                  "end_of_life",
                  "not_stated"
                ]
              }
            }
          }
        },
        "versionsSource": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "versionsAsOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    },
    "agentReadinessTier": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "base",
        "agent_ready",
        "agent_native",
        "none",
        null
      ],
      "description": "Snake-case canonical value. `none` means not yet evaluated."
    },
    "agentReadinessScore": {
      "type": [
        "number",
        "null"
      ],
      "description": "Overall Zaira score, 0-100."
    },
    "agentReadinessSections": {
      "type": [
        "object",
        "null"
      ],
      "description": "Base Standard section scores (0-100): documentationUsability (criteria B1-B7), provenanceDisclosure (B8-B9), lifecycleHealth (B10-B15).",
      "properties": {
        "documentationUsability": {
          "type": "number"
        },
        "provenanceDisclosure": {
          "type": "number"
        },
        "lifecycleHealth": {
          "type": "number"
        }
      }
    },
    "activatedModules": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "moduleScores": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "number"
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Data provenance categories (e.g. official documentation, package registries). Static per artifactKind, not a per-tool list."
    },
    "lastVerified": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 date."
    }
  },
  "$defs": {
    "EnrichedRelatedTool": {
      "allOf": [
        {
          "$ref": "#/$defs/RelatedTool"
        },
        {
          "type": "object",
          "description": "Adds triage fields when the slug resolves to a guide entry, so agents can prioritize candidates without a follow-up GET. Only present in alternatives and worksWith on /tools/{slug} and /tools/{slug}/alternatives responses.",
          "properties": {
            "tagline": {
              "type": [
                "string",
                "null"
              ],
              "description": "Short description of the referenced tool."
            },
            "agentReadinessTier": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "base",
                "agent_ready",
                "agent_native",
                "none",
                null
              ]
            },
            "agentReadinessScore": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        }
      ]
    },
    "RelatedTool": {
      "type": "object",
      "description": "Cross-reference to another tool. `slug` is present only when the referenced tool exists in the guide — agents can chain to GET /tools/{slug} for full detail. Negative references (conflictsWith) never carry a slug.",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name of the referenced tool."
        },
        "type": {
          "type": "string",
          "description": "Short category descriptor so the agent knows what kind of tool this is without clicking through (e.g., 'Serverless Postgres')."
        },
        "slug": {
          "type": "string",
          "description": "Resolved slug into the guide. Absent when the referenced tool isn't yet in the catalog."
        },
        "reason": {
          "type": "string",
          "description": "One sentence on when to choose this alternative / why it pairs / why it conflicts."
        },
        "context": {
          "type": "string",
          "description": "Optional scoping clause — when the assertion applies (e.g., 'serverless functions only')."
        }
      }
    }
  }
}