# Documentation Search

> Full-text search across all Lexsis storefront documentation

Canonical URL: https://fa7e86e3d553:3005/tools/docs-search

> **MCP v3 routing:** The operation names on this page are retained as action-contract references. Do not call them as top-level tools. Pass the former name to `lexsis_discover`, then call the returned router and action with the documented parameters inside `args`.

Search the complete Lexsis storefront documentation including island references, tool guides, recipes, page schema, and troubleshooting tips.

---

## search_docs

Search Lexsis storefront documentation and return relevant passages. Use this mid-generation to look up island properties, find workflow instructions, discover recipes for complex patterns, or troubleshoot rendering issues.

### Parameters

| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query (natural language or keyword) |
| `category` | `"islands"` \| `"tools"` \| `"recipes"` \| `"pages"` \| `"troubleshooting"` \| `"getting-started"` \| `"resources"` | No | Filter by documentation category |
| `limit` | number (1-10) | No | Max results to return (default: 5) |

### Returns

```typescript
{
  query: string                  // The search query
  total_matches: number          // Total matching documents
  results: Array<{
    title: string                // Document title
    section: string              // Section name within document
    category: string             // Documentation category
    path: string                 // Document file path
    content: string              // Relevant excerpt (markdown)
    relevance: number            // Relevance score (0-1)
  }>
}
```

### Example

**Island property lookup:**
```json
{
  "name": "search_docs",
  "arguments": {
    "query": "BuyBox variant swatches",
    "category": "islands",
    "limit": 3
  }
}
```

**Response:**
```json
{
  "query": "BuyBox variant swatches",
  "total_matches": 12,
  "results": [
    {
      "title": "BuyBox Island",
      "section": "Variant Selection",
      "category": "islands",
      "path": "/docs/islands/buy-box",
      "content": "**variant_style**: `\"swatches\"` | `\"dropdown\"` | `\"buttons\"`\n\nControls how product variants are displayed. Swatches show color/image chips, dropdowns use native select elements, buttons show text labels.",
      "relevance": 0.92
    },
    {
      "title": "BuyBox Island",
      "section": "Configuration Examples",
      "category": "islands",
      "path": "/docs/islands/buy-box",
      "content": "```json\n{\n  \"variant_style\": \"swatches\",\n  \"swatch_size\": \"lg\",\n  \"show_variant_labels\": true\n}\n```",
      "relevance": 0.87
    }
  ]
}
```

**Workflow search:**
```json
{
  "name": "search_docs",
  "arguments": {
    "query": "how to publish page",
    "limit": 5
  }
}
```

**Response:**
```json
{
  "query": "how to publish page",
  "total_matches": 8,
  "results": [
    {
      "title": "Page Management",
      "section": "create_page_from_source",
      "category": "tools",
      "path": "/docs/tools/page-management",
      "content": "Compile and persist source-format HTML as a page. Creates the blueprint, page, and version.\n\n**Always call `compile_page_source` first** to catch errors before saving.",
      "relevance": 0.95
    },
    {
      "title": "Getting Started",
      "section": "Your First Page",
      "category": "getting-started",
      "path": "/docs/getting-started",
      "content": "1. Call `compile_page_source` with source HTML and head settings\n2. Call `create_page_from_source` with the same source, slug, and publish: false\n3. Use the returned `preview_url`",
      "relevance": 0.89
    }
  ]
}
```

**Feature-specific search:**
```json
{
  "name": "search_docs",
  "arguments": {
    "query": "countdown timer animation",
    "category": "islands"
  }
}
```

**Response:**
```json
{
  "query": "countdown timer animation",
  "total_matches": 5,
  "results": [
    {
      "title": "CountdownTimer Island",
      "section": "Animation Settings",
      "category": "islands",
      "path": "/docs/islands/countdown-timer",
      "content": "**animation**: `\"flip\"` | `\"slide\"` | `\"fade\"` | `\"none\"`\n\nControls the digit transition effect when the timer updates. Flip creates a mechanical flip-card effect, slide transitions vertically, fade cross-fades digits.",
      "relevance": 0.91
    }
  ]
}
```

**Recipe search:**
```json
{
  "name": "search_docs",
  "arguments": {
    "query": "split hero with product image",
    "category": "recipes"
  }
}
```

**Response:**
```json
{
  "query": "split hero with product image",
  "total_matches": 3,
  "results": [
    {
      "title": "Hero Layouts",
      "section": "Split Hero with Product Focus",
      "category": "recipes",
      "path": "/docs/recipes/hero-layouts",
      "content": "Use `lx_hero_split` with `media_position: \"right\"` and `media_type: \"product\"`. Pair with `ProductMedia` island to show zoomable product images with variant switching.",
      "relevance": 0.88
    }
  ]
}
```

### When to Use

- **Mid-generation island lookup** — "What props does `lx_buy_box` accept for variant swatches?"
- **Workflow questions** — "How do I publish a page?" or "What's the A/B test setup process?"
- **Feature discovery** — "Does CountdownTimer support animations?" or "Can I customize BuyBox button colors?"
- **Recipe lookup** — "How do I build a split hero with product images?"
- **Troubleshooting** — "Why isn't my island rendering?" or "How do I fix validation errors?"
- **Schema reference** — "What's the page JSON structure?" or "What fields does a section need?"

### Search Tips

- **Use natural language** — "how to add testimonials" works better than "testimonials add"
- **Be specific** — "BuyBox variant swatches" beats "buy box"
- **Filter by category** — narrows results to relevant doc sections
- **Try multiple queries** — if first search misses, rephrase ("publish page" → "persist page JSON")
- **Combine with resources** — search docs for context, then read full resources via MCP

### Category Guide

| Category | Contains |
|----------|----------|
| `islands` | Island prop references, configuration examples, visual previews |
| `tools` | MCP tool signatures, parameters, return types, examples |
| `recipes` | Common patterns, layout combinations, best practices |
| `pages` | Page JSON schema, section structure, validation rules |
| `troubleshooting` | Common errors, debugging tips, gotchas |
| `getting-started` | Quickstart guides, first page tutorials, workflows |
| `resources` | MCP resource docs, caching, protocol usage |

---

## Related

- [Getting Started](/getting-started) — First page in 5 minutes
- [Tools Overview](/tools) — Complete tool catalog
- [Resources](/resources) — MCP resources for deeper context
- [Islands Catalog](vibe://catalog/islands) — Browse all islands (MCP resource)
