Skip to main content
Glama
gemini2026

Documentation Search MCP Server

by gemini2026

clear_cache

Clear cached documentation data to ensure fresh, up-to-date information is retrieved from official sources.

Instructions

Clear the documentation cache to force fresh fetches.

Returns:
    Status message about cache clearing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for 'clear_cache'. It clears the SimpleCache instance if caching is enabled and returns a status message with the number of entries cleared.
    @mcp.tool()
    async def clear_cache():
        """
        Clear the documentation cache to force fresh fetches.
    
        Returns:
            Status message about cache clearing
        """
        if cache:
            entries_cleared = await cache.clear()
            return f"Cache cleared. Removed {entries_cleared} cached entries."
        else:
            return "Caching is not enabled."
  • The 'clear' method of the SimpleCache class, invoked by the clear_cache tool handler to remove all cached entries and persist the empty state if persistence is enabled.
    async def clear(self) -> int:
        async with self._lock:
            removed = len(self.cache)
            self.cache.clear()
            await self._persist_locked()
  • The @mcp.tool() decorator registers the clear_cache function as an MCP tool.
    @mcp.tool()

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/gemini2026/documentation-search-mcp'

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