{
  "openapi": "3.1.0",
  "info": {
    "title": "The Canine Coach MCP API",
    "version": "0.1.0",
    "description": "JSON-RPC 2.0 over Streamable HTTP. All calls go to a single endpoint, POST /mcp, and are authenticated with an OAuth 2.1 bearer token issued through this site. Use `tools/list` to discover tools and `tools/call` to invoke one; per-tool argument and result schemas are in the components section and at /api/public/mcp/schema.json."
  },
  "servers": [
    {
      "url": "https://thecaninecoachnm.com"
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "Call an MCP method (initialize, tools/list, tools/call)",
        "security": [
          {
            "oauth2": []
          }
        ],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json, text/event-stream"
            },
            "description": "Required by the MCP Streamable HTTP transport."
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Session id returned by `initialize`, echoed on subsequent calls."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "examples": {
                "list_services": {
                  "summary": "List training programs",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "list_services",
                      "arguments": {}
                    }
                  }
                },
                "get_service": {
                  "summary": "Get a training program",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "get_service",
                      "arguments": {
                        "slug": "puppy-training"
                      }
                    }
                  }
                },
                "search_faq": {
                  "summary": "Search the FAQ",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "search_faq",
                      "arguments": {
                        "query": "cost"
                      }
                    }
                  }
                },
                "get_contact_info": {
                  "summary": "Get contact details",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tools/call",
                    "params": {
                      "name": "get_contact_info",
                      "arguments": {}
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result (as JSON, or as an SSE stream when negotiated).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token. The WWW-Authenticate header points at /.well-known/oauth-protected-resource."
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "protectedResourceMetadata",
        "summary": "OAuth 2.1 protected resource metadata (RFC 9728)",
        "responses": {
          "200": {
            "description": "Resource metadata document."
          }
        }
      }
    },
    "/api/public/mcp/schema.json": {
      "get": {
        "operationId": "toolSchemas",
        "summary": "JSON Schema for every MCP tool's input and output",
        "responses": {
          "200": {
            "description": "Tool contract document."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 with dynamic client registration and PKCE. Discover endpoints from /.well-known/oauth-protected-resource.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://thecaninecoachnm.com/.lovable/oauth/consent",
            "tokenUrl": "https://<project-ref>.supabase.co/auth/v1/token",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "number"
            ]
          },
          "method": {
            "type": "string",
            "examples": [
              "initialize",
              "tools/list",
              "tools/call"
            ]
          },
          "params": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "list_services",
                  "get_service",
                  "search_faq",
                  "get_contact_info"
                ]
              },
              "arguments": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/list_services_arguments"
                  },
                  {
                    "$ref": "#/components/schemas/get_service_arguments"
                  },
                  {
                    "$ref": "#/components/schemas/search_faq_arguments"
                  },
                  {
                    "$ref": "#/components/schemas/get_contact_info_arguments"
                  }
                ]
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "result": {
            "type": "object",
            "properties": {
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "text"
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "text"
                  ]
                }
              },
              "structuredContent": {
                "type": "object"
              },
              "isError": {
                "type": "boolean"
              }
            },
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {}
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "additionalProperties": false
      },
      "list_services_arguments": {
        "title": "list_services arguments",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "list_services_result": {
        "title": "list_services structuredContent",
        "type": "object",
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A Canine Coach training program.",
              "properties": {
                "slug": {
                  "type": "string",
                  "enum": [
                    "puppy-training",
                    "obedience-training",
                    "behavior-modification",
                    "off-leash-training",
                    "in-home-training",
                    "dog-nanny"
                  ],
                  "description": "Stable identifier for the program."
                },
                "name": {
                  "type": "string",
                  "description": "Display name of the program."
                },
                "path": {
                  "type": "string",
                  "description": "Path to the program page on the website."
                },
                "summary": {
                  "type": "string",
                  "description": "What the program covers."
                },
                "bestFor": {
                  "type": "string",
                  "description": "The dogs and families the program suits best."
                }
              },
              "required": [
                "slug",
                "name",
                "path",
                "summary",
                "bestFor"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "services"
        ],
        "additionalProperties": false
      },
      "get_service_arguments": {
        "title": "get_service arguments",
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "puppy-training",
              "obedience-training",
              "behavior-modification",
              "off-leash-training",
              "in-home-training",
              "dog-nanny"
            ],
            "description": "Program slug. One of: puppy-training, obedience-training, behavior-modification, off-leash-training, in-home-training, dog-nanny"
          }
        },
        "required": [
          "slug"
        ],
        "additionalProperties": false
      },
      "get_service_result": {
        "title": "get_service structuredContent",
        "type": "object",
        "properties": {
          "service": {
            "type": "object",
            "description": "A Canine Coach training program.",
            "properties": {
              "slug": {
                "type": "string",
                "enum": [
                  "puppy-training",
                  "obedience-training",
                  "behavior-modification",
                  "off-leash-training",
                  "in-home-training",
                  "dog-nanny"
                ],
                "description": "Stable identifier for the program."
              },
              "name": {
                "type": "string",
                "description": "Display name of the program."
              },
              "path": {
                "type": "string",
                "description": "Path to the program page on the website."
              },
              "summary": {
                "type": "string",
                "description": "What the program covers."
              },
              "bestFor": {
                "type": "string",
                "description": "The dogs and families the program suits best."
              }
            },
            "required": [
              "slug",
              "name",
              "path",
              "summary",
              "bestFor"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "service"
        ],
        "additionalProperties": false
      },
      "search_faq_arguments": {
        "title": "search_faq arguments",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Optional keyword to filter questions and answers."
          }
        },
        "additionalProperties": false
      },
      "search_faq_result": {
        "title": "search_faq structuredContent",
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A frequently asked question and its answer.",
              "properties": {
                "question": {
                  "type": "string"
                },
                "answer": {
                  "type": "string"
                }
              },
              "required": [
                "question",
                "answer"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "results"
        ],
        "additionalProperties": false
      },
      "get_contact_info_arguments": {
        "title": "get_contact_info arguments",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "get_contact_info_result": {
        "title": "get_contact_info structuredContent",
        "type": "object",
        "properties": {
          "contact": {
            "type": "object",
            "description": "Contact details, service area, and booking information.",
            "additionalProperties": true
          }
        },
        "required": [
          "contact"
        ],
        "additionalProperties": false
      }
    }
  }
}