{
  "openapi": "3.1.1",
  "info": {
    "title": "Household Plant Fit API",
    "version": "1.0.0",
    "summary": "Filter a small sourced plant catalog by light, care effort and cat/dog listing.",
    "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://hearthplantfit.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Filter a small sourced plant catalog by light, care effort and cat/dog listing.",
        "description": "Compare twenty-four identified houseplants by light, space and care effort, with scientific-name aliases and species-specific ASPCA/RHS references.\n\nMethodology:\n- Catalog updated 2026-11-05: twenty-four identified species, species-specific ASPCA entries and linked RHS cultivation guidance. Scientific aliases preserve the scope of the source classification.\n- Bright means indirect light. Care effort and space categories are editorial filters, not measured requirements. Non-toxic is an ASPCA cat/dog listing; it does not mean edible or suitable for every animal.\n- Care reminders should prompt checking the plant and growing medium, not watering on a fixed schedule. The catalog is not an identification or ingestion-advice tool.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "hearth_plant_fit",
        "x-owner-app": "hearth",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HearthPlantFitInput"
              },
              "examples": {
                "example1": {
                  "summary": "Try an example",
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HearthPlantFitResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "HearthPlantFitInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "light": {
            "title": "Light conditions",
            "type": "string",
            "enum": [
              "bright",
              "low",
              "direct"
            ],
            "default": "bright"
          },
          "care": {
            "title": "Maximum care effort",
            "type": "string",
            "enum": [
              "easy",
              "moderate",
              "attentive"
            ],
            "default": "moderate"
          },
          "pets": {
            "title": "Only ASPCA-listed non-toxic choices for cats and dogs",
            "type": "boolean",
            "default": true
          },
          "space": {
            "title": "Space",
            "type": "string",
            "enum": [
              "any",
              "compact",
              "medium",
              "large"
            ],
            "default": "any"
          },
          "query": {
            "title": "Plant name or scientific alias",
            "type": "string",
            "maxLength": 100,
            "default": ""
          }
        },
        "required": []
      },
      "HearthPlantFitResult": {
        "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",
            "additionalProperties": false,
            "required": [
              "plants",
              "catalogSize",
              "notes"
            ],
            "properties": {
              "plants": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "scientific",
                    "aliases",
                    "light",
                    "care",
                    "pets",
                    "source",
                    "careSource",
                    "size",
                    "careNotes",
                    "nameDe",
                    "careNotesDe"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "scientific": {
                      "type": "string"
                    },
                    "aliases": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "light": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "care": {
                      "type": "string"
                    },
                    "pets": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "careSource": {
                      "type": "string"
                    },
                    "size": {
                      "type": "string"
                    },
                    "careNotes": {
                      "type": "string"
                    },
                    "nameDe": {
                      "type": "string"
                    },
                    "careNotesDe": {
                      "type": "string"
                    }
                  }
                }
              },
              "catalogSize": {
                "type": "number"
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}