list
Retrieve a list of all compressed items stored in the system, including their keys, sizes, and compression ratios, to track and manage compressed data efficiently.
Instructions
List all stored compressed items with their keys, sizes, and compression ratios.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:519-538 (handler)The handleList() method reads stored compressed items from disk, parses their JSON metadata, and returns a list of items with keys, algorithms, sizes, ratios, and timestamps.
handleList() { if (!existsSync(STORE_DIR)) return { items: [] }; const files = readdirSync(STORE_DIR).filter(f => f.endsWith('.json')); const items = files.map(f => { try { const meta = JSON.parse(readFileSync(join(STORE_DIR, f), 'utf-8')); return { key: meta.key, algorithm: meta.algorithm, original_size: meta.originalSize, compressed_size: meta.compressedSize, ratio: `${meta.ratio.toFixed(1)}x`, stored_at: meta.storedAt }; } catch (e) { return null; } }).filter(Boolean); return { items, count: items.length }; } - index.js:617-621 (schema)Input schema for the 'list' tool definition, which takes no parameters (empty properties object).
{ name: 'list', description: 'List all stored compressed items with their keys, sizes, and compression ratios.', inputSchema: { type: 'object', properties: {} } }, - index.js:618-619 (registration)Registration of the 'list' tool within the getToolDefinitions() array returned for tools/list requests.
name: 'list', description: 'List all stored compressed items with their keys, sizes, and compression ratios.', - index.js:688-688 (registration)Routing in the tools/call handler that dispatches 'list' tool calls to handleList().
case 'list': result = this.handleList(); break;