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)
        )]
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates that this is a destructive operation ('Removes all'), specifies what gets cleared ('converted markdown files and extracted images'), and implies it affects disk space. It lacks details on permissions, rate limits, or confirmation prompts, but covers core behavioral traits adequately for a zero-parameter tool.

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?

The description is front-loaded with the core action in the first sentence, followed by elaboration and usage context. Each sentence adds value: the first defines the tool, the second details what is removed, and the third provides usage scenarios. There is no wasted text, making it highly efficient.

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?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is nearly complete. It explains what the tool does, what it affects, and when to use it. The only minor gap is the lack of information on potential side effects, such as whether clearing the cache impacts ongoing conversions or requires specific permissions.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose and effects. A baseline of 4 is applied as it avoids unnecessary parameter details.

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 all cached conversions') and resource ('converted markdown files and extracted images from the cache'), distinguishing it from sibling tools like list_conversions or read_converted_markdown which involve reading rather than clearing. The verb 'removes' reinforces the destructive nature of the operation.

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 explicit guidance on when to use this tool ('to free up disk space or reset the conversion cache'), giving practical context. However, it does not specify when NOT to use it or mention alternatives, such as whether partial cache clearing is possible through other tools.

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

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