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()

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