skills/docs-search/SKILL.md (3942 bytes)
1 --- 2 name: docs-search 3 description: >- 4 Search and query the Grounded Docs MCP Server documentation index. 5 Covers listing indexed libraries, searching documentation content, 6 and resolving library versions. Use when you need to look up API 7 references, find code examples, or check which documentation is 8 available in the local index. 9 compatibility: Requires the local `docs-mcp` wrapper on PATH 10 metadata: 11 author: grounded.tools 12 --- 13 14 # Docs Search 15 16 Search the local Grounded Docs index for library documentation. These commands 17 return structured data (JSON by default in non-interactive sessions) and never 18 modify the index. 19 20 ## When to use 21 22 - You need to answer a question about a library's API or behaviour. 23 - You want to check which libraries and versions are already indexed. 24 - You need to resolve which documentation version best matches a constraint. 25 26 Always run `list` first if you are unsure whether a library has been indexed. 27 If nothing is indexed yet, use the **docs-manage** skill to scrape documentation 28 before searching. 29 30 ## Commands 31 32 ### list 33 34 List every indexed library and its available versions. 35 36 ```bash 37 docs-mcp list [--output yaml] 38 ``` 39 40 | Flag | Description | 41 |------|-------------| 42 | `--output json\|yaml\|toon` | Structured output format (default: JSON in non-interactive) | 43 | `--server-url <url>` | Connect to a remote pipeline worker instead of the local store | 44 | `--quiet` | Suppress non-error diagnostics | 45 | `--verbose` | Enable debug logging | 46 47 Example output (YAML): 48 49 ```yaml 50 - library: react 51 versions: 52 - "19.0.0" 53 - "18.3.1" 54 - library: typescript 55 versions: 56 - "5.7.0" 57 ``` 58 59 ### search 60 61 Search documents in an indexed library by natural-language query. 62 63 ```bash 64 docs-mcp search <library> "<query>" [options] 65 ``` 66 67 | Flag | Alias | Default | Description | 68 |------|-------|---------|-------------| 69 | `--version <ver>` | `-v` | latest | Version constraint (exact or range, e.g. `18.x`, `5.2.x`) | 70 | `--limit <n>` | `-l` | `5` | Maximum number of results | 71 | `--exact-match` | `-e` | `false` | Only match the exact version, no fallback | 72 | `--embedding-model <model>` | | | Embedding model (e.g. `openai:text-embedding-3-small`) | 73 | `--server-url <url>` | | | Remote pipeline worker URL | 74 | `--output json\|yaml\|toon` | | JSON | Structured output format | 75 | `--quiet` | | | Suppress non-error diagnostics | 76 | `--verbose` | | | Enable debug logging | 77 78 Example: 79 80 ```bash 81 docs-mcp search react "useEffect cleanup" --version 18.x --limit 3 --output yaml 82 ``` 83 84 Each result contains a content snippet, source URL, and relevance score. 85 86 ### find-version 87 88 Resolve the best matching documentation version for a library. 89 90 ```bash 91 docs-mcp find-version <library> [--version <pattern>] 92 ``` 93 94 | Flag | Alias | Description | 95 |------|-------|-------------| 96 | `--version <pattern>` | `-v` | Version pattern to match (supports ranges) | 97 | `--server-url <url>` | | Remote pipeline worker URL | 98 | `--output json\|yaml\|toon` | | Structured output format | 99 | `--quiet` | | Suppress non-error diagnostics | 100 | `--verbose` | | Enable debug logging | 101 102 Example: 103 104 ```bash 105 docs-mcp find-version react --version "18.x" --output yaml 106 ``` 107 108 Returns the resolved version string and library metadata. 109 110 ## Interpreting output 111 112 All three commands emit structured data to **stdout**. Diagnostics and progress 113 messages go to **stderr** and are suppressed by default in non-interactive 114 sessions. Use `--verbose` (or set `LOG_LEVEL=INFO`) to re-enable them. 115 Use `--quiet` to suppress all non-error diagnostics regardless of session type. 116 117 To capture results programmatically, parse stdout as JSON (the default) or 118 request `--output yaml` for a more readable format. 119 120 ## Typical workflow 121 122 ```bash 123 # 1. Check what is indexed 124 docs-mcp list --output yaml 125 126 # 2. Search for relevant docs 127 docs-mcp search react "server components" --version 19.x --output yaml 128 129 # 3. If no results, index the docs first (see docs-manage skill), then retry 130 ```