Skip to main content
Glama
notasandy

MCP Code Sanitizer

cache_info

View cache statistics or clear the cache. Returns JSON with stats or clear result.

Instructions

Shows cache statistics or clears the cache Args: clear: True - clears the cache, False - shows statistics.

Returns: JSON with cache stats or clear result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async function that implements the cache_info tool logic. Accepts a 'clear' boolean parameter. If clear=True, clears the cache and returns removed_entries count. Otherwise returns cache stats as JSON.
    async def cache_info(clear: bool = False) -> str:
    
        """
        Shows cache statistics or clears the cache
        Args:
            clear: True - clears the cache, False - shows statistics.
    
        Returns:
            JSON with cache stats or clear result.
    
        """
        if clear:
            removed = cache.clear()
            return json.dumps({"cleared": True, "removed_entries": removed}, ensure_ascii=True, indent=2)
        return json.dumps(cache.stats(), ensure_ascii=True, indent=2)
  • The function signature defines the input schema: a single optional boolean parameter 'clear' (default False). Return type is str (JSON).
    async def cache_info(clear: bool = False) -> str:
    
        """
        Shows cache statistics or clears the cache
        Args:
            clear: True - clears the cache, False - shows statistics.
    
        Returns:
            JSON with cache stats or clear result.
    
        """
        if clear:
            removed = cache.clear()
            return json.dumps({"cleared": True, "removed_entries": removed}, ensure_ascii=True, indent=2)
        return json.dumps(cache.stats(), ensure_ascii=True, indent=2)
  • cache_info is re-exported from tools package via tools/__init__.py on line 6.
    from .cache_tool import cache_info
Behavior4/5

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

The description discloses both behaviors (show stats or clear cache) and the return format. Without annotations, it effectively communicates the tool's two modes and the parameter's role.

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?

Extremely concise: two sentences clearly stating purpose, parameter explanation, and return value. No wasted words.

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?

The description covers the tool's main actions and return, but could benefit from mentioning any side effects of clearing the cache or requirements like authentication. However, given the output schema exists, it is largely sufficient.

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

Parameters5/5

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

The description explains the sole parameter 'clear' with explicit meanings for true and false, adding complete semantic value beyond the schema's minimal type definition (0% coverage).

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 tool shows cache statistics or clears the cache, with specific verb and resource. It is distinct from sibling tools which focus on code analysis and report generation.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. While siblings are unrelated, the description does not provide any context for when to choose one behavior over the other or any prerequisites.

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/notasandy/mcp-code-sanitizer'

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