Search Tool
Thesearch tool enables AI assistants to query WebHelp documentation sites efficiently. It automatically chooses between semantic search (when available) and index-based search to deliver the most relevant results.
How It Works
When you invoke the search tool, the server:- Attempts semantic search first (for single-site queries)
- Falls back to index-based search if semantic search is unavailable
- Returns up to 10 results sorted by relevance score
- Provides document IDs that can be used with the fetch tool
For federated search across multiple sites, see Federated Search.
Search Strategies
The WebHelp MCP Server uses two complementary search approaches:Semantic Search
For single-site queries, the server first attempts semantic search using Oxygen Feedback’s AI-powered search service. This provides natural language understanding and ranks results by semantic relevance.- Extracts the deployment token from the WebHelp site
- Queries the Oxygen Feedback API at
feedback.oxygenxml.com - Returns results with relevance scores
- Falls back gracefully if unavailable
Index-Based Search
When semantic search isn’t available or for multi-site queries, the server uses the WebHelp search index directly:- Downloads the WebHelp search index files (
index-1.js,index-2.js, etc.) - Loads stopwords and file metadata
- Executes the WebHelp search engine (
nwSearchFnt.js) - Supports boolean operators (AND, OR)
Usage Example
Here’s how the search tool is defined in the MCP server:Parameters
Search query string. Supports boolean operators like
AND and OR for index-based search.Return Value
The search tool returns a JSON array of results:Result Fields
- title — The document title extracted from the search index
- id — Composite identifier in format
index:path(used for fetching) - url — Full URL to the document
Real-World Examples
Searching DITA Documentation
Searching Oxygen XML Documentation
Query Tips
Use Specific Terms
“DITA map validation” works better than “checking maps”
Boolean Operators
“publishing AND PDF” to require both terms (index search only)
Natural Language
“How do I publish output?” works well with semantic search
Short Queries
2-5 word queries typically yield better results
Error Handling
The search tool handles various error scenarios:Index Load Failure
Search Engine Error
Search errors usually indicate malformed or incomplete search indexes. Try fetching the index files directly to diagnose.
Performance Considerations
Index Loading
The first search request for a site loads the entire search index:nwSearchFnt.js— Search engine codeindex-1.jsthroughindex-N.js— Word indexesstopwords.js— Stop words listhtmlFileInfoList.js— File metadata
Result Limits
The server returns a maximum of 10 results to keep responses fast and manageable:Next Steps
Fetch Documents
Retrieve full content after searching
Federated Search
Search multiple sites simultaneously
Semantic Search
Deep dive into AI-powered search
Integration Guide
Connect to AI tools