Skip to main content
Glama

clear_cache

Clear cached Office document conversions to free disk space or reset the cache for OfficeReader-MCP server.

Instructions

Clear all cached conversions.

Removes all converted markdown files and extracted images from the cache. Use this to free up disk space or reset the conversion cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of clear_cache in DocxConverter: removes all cached conversion directories using shutil.rmtree and returns count of cleared items.
    def clear_cache(self) -> dict: """Clear all cached conversions.""" import shutil cleared = [] for item in self.output_dir.iterdir(): if item.is_dir(): shutil.rmtree(item) cleared.append(str(item)) return { "cleared": cleared, "count": len(cleared), }
  • OfficeConverter.clear_cache delegates to the DocxConverter instance's clear_cache method.
    def clear_cache(self) -> dict: """Clear all cached conversions.""" return self._docx_converter.clear_cache()
  • MCP tool registration for 'clear_cache' with description and empty inputSchema (no parameters required).
    Tool( name="clear_cache", description="""Clear all cached conversions. Removes all converted markdown files and extracted images from the cache. Use this to free up disk space or reset the conversion cache.""", inputSchema={ "type": "object", "properties": {}, }, ),
  • Top-level handler dispatch in call_tool: invokes converter.clear_cache() and constructs the TextContent response with success details.
    elif name == "clear_cache": result = converter.clear_cache() response = { "status": "success", "cache_location": str(converter.cache_dir), "cleared_count": result["count"], "cleared_directories": result["cleared"], } return [TextContent( type="text", text=f"{cache_notice}\n\nCache cleared successfully!\n\n" + json.dumps(response, ensure_ascii=False, indent=2) )]

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/Asunainlove/OfficeReader-MCP'

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