{
  "protocol": "CM-AI-Docking-Port",
  "version": "0.1",
  "service": {
    "name": "Apartma Matevz Reception",
    "type": "ai-entry-point",
    "node_id": "CM-AI-PROD-APARTMAMATEVZ",
    "location": { "label": "Lancovo / Radovljica, Slovenia", "lat": 46.34, "lon": 14.17 },
    "canonical_domain": "apartmamatevz.si",
    "discovery": "https://apartmamatevz.si/.well-known/vacation-rental.json",
    "jwks_url": "https://apartmamatevz.si/.well-known/jwks.json",
    "verified_stay_offer_endpoint": "https://apartmamatevz.si/app/public/api/vrp_offer.php"
  },
  "capabilities": {
    "local": [
      {
        "id": "availability",
        "side_effect": false,
        "requires_consent": false,
        "description": "Check unit availability for a date range"
      }
    ],
    "ecosystem": [
      {
        "id": "accommodation-discovery",
        "side_effect": false,
        "requires_consent": false,
        "description": "Geographic discovery across participating CM nodes via Reception"
      }
    ]
  },
  "reception": {
    "method": "POST",
    "endpoint": "/app/public/ai/reception.php",
    "content_type": "application/json",
    "error_shape": "Every entry in the response's errors[] array is exactly {code, message}. code is one of the fixed values below and is the only field an agent should branch on - message is human-readable only and may change wording without notice.",
    "error_codes": [
      { "code": "invalid_envelope", "http_status": 400, "meaning": "Body is not valid JSON, or protocol field does not match \"CM-AI-Docking-Port\"." },
      { "code": "missing_request_expiry", "http_status": 400, "meaning": "request_expiry field is absent or empty." },
      { "code": "invalid_request_expiry", "http_status": 400, "meaning": "request_expiry is present but not a parseable RFC3339/ISO8601 timestamp." },
      { "code": "request_expired", "http_status": 400, "meaning": "request_expiry is a valid timestamp but is already in the past." },
      { "code": "method_not_allowed", "http_status": 405, "meaning": "Request method was not POST." },
      { "code": "rate_limited", "http_status": 429, "meaning": "Too many requests from this client IP. Retry-After header gives the wait in seconds." },
      { "code": "unsupported_query_type", "http_status": 200, "meaning": "query.type is set but is not \"availability\" (the only type this MVP supports). Returned as a normal Response Envelope with ok:false, not an HTTP error, because the envelope itself was well-formed." },
      { "code": "missing_dates", "http_status": 200, "meaning": "query.from and/or query.to are missing. Same ok:false-with-200 treatment as unsupported_query_type, for the same reason." }
    ]
  },
  "a2a": {
    "method": "POST",
    "endpoint": "/app/public/ai/a2a_rpc.php",
    "content_type": "application/json",
    "transport": "JSON-RPC 2.0",
    "methods": ["SendMessage"],
    "agent_card": "/.well-known/agent-card.json",
    "error_shape": "Standard JSON-RPC 2.0 error object: {code, message}, in the response's top-level error field. code -32600/-32601/-32602/-32603 are the standard JSON-RPC meanings (invalid request / method not found / invalid params / internal error). code -32029 (in the -32000..-32099 server-error range JSON-RPC 2.0 reserves for implementation use) means rate_limited - see reception.error_codes above, same limiter."
  },
  "mcp": {
    "method": "POST",
    "endpoint": "/app/public/ai/mcp.php",
    "content_type": "application/json",
    "transport": "Streamable HTTP (MCP 2025-06-18), stateless - no Mcp-Session-Id, no SSE; server always responds with a single application/json object. GET returns 405 (no SSE stream offered).",
    "tools": ["get_verified_stay_offer"],
    "note": "This is a separate, narrower surface from Reception/A2A above: it exposes exactly the one signed-offer tool defined by the VRP Node Tool Binding v0.1 (vacationrentalprotocol.com/spec/node-tool-binding-v0.1), not Reception's availability/discovery capabilities."
  },
  "limits_default": { "max_depth": 1, "max_fanout": 2, "max_distance_km": 50, "max_results": 20 },
  "notes": [
    "AI agents must always communicate with Reception.",
    "Do not call internal business APIs directly.",
    "Entry point and search target are separate concepts.",
    "The AgentCard (/.well-known/agent-card.json) is Ed25519-signed (A2A JWS card signature, same key as the VRP offer endpoint). Each A2A SendMessage result's own-node entry is signed (compact JWS, same key). The MCP get_verified_stay_offer tool returns the same signed envelope vrp_offer.php itself returns, unmodified. This manifest.json itself and the plain Reception response (reception.php, non-A2A) are not signed. For price/availability always verify the signed VRP offer, not this manifest or either Reception form.",
    "Beyond depth 0 (a node answering about its own units), Reception never returns a usable or citable answer on another node's behalf - only a pointer (canonical_domain, and query_hint if the neighbour publishes a verified_stay_offer_endpoint). Any signed offer, price, or booking action is always retrieved directly from that node's own canonical_domain."
  ]
}
