{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentpmt-com/json-schema/agentpmt-com-products-fetch-response-schema.json",
  "title": "ProductsFetchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentpmt-com-products-api-openapi.yml#/components/schemas/ProductsFetchResponse",
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "`true` when the catalog was fetched successfully.",
      "default": true
    },
    "instance_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instance Id",
      "description": "Connection instance ID the caller can persist and echo back via the `x-instance-id` header on subsequent calls to keep per-session context."
    },
    "details": {
      "$ref": "#/$defs/ProductsFetchDetails"
    },
    "preprompt": {
      "type": "string",
      "title": "Preprompt",
      "description": "Human-readable preamble generated for downstream LLM callers. Changes based on whether any tools matched."
    },
    "tools": {
      "items": {
        "$ref": "#/$defs/ProductsFetchTool"
      },
      "type": "array",
      "title": "Tools",
      "description": "Tools available to the caller on this page."
    },
    "pagination": {
      "$ref": "#/$defs/ProductsFetchPagination",
      "description": "Canonical pagination descriptor (matches the `details` block)."
    },
    "example_tool_call": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Example Tool Call",
      "description": "Illustrative curl command showing how to invoke one of the returned tools."
    }
  },
  "type": "object",
  "required": [
    "details",
    "preprompt",
    "tools",
    "pagination"
  ],
  "$defs": {
    "ProductsFetchDetails": {
      "properties": {
        "tools_on_this_page": {
          "type": "integer",
          "title": "Tools On This Page",
          "description": "Number of tools included in this page of results."
        },
        "total_qualified_tools": {
          "type": "integer",
          "title": "Total Qualified Tools",
          "description": "Total number of tools accessible to the caller (across all pages)."
        },
        "page_returned": {
          "type": "integer",
          "title": "Page Returned",
          "description": "Page index returned (1-based)."
        },
        "page_size_requested": {
          "type": "integer",
          "title": "Page Size Requested",
          "description": "Requested page size."
        },
        "page_source": {
          "type": "string",
          "title": "Page Source",
          "description": "`header` when the caller supplied `X-Page`; `query` otherwise."
        },
        "page_size_source": {
          "type": "string",
          "title": "Page Size Source",
          "description": "`header` when the caller supplied `X-Page-Size`; `query` otherwise."
        },
        "total_pages": {
          "type": "integer",
          "title": "Total Pages",
          "description": "Total number of pages available."
        },
        "has_next_page": {
          "type": "boolean",
          "title": "Has Next Page",
          "description": "True when another page exists after this one."
        },
        "has_previous_page": {
          "type": "boolean",
          "title": "Has Previous Page",
          "description": "True when a page exists before this one."
        }
      },
      "type": "object",
      "required": [
        "tools_on_this_page",
        "total_qualified_tools",
        "page_returned",
        "page_size_requested",
        "page_source",
        "page_size_source",
        "total_pages",
        "has_next_page",
        "has_previous_page"
      ],
      "title": "ProductsFetchDetails"
    },
    "ProductsFetchPagination": {
      "properties": {
        "page": {
          "type": "integer",
          "title": "Page",
          "description": "Page index returned (1-based)."
        },
        "page_size": {
          "type": "integer",
          "title": "Page Size",
          "description": "Page size used to compute this response."
        },
        "total_count": {
          "type": "integer",
          "title": "Total Count",
          "description": "Total number of items across all pages."
        },
        "total_pages": {
          "type": "integer",
          "title": "Total Pages",
          "description": "Total number of pages available."
        },
        "has_next": {
          "type": "boolean",
          "title": "Has Next",
          "description": "True when another page exists after this one."
        },
        "has_prev": {
          "type": "boolean",
          "title": "Has Prev",
          "description": "True when a page exists before this one."
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "page",
        "page_size",
        "total_count",
        "total_pages",
        "has_next",
        "has_prev"
      ],
      "title": "ProductsFetchPagination"
    },
    "ProductsFetchTool": {
      "properties": {
        "product_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Product Id",
          "description": "Tool ObjectId as a string."
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Tool function name used when invoking the tool."
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Name",
          "description": "Human-readable product name."
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description",
          "description": "Short description of what the tool does."
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "ProductsFetchTool",
      "description": "Loose representation of a tool/product entry returned by /products/fetch.\n\nThe full tool schema is product-specific; only the identifier, display\nlabel, and action metadata are stable across the catalog. Additional\nproduct-declared fields are passed through unchanged."
    }
  }
}