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()
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the tool's write/mutation behavior ('clear') and the expected return type ('status message'), but doesn't mention potential side effects, permissions needed, or whether the operation is reversible/destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two brief, focused sentences with zero waste. First sentence states purpose and rationale, second describes return value. Perfectly front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter mutation tool with no annotations or output schema, the description provides adequate context about what the tool does and what it returns. However, it could better address behavioral aspects like whether this affects all users or just the caller's cache.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't waste space discussing nonexistent parameters, focusing instead on the tool's purpose and return value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('clear') and target resource ('documentation cache'), with explicit purpose ('to force fresh fetches'). It distinguishes from sibling tools like 'get_cache_stats' which only reads cache data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('to force fresh fetches'), but doesn't explicitly state when NOT to use it or name specific alternatives. The purpose implies it should be used when cached documentation is stale or needs refreshing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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