{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ainumbers.co/chaingraph/schemas/manifest.schema.json",
  "title": "AINumbers manifest (manifests/*.manifest.json)",
  "description": "Covers the two manifest flavors found in manifests/*.manifest.json: (A) tool manifests (525 files, e.g. 01-a2a-fee-route-optimizer.manifest.json) and (B) chaingraph node manifests (8 art-*.manifest.json files, e.g. art-207-attribution-string-generator.manifest.json). Derived from the full 533-file corpus 2026-07-14, not from prose.",
  "$defs": {
    "mcpToolDefinition": {
      "type": "object",
      "required": ["name", "description", "inputSchema"],
      "properties": {
        "name": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "inputSchema": {
          "type": "object",
          "required": ["type"],
          "properties": {
            "type": { "type": "string" },
            "required": { "type": "array", "items": { "type": "string" } },
            "properties": { "type": "object" }
          }
        }
      }
    },
    "toolManifest": {
      "type": "object",
      "required": ["tool_id", "version", "title", "description", "category", "tags", "mcp_tool_definition", "ap2_export"],
      "properties": {
        "tool_id": { "type": "string", "minLength": 1 },
        "version": { "type": "string", "minLength": 1 },
        "title": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "category": { "type": "string", "minLength": 1 },
        "tags": { "type": "array", "items": { "type": "string" } },
        "audience": { "type": "array", "items": { "type": "string" } },
        "input_schema": { "type": "object" },
        "output_schema": { "type": "object" },
        "mcp_tool_definition": { "$ref": "#/$defs/mcpToolDefinition" },
        "execution": { "type": "object" },
        "ap2_export": { "type": "boolean" },
        "prefill": { "type": "boolean" },
        "bridge_version": { "type": "string" },
        "pii_transmitted": { "type": "boolean" },
        "execution_context": { "type": "string" },
        "file": { "type": "string" },
        "regulatory_citations": { "type": "array" },
        "cross_links": { "type": "array" },
        "privacy": { "type": "object" },
        "last_reviewed": { "type": "string" },
        "source": { "type": "string" },
        "intake": { "type": "boolean" },
        "mandate_type": { "type": "string" },
        "regulatory_frameworks": { "type": "array" },
        "database_entries": { "type": "number" },
        "database_horizon": { "type": "string" },
        "disclaimer": { "type": "string" },
        "hub": { "type": "string" },
        "deterministic": { "type": "boolean" },
        "chain": { "type": "object" },
        "regulatory_refs": { "type": "array" },
        "schema_version": { "type": "string" },
        "url": { "type": "string" },
        "chaingraph": { "type": ["object", "boolean"] },
        "semantic_profile": { "type": "string" },
        "dct:conformsTo": { "type": "string" },
        "dct_conforms_to": { "type": "string" },
        "dct_conformsTo": { "type": "string" },
        "compliance_flags": { "type": "array" },
        "tier2_csv": { "type": "boolean" },
        "@context": { "type": "array" },
        "mcp_tool": { "type": "string" },
        "chaingraph_node": { "type": "string" },
        "chaingraph_version": { "type": "string" }
      },
      "additionalProperties": false
    },
    "chaingraphNodeManifest": {
      "type": "object",
      "required": [
        "tool_id", "version", "mcp_name", "title", "description",
        "spec_version", "chaingraph_version", "regulation", "page_url",
        "mandate_type", "gpu", "compute_proof_ready", "mcp_tool_definition"
      ],
      "properties": {
        "tool_id": { "type": "string", "minLength": 1 },
        "version": { "type": "string", "minLength": 1 },
        "mcp_name": { "type": "string", "minLength": 1 },
        "title": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "spec_version": { "type": "string" },
        "chaingraph_version": { "type": "string" },
        "regulation": { "type": "string" },
        "page_url": { "type": "string" },
        "mandate_type": { "type": "string" },
        "gpu": { "type": "boolean" },
        "compute_proof_ready": { "type": "string" },
        "mcp_tool_definition": { "$ref": "#/$defs/mcpToolDefinition" }
      },
      "additionalProperties": false
    }
  },
  "oneOf": [
    { "$ref": "#/$defs/toolManifest" },
    { "$ref": "#/$defs/chaingraphNodeManifest" }
  ]
}
