{
  "openapi": "3.0.3",
  "info": {
    "title": "rieder-enterprises Agent API",
    "version": "1.2.0",
    "description": "Agentenzugang zu öffentlichen Magazin- und Marktdaten sowie Immobilien-Inserate (Schreiben mit persönlichem rl_-Token). Alle Inhalte und Rechenergebnisse dienen der Information und Bildung. Sie sind keine Anlageberatung, keine Anlageempfehlung, keine Versicherungs-, Kredit-, Steuer- oder Rechtsberatung und keine Aufforderung zum Kauf oder Verkauf von Finanzinstrumenten."
  },
  "servers": [
    {
      "url": "https://rieder-enterprises.com"
    }
  ],
  "paths": {
    "/api/agent/tools": {
      "get": {
        "operationId": "listAgentTools",
        "summary": "Tool-Katalog",
        "responses": {
          "200": {
            "description": "Katalog mit Scopes und JSON-Schemas"
          }
        }
      }
    },
    "/api/agent/invoke": {
      "post": {
        "operationId": "invokeAgentTool",
        "summary": "Tool ausführen",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tool"
                ],
                "properties": {
                  "tool": {
                    "type": "string",
                    "enum": [
                      "get_site_info",
                      "search_listings",
                      "get_listing",
                      "search_directory",
                      "get_sparzinsen",
                      "get_kredite",
                      "get_kreditkarten",
                      "search_articles",
                      "create_listing",
                      "update_listing",
                      "list_my_listings",
                      "withdraw_listing"
                    ]
                  },
                  "input": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool-Ergebnis"
          },
          "400": {
            "description": "Ungültige Eingabe"
          },
          "401": {
            "description": "Listing-Write ohne rl_-Token"
          },
          "403": {
            "description": "Scope fehlt (ABAC)"
          },
          "404": {
            "description": "Unbekanntes Tool"
          },
          "429": {
            "description": "Rate limit"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      }
    },
    "/api/agent/listings": {
      "get": {
        "operationId": "listMyListingsRest",
        "summary": "Eigene Inserate (REST, gleiches Schema wie list_my_listings)",
        "security": [
          {
            "listingBearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inserate des Token-Kontos"
          },
          "401": {
            "description": "Ungültiges oder fehlendes rl_-Token"
          }
        }
      },
      "post": {
        "operationId": "createListingRest",
        "summary": "Inserat anlegen (REST, gleiches Schema wie create_listing)",
        "security": [
          {
            "listingBearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolInput_create_listing"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Angelegt (pending oder live)"
          },
          "401": {
            "description": "Ungültiges oder fehlendes rl_-Token"
          }
        }
      }
    },
    "/api/agent/listings/{id}": {
      "put": {
        "operationId": "updateListingRest",
        "summary": "Inserat aktualisieren (REST, gleiches Schema wie update_listing)",
        "security": [
          {
            "listingBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "listing"
                ],
                "properties": {
                  "listing": {
                    "type": "object"
                  },
                  "featured": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Aktualisiert"
          },
          "401": {
            "description": "Ungültiges oder fehlendes rl_-Token"
          }
        }
      }
    },
    "/api/agent/listings/{id}/withdraw": {
      "post": {
        "operationId": "withdrawListingRest",
        "summary": "Inserat schließen (REST, gleiches Schema wie withdraw_listing)",
        "security": [
          {
            "listingBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Geschlossen"
          },
          "401": {
            "description": "Ungültiges oder fehlendes rl_-Token"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcpStreamableHttp",
        "summary": "Model Context Protocol (Streamable HTTP)",
        "responses": {
          "200": {
            "description": "MCP session / tool traffic"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Optional für Lese-Tools. MCP_AGENT_KEYS (id:secret:scopes). Ohne Key gelten die öffentlichen Scopes."
      },
      "listingBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Pflicht für Inserat-Schreiben. Persönliches rl_-Token (Scopes listings:read | listings:write | listings:withdraw). MCP_AGENT_KEYS und Gateway-Share-Links sind ungültig."
      }
    },
    "schemas": {
      "ToolInput_get_site_info": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "ToolInput_search_listings": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "immobilien",
              "agenturen",
              "steuerberater",
              "notare",
              "immobilienmakler"
            ]
          },
          "city": {
            "type": "string"
          },
          "land": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ToolInput_get_listing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "ToolInput_search_directory": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "notare",
              "vermittler",
              "steuerberater",
              "immobilienmakler",
              "pfandhaeuser"
            ]
          },
          "city": {
            "type": "string"
          },
          "land": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false
      },
      "ToolInput_get_sparzinsen": {
        "type": "object",
        "properties": {
          "land": {
            "type": "string",
            "enum": [
              "DE",
              "AT",
              "DE,AT",
              "ALL"
            ]
          }
        },
        "additionalProperties": false
      },
      "ToolInput_get_kredite": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "ToolInput_get_kreditkarten": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "ToolInput_search_articles": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "rubric": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ToolInput_create_listing": {
        "type": "object",
        "required": [
          "listing",
          "ugcAttestation"
        ],
        "properties": {
          "listing": {
            "type": "object",
            "description": "Inseratsdaten (wie Web-Formular). Ohne listerType wird bei Agent-Token automatisch makler angenommen."
          },
          "featured": {
            "type": "boolean"
          },
          "ugcAttestation": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Mit ugcAttestation: true bestätigt der Einsender: (1) eigenes Objekt oder ausdrückliches Inseratsmandat, (2) sämtliche Rechte an Fotos/Grundrissen und einfache, unentgeltliche, nicht-exklusive Anzeigelizenz an rieder-enterprises, (3) Richtigkeit der Angaben und alleinige Verantwortung für Inhalt und Vollständigkeit, (4) Freistellung des Betreibers von Ansprüchen Dritter wegen des eingestellten Materials."
          }
        },
        "additionalProperties": false
      },
      "ToolInput_update_listing": {
        "type": "object",
        "required": [
          "id",
          "listing"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "listing": {
            "type": "object"
          },
          "featured": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ToolInput_list_my_listings": {
        "type": "object",
        "properties": {
          "directory": {
            "type": "string",
            "enum": [
              "immobilien",
              "agenturen",
              "steuerberater",
              "notare",
              "immobilienmakler"
            ]
          }
        },
        "additionalProperties": false
      },
      "ToolInput_withdraw_listing": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "additionalProperties": false
      }
    }
  }
}