Skip to main content
Glama

list_graphs

Retrieve all knowledge graphs you own with metadata like IDs, titles, and timestamps using the Mnemosyne MCP server.

Instructions

Lists all knowledge graphs owned by the authenticated user. Returns graph metadata including IDs, titles, and timestamps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_graphs_tool` function implements the core logic: authenticates the user, submits a backend job with task_type='list_graphs', processes results via WebSocket events or HTTP polling, extracts the list of user-owned graphs, and returns a formatted JSON response with graph metadata.
    async def list_graphs_tool(context: Context | None = None) -> str: auth = MCPAuthContext.from_context(context) auth.require_auth() metadata = await submit_job( base_url=backend_config.base_url, auth=auth, task_type="list_graphs", payload={}, ) if context: await context.report_progress(10, 100) events = None if job_stream and metadata.links.websocket: events = await stream_job(job_stream, metadata, timeout=STREAM_TIMEOUT_SECONDS) # Try to extract graphs from WebSocket events first if events: if context: await context.report_progress(80, 100) graphs = _extract_graphs_from_events(events) if graphs is not None: return _render_json({"graphs": graphs, "count": len(graphs)}) # Fall back to raw events if extraction failed return _render_json({"job_id": metadata.job_id, "events": events}) # Poll for job completion and extract result status_payload = ( await poll_job_until_terminal(metadata.links.status, auth) if metadata.links.status else None ) if context: await context.report_progress(100, 100) # Extract graphs from the job's detail.result_inline field graphs = _extract_graphs_from_status(status_payload) if graphs is not None: return _render_json({"graphs": graphs, "count": len(graphs)}) # Fallback: return error with debug info return _render_json({ "error": "Failed to extract graph list from job result", "job_id": metadata.job_id, "status": status_payload.get("status") if status_payload else None, })
  • The @server.tool decorator registers the 'list_graphs' tool with the FastMCP server, specifying its name, title, and description (which serves as schema documentation).
    @server.tool( name="list_graphs", title="List Mnemosyne Graphs", description=( "Lists all knowledge graphs owned by the authenticated user. " "Returns graph metadata including IDs, titles, and timestamps." ), )
  • Calls `register_basic_tools(mcp_server)` within `create_standalone_mcp_server()` to register the list_graphs tool (along with other basic tools) to the MCP server instance.
    register_basic_tools(mcp_server) register_graph_ops_tools(mcp_server) register_hocuspocus_tools(mcp_server)

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/sophia-labs/mnemosyne-mcp'

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