Skip to main content
Glama

get_cached_files

Retrieve all cached design files from the Penpot MCP Server to access previously loaded content for analysis and workflow automation.

Instructions

List all files currently stored in the cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_cached_files' tool. It returns the list of all cached files by calling MemoryCache.get_all_cached_files().
    @self.mcp.tool()
    def get_cached_files() -> dict:
        """List all files currently stored in the cache."""
        return self.file_cache.get_all_cached_files()
  • The MemoryCache.get_all_cached_files() helper method that retrieves all non-expired cached Penpot files, cleaning up expired entries.
    def get_all_cached_files(self) -> Dict[str, Dict[str, Any]]:
        """
        Get all valid cached files.
        
        Returns:
            Dictionary mapping file IDs to their cached data
        """
        result = {}
        current_time = time.time()
        
        # Create a list of expired keys to remove
        expired_keys = []
        
        for file_id, cache_data in self._cache.items():
            if current_time - cache_data['timestamp'] <= self.ttl_seconds:
                result[file_id] = cache_data['data']
            else:
                expired_keys.append(file_id)
                
        # Remove expired entries
        for key in expired_keys:
            del self._cache[key]
                    
        return result 
  • The @self.mcp.tool() decorator that registers the get_cached_files function as an MCP tool. This is called conditionally if config.RESOURCES_AS_TOOLS is True.
    @self.mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists files from the cache, implying a read-only operation, but does not specify details like whether the list is paginated, sorted, filtered, or includes metadata. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, clear sentence that directly states the tool's function without unnecessary words. It is front-loaded and efficiently conveys the core purpose, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and no output schema, the description adequately covers the basic purpose. However, it lacks details on behavioral aspects (e.g., output format, caching specifics) and usage guidelines, which are important for an agent to invoke it correctly. The simplicity of the tool means the description is minimally viable but could be more informative.

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 tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description does not need to add parameter semantics, but it correctly implies no inputs are required. A baseline score of 4 is appropriate as it aligns with the lack of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('files currently stored in the cache'), making the purpose unambiguous. However, it does not explicitly differentiate from sibling tools like 'get_file' or 'get_project_files', which might also retrieve files but from different sources or with different scopes.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as 'get_file' (which might retrieve a specific file) or 'get_project_files' (which might list files in a project context). There is no mention of prerequisites, exclusions, or recommended contexts for usage.

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/montevive/penpot-mcp'

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