openapi: 3.1.0
info:
  title: Kashmir Tour Packages Taxi — API Catalogue
  version: 1.1.0
  description: |
    Every machine-readable interface exposed by kashmirtourpackagestaxi.com:
    the Kashmir MCP Server (AI-assistant interface), the WordPress REST API
    (content), and contact deep links. All prices INR, all-inclusive.
    Operator: Kashmir Tour Packages Taxi, Jamia Masjid Nowhatta, Srinagar.
  contact:
    name: Kashmir Tour Packages Taxi
    email: info@kashmirtourpackagestaxi.com
    url: https://www.kashmirtourpackagestaxi.com/
  termsOfService: https://www.kashmirtourpackagestaxi.com/terms-conditions/

servers:
  - url: https://www.kashmirtourpackagestaxi.com
    description: Production (WordPress)

tags:
  - name: MCP
    description: Model Context Protocol server for AI assistants (Claude, agents)
  - name: Content
    description: WordPress REST API — posts, pages, tour packages (WP Travel Engine)
  - name: Contact
    description: Booking & contact deep links (WhatsApp, phone, email)

paths:

  /wp-json/kashmir-mcp/v1/mcp:
    post:
      tags: [MCP]
      operationId: mcpJsonRpc
      summary: MCP endpoint (JSON-RPC 2.0, Streamable HTTP)
      description: |
        Single endpoint for all MCP traffic. Send JSON-RPC 2.0 messages:
        `initialize`, `ping`, `tools/list`, `tools/call`.
        Tools available: get_business_info, list_taxi_fleet, get_route_info,
        search_tour_packages, get_package_details, search_travel_guides,
        create_booking_enquiry.
        No authentication. Enquiry creation is rate-limited to 5/hour/IP.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
            examples:
              listTools:
                summary: List available tools
                value: { jsonrpc: "2.0", id: 1, method: "tools/list" }
              quoteFleet:
                summary: Fleet for 8 people under ₹7,000/day
                value:
                  jsonrpc: "2.0"
                  id: 2
                  method: tools/call
                  params:
                    name: list_taxi_fleet
                    arguments: { min_seats: 8, max_rate_per_day: 7000 }
              enquiry:
                summary: Send a booking enquiry
                value:
                  jsonrpc: "2.0"
                  id: 3
                  method: tools/call
                  params:
                    name: create_booking_enquiry
                    arguments:
                      name: "Priya Sharma"
                      contact: "+91 98xxxxxx01"
                      message: "Innova Crysta for 5 days, Srinagar-Gulmarg-Pahalgam"
                      travel_dates: "12–17 Oct 2026"
                      party_size: 4
      responses:
        '200':
          description: JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
        '202':
          description: Notification accepted (no body)

  /wp-json/kashmir-mcp/v1/card:
    get:
      tags: [MCP]
      operationId: mcpServerCard
      summary: MCP server card (also at /.well-known/mcp.json)
      description: Discovery manifest — name, description, transport URL, tool list, publisher. Submit this URL to MCP directories.
      responses:
        '200':
          description: Server card
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerCard'

  /wp-json/wp/v2/pages:
    get:
      tags: [Content]
      operationId: listPages
      summary: List pages — tour packages and taxi service pages
      description: |
        Tour packages are WordPress PAGES under the hubs
        `/tour-packages/` and `/kashmir-tour-packages/` (incl.
        `honeymoon-tours`); taxi vehicle pages live under
        `/taxi-service-kashmir/`. Use `search` to find them, or prefer the
        MCP tool `search_tour_packages`, which filters to package pages
        server-side and parses price/duration for you.
      parameters:
        - { name: search,   in: query, schema: { type: string },  description: Keyword search, e.g. "honeymoon" or "Innova" }
        - { name: per_page, in: query, schema: { type: integer, maximum: 100, default: 10 } }
        - { name: page,     in: query, schema: { type: integer, default: 1 } }
      responses:
        '200':
          description: Array of page objects (WordPress schema)

  /wp-json/wp/v2/posts:
    get:
      tags: [Content]
      operationId: listPosts
      summary: List blog posts (Things To Do guides, taxi guides)
      parameters:
        - { name: search,     in: query, schema: { type: string } }
        - { name: categories, in: query, schema: { type: string }, description: Category ID(s), comma-separated }
        - { name: per_page,   in: query, schema: { type: integer, maximum: 100, default: 10 } }
      responses:
        '200':
          description: Array of post objects

  /wp-json/wp/v2/search:
    get:
      tags: [Content]
      operationId: siteSearch
      summary: Cross-content search
      parameters:
        - { name: search, in: query, required: true, schema: { type: string } }
      responses:
        '200':
          description: Search results

components:
  schemas:

    JsonRpcRequest:
      type: object
      required: [jsonrpc, method]
      properties:
        jsonrpc: { type: string, const: "2.0" }
        id:      { description: Omit for notifications }
        method:  { type: string, enum: [initialize, ping, tools/list, tools/call] }
        params:
          type: object
          properties:
            name:      { type: string, description: Tool name (tools/call) }
            arguments: { type: object, description: Tool arguments (tools/call) }

    JsonRpcResponse:
      type: object
      properties:
        jsonrpc: { type: string, const: "2.0" }
        id: {}
        result: { type: object }
        error:
          type: object
          properties:
            code:    { type: integer }
            message: { type: string }

    ServerCard:
      type: object
      properties:
        name:         { type: string, example: kashmir-tour-packages-taxi }
        display_name: { type: string }
        description:  { type: string }
        protocol:     { type: string, example: "2025-06-18" }
        transport:
          type: object
          properties:
            type: { type: string, example: streamable-http }
            url:  { type: string, format: uri }
        tools_summary:
          type: array
          items: { type: string }
        publisher:
          type: object
          properties:
            name:    { type: string }
            website: { type: string, format: uri }
            contact: { type: string }

    ContactChannels:
      description: Deep links (documented here; not HTTP APIs)
      type: object
      properties:
        whatsapp:      { type: string, example: "https://wa.me/919149531004?text={url-encoded message}" }
        phone:         { type: string, example: "tel:+919149531004" }
        email:         { type: string, example: "mailto:info@kashmirtourpackagestaxi.com" }
        instagram:     { type: string, example: "https://www.instagram.com/kashmirtourpackagestaxi/" }
