{
  "openapi": "3.1.1",
  "info": {
    "title": "Strategic Option Scorer API",
    "version": "1.0.0",
    "summary": "Score 2–8 options on weighted criteria, rule out any that miss a minimum, and see how stable the winner is.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://skillgroveoptionscorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Score 2–8 options on weighted criteria, rule out any that miss a minimum, and see how stable the winner is.",
        "description": "A weighted scoring matrix for choices: give each option a score from 0 to 10 per criterion (by default suitability, acceptability and feasibility from strategic management), weight the criteria and set a hurdle. You get weighted scores, the ranking, which options fail a hurdle, the recommended option and the smallest shift of weight that would change the pick.\n\nMethodology:\n- Weights are relative and scaled to shares that add up to 100 %. Weighted score = Σ share × score, so it stays on the 0–10 scale.\n- Hurdle (screening): an option with any criterion below the hurdle is ruled out before the scores are compared — a strong total cannot buy back a criterion that makes the option unworkable. The recommended option is the best weighted score among the options that pass; ties go to the option listed first.\n- Stability: for every other passing option the tool finds the smallest total weight that has to move between criteria for that option to tie the recommended one. Weight goes to the criterion where the challenger is strongest relative to the leader and is taken first from the criteria where it is weakest (an exact greedy solution). Under 15 percentage points counts as sensitive; if no shift works the pick is fixed (the leader is at least as good on every criterion that could tip the balance).\n- Suitability asks whether an option addresses the strategic situation, acceptability whether owners, lenders, staff and other stakeholders will accept its return and risk, feasibility whether the money, people and capabilities exist — the evaluation criteria used in strategic management textbooks. The scores themselves are your judgement.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "skillgrove_option_scorer",
        "x-owner-app": "skillgrove",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillgroveOptionScorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Lakeside hotel: three ways to win back guests",
                  "value": {
                    "criteria": [
                      {
                        "name": "Suitability",
                        "weight": 40
                      },
                      {
                        "name": "Acceptability",
                        "weight": 30
                      },
                      {
                        "name": "Feasibility",
                        "weight": 30
                      }
                    ],
                    "options": [
                      {
                        "name": "Cut room prices",
                        "s1": 2,
                        "s2": 5,
                        "s3": 9
                      },
                      {
                        "name": "Renovate for business travellers",
                        "s1": 5,
                        "s2": 6,
                        "s3": 4
                      },
                      {
                        "name": "Food-and-nature retreat",
                        "s1": 8,
                        "s2": 7,
                        "s3": 6
                      }
                    ],
                    "threshold": 4
                  }
                },
                "example2": {
                  "summary": "Software firm: the top score fails on feasibility",
                  "value": {
                    "criteria": [
                      {
                        "name": "Suitability",
                        "weight": 40
                      },
                      {
                        "name": "Acceptability",
                        "weight": 30
                      },
                      {
                        "name": "Feasibility",
                        "weight": 30
                      }
                    ],
                    "options": [
                      {
                        "name": "Enter the US market",
                        "s1": 9,
                        "s2": 7,
                        "s3": 3
                      },
                      {
                        "name": "Build an enterprise edition",
                        "s1": 7,
                        "s2": 6,
                        "s3": 6
                      },
                      {
                        "name": "Buy a small competitor",
                        "s1": 6,
                        "s2": 4,
                        "s3": 5
                      }
                    ],
                    "threshold": 4
                  }
                },
                "example3": {
                  "summary": "Choosing a supplier on four criteria",
                  "value": {
                    "criteria": [
                      {
                        "name": "Price",
                        "weight": 35
                      },
                      {
                        "name": "Quality",
                        "weight": 30
                      },
                      {
                        "name": "Delivery reliability",
                        "weight": 20
                      },
                      {
                        "name": "Sustainability",
                        "weight": 15
                      }
                    ],
                    "options": [
                      {
                        "name": "Supplier A",
                        "s1": 8,
                        "s2": 6,
                        "s3": 7,
                        "s4": 4
                      },
                      {
                        "name": "Supplier B",
                        "s1": 6,
                        "s2": 8,
                        "s3": 8,
                        "s4": 7
                      },
                      {
                        "name": "Supplier C",
                        "s1": 9,
                        "s2": 5,
                        "s3": 6,
                        "s4": 6
                      }
                    ],
                    "threshold": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillgroveOptionScorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "SkillgroveOptionScorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "criteria": {
            "title": "Criteria and weights",
            "description": "Up to 6 criteria. Weights are relative (any numbers ≥ 0) and are scaled to add up to 100 %. Criterion 1 is scored in column “Score 1”, and so on.",
            "type": "array",
            "minItems": 2,
            "maxItems": 6,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "title": "Criterion",
                  "type": "string",
                  "maxLength": 60
                },
                "weight": {
                  "title": "Weight",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1000
                }
              },
              "required": [
                "name",
                "weight"
              ]
            },
            "default": [
              {
                "name": "Suitability",
                "weight": 40
              },
              {
                "name": "Acceptability",
                "weight": 30
              },
              {
                "name": "Feasibility",
                "weight": 30
              }
            ]
          },
          "options": {
            "title": "Options and scores (0–10)",
            "description": "One row per option, one score per criterion in the same order (0 = very poor, 10 = excellent). Leave the columns of unused criteria empty.",
            "type": "array",
            "minItems": 2,
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "title": "Option",
                  "type": "string",
                  "maxLength": 60
                },
                "s1": {
                  "title": "Score 1",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                },
                "s2": {
                  "title": "Score 2",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                },
                "s3": {
                  "title": "Score 3",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                },
                "s4": {
                  "title": "Score 4",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                },
                "s5": {
                  "title": "Score 5",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                },
                "s6": {
                  "title": "Score 6",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 10
                }
              },
              "required": [
                "name"
              ]
            },
            "default": [
              {
                "name": "Cut room prices",
                "s1": 2,
                "s2": 5,
                "s3": 9
              },
              {
                "name": "Renovate for business travellers",
                "s1": 5,
                "s2": 6,
                "s3": 4
              },
              {
                "name": "Food-and-nature retreat",
                "s1": 8,
                "s2": 7,
                "s3": 6
              }
            ]
          },
          "threshold": {
            "title": "Hurdle: lowest acceptable score per criterion",
            "description": "An option with any score below this is ruled out, however high its total. 0 switches the hurdle off.",
            "type": "number",
            "minimum": 0,
            "maximum": 10,
            "default": 4
          }
        },
        "required": [
          "criteria",
          "options"
        ]
      },
      "SkillgroveOptionScorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "criteria",
              "weights",
              "threshold",
              "options",
              "ranking",
              "recommended",
              "topScore",
              "hurdleChangesPick",
              "margin",
              "runnerUp",
              "robustness",
              "stability"
            ],
            "properties": {
              "criteria": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "weights": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "description": "Normalised weights in % (sum 100, rounded to 0.1)."
              },
              "threshold": {
                "type": "number"
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "scores",
                    "weighted",
                    "rank",
                    "failed",
                    "passes",
                    "contributions"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "scores": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    "weighted": {
                      "type": "number",
                      "description": "Weighted score 0–10."
                    },
                    "rank": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Criteria scored below the hurdle."
                    },
                    "passes": {
                      "type": "boolean"
                    },
                    "contributions": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  }
                }
              },
              "ranking": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "recommended": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Best weighted score among options that pass every hurdle."
              },
              "topScore": {
                "type": "string"
              },
              "hurdleChangesPick": {
                "type": "boolean"
              },
              "margin": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "runnerUp": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "robustness": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Smallest weight shift (percentage points) that lets another passing option tie the recommended one.",
                "properties": {
                  "challenger": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "moves": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "points": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "points": {
                    "type": "number"
                  },
                  "newWeights": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  }
                }
              },
              "stability": {
                "type": "string",
                "enum": [
                  "none-pass",
                  "only-option",
                  "fixed",
                  "sensitive",
                  "stable"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}