Search Documentation
Search across documentation files by content, metadata, or both.
Instructions
- •
Parse the search query:
- •
$ARGUMENTScontains the search query and optional filters - •Extract: query text, --tag filters, --category filter
- •
- •
Search strategy:
Content Search
Use Grep to find matches in documentation content:
code
Search for: "$query" In: docs/**/*.md, example/**/*.md
Metadata Search
For tag/category filters, read frontmatter from matching files:
- •If
--tagspecified: filter files where tags array contains the tag - •If
--categoryspecified: filter files where category matches
- •
Rank results by relevance:
- •Title match: highest
- •H2/H3 header match: high
- •Content match: medium
- •Tag match: medium
- •
Present results:
markdown
## Search Results for "authentication" ### Exact Matches (3) 1. **Authentication Guide** `docs/guides/security/authentication.md` Category: Security | Tags: security, auth, api > "Learn how to implement authentication for the MCP server..." 2. **API Authentication** `example/api/authentication.md` Category: API | Tags: api, auth > "All API requests require authentication using..." ### Related (2) 3. **Getting Started** `docs/guides/getting-started.md` Category: Guides | Tags: beginner, setup > "...configure authentication in the setup process..." --- Found 5 results in 0.2s
Search Filters
| Filter | Usage | Example |
|---|---|---|
--tag | Filter by tag | --tag security |
--category | Filter by category | --category API |
--title | Search titles only | --title |
Example Queries
code
/doc-search authentication # Find docs about auth /doc-search --tag security # All security-tagged docs /doc-search config --category Guides # Config docs in Guides /doc-search "error handling" --tag api # API error handling docs
Output Fields
For each result, show:
- •Title: From frontmatter
- •Path: Relative file path
- •Category: From frontmatter
- •Tags: From frontmatter
- •Snippet: Matching content with context (50 chars each side)