list_diagrams
Retrieve a list of all Excalidraw diagrams previously generated by this server, allowing you to review and manage your creations.
Instructions
List all Excalidraw diagrams previously generated by this server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/excalidraw_mcp/server.py:85-102 (handler)The actual handler function for the 'list_diagrams' MCP tool. It lists all .excalidraw files in ~/excalidraw_diagrams/, showing filename and size in KB.
@mcp.tool() async def list_diagrams() -> str: """List all Excalidraw diagrams previously generated by this server.""" from pathlib import Path diagrams_dir = Path.home() / "excalidraw_diagrams" if not diagrams_dir.exists(): return "No diagrams found. Generate one first with generate_diagram()." files = sorted(diagrams_dir.glob("*.excalidraw")) if not files: return f"Directory exists ({diagrams_dir}) but contains no .excalidraw files yet." lines = [f"Diagrams in {diagrams_dir}:"] for f in files: kb = f.stat().st_size / 1024 lines.append(f" {f.name} ({kb:.1f} KB)") return "\n".join(lines) - src/excalidraw_mcp/server.py:85-87 (registration)Registration via the @mcp.tool() decorator on the async function, which registers 'list_diagrams' as an MCP tool on the FastMCP server instance.
@mcp.tool() async def list_diagrams() -> str: """List all Excalidraw diagrams previously generated by this server."""