MCP server for LangSearch Web Search & Semantic Rerank API. Use with Claude Code, Claude Desktop, or any MCP-compatible client.
Two tools with complete input schemas and detailed descriptions. Both tools have proper parameter typing, enums, and constraints. Descriptions are comprehensive (200+ chars) and include error handling guidance. Tool names follow verb_noun pattern (langsearch_web_search, langsearch_semantic_rerank). Output schemas are documented in code (formatSearchMarkdown/Json, formatRerankMarkdown/Json). Main gaps: no output schema formally declared in tool registration; no tool annotations (readOnlyHint/destructiveHint); error handling is server-side only, not surfaced to LLM via structured error responses.
Rerank documents by semantic relevance using LangSearch neural reranker. Args: - query: query to rank against - documents: array of document texts (1-100) - top_n: return top N results (optional) - response_format: markdown or json Examples: - Rerank search results for "transformer attention mechanisms" - RAG pipeline document triage Error Handling: - 401/403: Invalid API key - 429: Rate limit - 400: Invalid model or document count
Search the web using LangSearch API. Returns titles, URLs, snippets, and optional summaries. Supports freshness filters and configurable result counts. Args: - query: search query (1-500 chars) - count: results 1-10 (default 10) - freshness: oneDay|oneWeek|oneMonth|oneYear|noLimit - summary: include text summaries - response_format: markdown or json Examples: - "latest AI regulation news" → freshness="oneWeek" - "Claude Code documentation" → default settings Error Handling: - 401/403: Invalid API key - 429: Rate limit - 400: Invalid parameters
Output schemas not formally declared in tool registration. Formatters (formatSearchMarkdown, formatSearchJson, formatRerankMarkdown, formatRerankJson) exist in code but are not exposed as part of the tool definition. LLMs cannot see what fields to expect in responses.
Tool annotations missing. Neither tool declares readOnlyHint (both are read-only), destructiveHint, or idempotentHint. This prevents clients from optimizing caching, retry logic, and safety checks.
Error handling is server-side only. handleApiError() function returns user-friendly messages but these are not structured or categorized (retryable vs user-fixable vs fatal). LLMs receive plain text errors without recovery guidance.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 63 | 2025-06-18+ | v2 |
No pagination support. langsearch_web_search returns up to 10 results (hardcoded max). If API supports more, no cursor/offset mechanism exists. langsearch_semantic_rerank accepts up to 100 documents but no batching guidance.
API key exposed via environment variable without validation. If LANGSEARCH_API_KEY is missing, process exits with error message but no guidance on where to obtain a key or how to set it.