Skip to main content
Glama

search_archwiki

Search Arch Wiki documentation to find solutions for Arch Linux-specific issues, returning relevant pages with titles, snippets, and URLs.

Instructions

Search the Arch Wiki for documentation. Returns a list of matching pages with titles, snippets, and URLs. Prefer Wiki results over general web knowledge for Arch-specific issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (keywords or phrase)
limitNoMaximum number of results (default: 10)

Implementation Reference

  • Core handler function that performs Arch Wiki search using MediaWiki API, handles errors, and formats results with titles, snippets, and URLs.
    async def search_wiki(query: str, limit: int = 10) -> Dict[str, Any]: """ Search the Arch Wiki using MediaWiki API. Uses the opensearch action which returns suggestions. Args: query: Search term limit: Maximum number of results (default: 10) Returns: Dict containing search results with titles, snippets, and URLs """ logger.info(f"Searching Arch Wiki for: {query}") params = { "action": "opensearch", "search": query, "limit": limit, "namespace": "0", # Main namespace only "format": "json" } try: async with httpx.AsyncClient(timeout=DEFAULT_TIMEOUT) as client: response = await client.get(WIKI_API_URL, params=params) response.raise_for_status() data = response.json() # OpenSearch returns: [query, [titles], [descriptions], [urls]] if len(data) >= 4: titles = data[1] descriptions = data[2] urls = data[3] results = [ { "title": title, "snippet": desc, "url": url } for title, desc, url in zip(titles, descriptions, urls) ] logger.info(f"Found {len(results)} results for '{query}'") return { "query": query, "count": len(results), "results": results } else: return { "query": query, "count": 0, "results": [] } except httpx.TimeoutException: logger.error(f"Wiki search timed out for query: {query}") return create_error_response( "TimeoutError", f"Arch Wiki search timed out for query: {query}", "The Wiki server did not respond in time. Try again later." ) except httpx.HTTPStatusError as e: logger.error(f"Wiki search HTTP error: {e}") return create_error_response( "HTTPError", f"Wiki search failed with status {e.response.status_code}", str(e) ) except Exception as e: logger.error(f"Wiki search failed: {e}") return create_error_response( "SearchError", f"Failed to search Arch Wiki: {str(e)}" )
  • MCP tool registration in list_tools(), defining the tool name, description, and input schema for search_archwiki.
    Tool( name="search_archwiki", description="[DISCOVERY] Search the Arch Wiki for documentation. Returns a list of matching pages with titles, snippets, and URLs. Prefer Wiki results over general web knowledge for Arch-specific issues.", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Search query (keywords or phrase)" }, "limit": { "type": "integer", "description": "Maximum number of results (default: 10)", "default": 10 } }, "required": ["query"] } ),
  • Dispatch handler in the central call_tool function that extracts arguments and calls the search_wiki implementation for search_archwiki tool invocations.
    if name == "search_archwiki": query = arguments["query"] limit = arguments.get("limit", 10) results = await search_wiki(query, limit) return [TextContent(type="text", text=json.dumps(results, indent=2))]
  • Tool metadata definition including category, platform, permissions, workflow, and related tools for search_archwiki.
    "search_archwiki": ToolMetadata( name="search_archwiki", category="discovery", platform="any", permission="read", workflow="research", related_tools=["search_aur", "get_official_package_info"], prerequisite_tools=[] ),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nihalxkumar/arch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server