cwiki_cache_info
Check local Confluence response cache settings and current size to monitor cache usage and performance.
Instructions
Show local Confluence response cache settings and current size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/incubator_cwiki_mcp/tools.py:146-156 (handler)The cwiki_cache_info() function that implements the tool logic. It uses cache helper functions to report cache settings and current size.
def cwiki_cache_info() -> dict[str, Any]: """Show local Confluence response cache settings and current size.""" entries = list(cache.cache_entries()) size_bytes = sum(e.stat().st_size for e in entries if e.exists()) return { "enabled": cache.cache_enabled(), "directory": str(cache.CACHE_DIR), "ttlSeconds": cache.CACHE_TTL_SECONDS, "entries": len(entries), "sizeBytes": size_bytes, } - src/incubator_cwiki_mcp/tools.py:145-145 (registration)The @mcp.tool() decorator registers cwiki_cache_info as a tool on the FastMCP instance.
@mcp.tool() - cache_enabled() helper returns True if TTL > 0.
def cache_enabled() -> bool: return CACHE_TTL_SECONDS > 0 - cache_entries() helper returns list of cached JSON file paths.
def cache_entries() -> list[Path]: if not CACHE_DIR.exists(): return [] return sorted(CACHE_DIR.glob("*.json")) - Cache configuration constants CACHE_TTL_SECONDS and CACHE_DIR used by the tool.
CACHE_TTL_SECONDS = int(os.getenv("CWIKI_CACHE_TTL_SECONDS", "2592000")) CACHE_DIR = Path(os.getenv("CWIKI_CACHE_DIR", ".cache/cwiki")).expanduser()