{"openapi":"3.1.0","info":{"title":"El Plomero de Santiago SRL Public API","version":"1.0.0","description":"Public REST, Markdown negotiation, and Model Context Protocol (MCP) API for El Plomero de Santiago SRL in Santiago de los Caballeros, Dominican Republic.","contact":{"name":"El Plomero de Santiago SRL","url":"https://elplomerosantiago.com/contacto","email":"soporte@elplomerosantiago.com"}},"servers":[{"url":"https://elplomerosantiago.com","description":"Production server"}],"paths":{"/api":{"get":{"operationId":"getApiHealth","summary":"Get API status","description":"Returns basic service availability metadata for the El Plomero de Santiago SRL API.","responses":{"200":{"description":"Service is operational","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"Health indicator"},"service":{"type":"string","description":"Service identifier"}},"required":["ok","service"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/markdown":{"get":{"operationId":"getPageAsMarkdown","summary":"Render a public page as Markdown","description":"Returns a clean Markdown representation of any public page on elplomerosantiago.com. Also triggered automatically when requesting public pages with Accept: text/markdown.","parameters":[{"name":"path","in":"query","required":false,"description":"Site-relative path to render (defaults to '/').","schema":{"type":"string","default":"/"}}],"responses":{"200":{"description":"Markdown representation of the requested page","content":{"text/markdown":{"schema":{"type":"string"}}}},"400":{"description":"Invalid path parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/mcp":{"get":{"operationId":"getMcpMetadata","summary":"Get MCP server metadata","description":"Returns MCP server capabilities and available tool definitions for Streamable HTTP clients.","responses":{"200":{"description":"MCP server metadata","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"protocolVersion":{"type":"string"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpToolSummary"}}},"required":["name","version","protocolVersion","tools"]}}}}}},"post":{"operationId":"invokeMcpJsonRpc","summary":"Invoke MCP JSON-RPC 2.0 endpoint","description":"Executes JSON-RPC 2.0 MCP methods such as initialize, tools/list, and tools/call (get_plumbing_services, check_business_status, request_plumbing_quote).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"],"description":"JSON-RPC version"},"id":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"description":"Request identifier"},"method":{"type":"string","description":"MCP method name (e.g. initialize, tools/list, tools/call)"},"params":{"type":"object","additionalProperties":true,"description":"Optional method parameters"}},"required":["jsonrpc","method"]}}}},"responses":{"200":{"description":"JSON-RPC 2.0 response payload","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"null"}]},"result":{"type":"object","additionalProperties":true},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}},"required":["jsonrpc"]}}}},"400":{"description":"Malformed JSON-RPC payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/.well-known/mcp/server-card.json":{"get":{"operationId":"getMcpServerCard","summary":"Get SEP-1649 MCP Server Card","description":"Returns the public MCP Server Card describing endpoint, transport, and tools.","responses":{"200":{"description":"MCP Server Card JSON","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"protocolVersion":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"transport":{"type":"object","properties":{"type":{"type":"string"},"endpoint":{"type":"string","format":"uri"}}}},"required":["version","protocolVersion","name","transport"]}}}}}}},"/api/membership/plans":{"get":{"operationId":"listMembershipPlans","summary":"List plumbing maintenance membership plans","description":"Returns residential and enterprise plumbing maintenance plans (igualas) and optional service extensions.","responses":{"200":{"description":"List of membership plans and extensions","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"tier":{"type":"string"},"maxRequestsPerPeriod":{"type":"integer"},"showPricePublicly":{"type":"boolean"},"monthlyPriceDisplay":{"type":["string","null"]}},"required":["slug","name","tier"]}}},"required":["ok","plans"]}}}},"500":{"description":"Database or server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/leads":{"post":{"operationId":"createServiceLead","summary":"Submit a plumbing service or quote request","description":"Creates a service request lead in Santiago de los Caballeros for leak detection, unclogging, CCTV inspection, or general plumbing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80,"description":"Customer full name"},"phone":{"type":"string","minLength":7,"maxLength":25,"description":"Contact phone number"},"email":{"type":"string","format":"email","description":"Optional email address"},"sector":{"type":"string","maxLength":120,"description":"Neighborhood or sector in Santiago"},"city":{"type":"string","maxLength":120,"description":"City name"},"problemType":{"type":"string","maxLength":120,"description":"Service category"},"description":{"type":"string","maxLength":2000,"description":"Details of the plumbing issue"}},"required":["name","phone"]}}}},"responses":{"201":{"description":"Lead created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"leadId":{"type":"string"}},"required":["ok"]}}}},"400":{"description":"Malformed JSON request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"type":"object","description":"Structured JSON error payload","properties":{"ok":{"type":"boolean","enum":[false]},"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string"},"error":{"type":"string"},"detail":{"type":"string"},"resolution":{"type":"string"}}},"McpToolSummary":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"inputSchema":{"type":"object","additionalProperties":true}},"required":["name","description","inputSchema"]}}}}