{
  "tools": [
    {
      "name": "sorryassets_get_catalog",
      "description": "Discover live AIGC capabilities, public model ids, and generation parameters. Use this to learn what image and video routes are available before estimating or generating.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      }
    },
    {
      "name": "sorryassets_estimate",
      "description": "Estimate the cost of a generation before running it. Returns the estimated charge and whether the account has sufficient balance.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "capability": {
            "type": "string",
            "enum": [
              "image.generate",
              "video.generate"
            ],
            "description": "The capability to estimate (output type)."
          },
          "provider": {
            "type": "string",
            "description": "Provider identifier (e.g., 'flux', 'dall-e', 'seedance')."
          },
          "model": {
            "type": "string",
            "description": "Provider's model identifier (e.g., 'flux-1-dev'). Optional; server may choose default."
          },
          "params": {
            "type": "object",
            "properties": {
              "inputs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "nodeId": {
                      "type": "string",
                      "description": "ID of a parent/input node."
                    },
                    "role": {
                      "type": "string",
                      "description": "The role this node plays (e.g., 'prompt', 'first_frame')."
                    }
                  },
                  "required": ["nodeId", "role"]
                },
                "description": "Role-tagged input node references. Empty array for origin generation (text-to-image, etc.)."
              },
              "values": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    { "type": "string" },
                    { "type": "number" },
                    { "type": "boolean" }
                  ]
                },
                "description": "Generation parameters (e.g., prompt, size, duration)."
              }
            },
            "required": ["inputs", "values"]
          }
        },
        "required": [
          "capability",
          "provider",
          "params"
        ]
      }
    },
    {
      "name": "sorryassets_generate",
      "description": "Start a generation. Pre-charges the estimated balance and returns a task reference to poll. Use sorryassets_get_task to check status.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "description": "Project ID to write the local provenance graph into."
          },
          "capability": {
            "type": "string",
            "enum": [
              "image.generate",
              "video.generate"
            ],
            "description": "The capability to generate."
          },
          "provider": {
            "type": "string",
            "description": "Provider identifier."
          },
          "model": {
            "type": "string",
            "description": "Provider's model identifier. Optional; server may choose default."
          },
          "params": {
            "type": "object",
            "properties": {
              "inputs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "nodeId": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "required": ["nodeId", "role"]
                },
                "description": "Role-tagged input node references."
              },
              "values": {
                "type": "object",
                "additionalProperties": {
                  "oneOf": [
                    { "type": "string" },
                    { "type": "number" },
                    { "type": "boolean" }
                  ]
                },
                "description": "Generation parameters."
              }
            },
            "required": ["inputs", "values"]
          },
          "clientEdgeId": {
            "type": "string",
            "description": "Unique client-provided ID for idempotent retries. If retrying with the same clientEdgeId, the server returns the existing taskRef."
          }
        },
        "required": [
          "projectId",
          "capability",
          "provider",
          "params",
          "clientEdgeId"
        ]
      }
    },
    {
      "name": "sorryassets_get_task",
      "description": "Poll the status of a generation. Returns task status, output URL (if succeeded), cost, and error reason (if failed). Poll this every 1-5 seconds until status is succeeded, failed, or canceled.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "taskRef": {
            "type": "string",
            "description": "Task reference returned by sorryassets_generate."
          }
        },
        "required": ["taskRef"]
      }
    }
  ]
}
