cwiki_clear_cache
Clear cached Confluence wiki responses to force fresh data retrieval and resolve outdated content display issues.
Instructions
Clear the local Confluence response cache.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/incubator_cwiki_mcp/tools.py:159-166 (handler)The `cwiki_clear_cache` tool handler function. It is decorated with @mcp.tool() so it auto-registers. Calls cache.clear_cache() and returns the count of removed entries.
@mcp.tool() def cwiki_clear_cache() -> dict[str, Any]: """Clear the local Confluence response cache.""" removed = cache.clear_cache() return { "directory": str(cache.CACHE_DIR), "removedEntries": removed, } - The `clear_cache()` helper function that iterates over all cache entry files, deletes them, and returns the count of removed files.
def clear_cache() -> int: removed = 0 for entry in cache_entries(): try: entry.unlink() removed += 1 except FileNotFoundError: pass return removed - src/incubator_cwiki_mcp/tools.py:12-12 (registration)The `mcp` FastMCP instance used as the decorator (@mcp.tool()) to register cwiki_clear_cache as an MCP tool.
mcp = FastMCP("apache-incubator-cwiki-mcp") - src/incubator_cwiki_mcp/server.py:5-10 (registration)The MCP server imports and runs the mcp instance (which has cwiki_clear_cache registered via decorator).
from incubator_cwiki_mcp.tools import mcp def main() -> None: try: mcp.run()