Skip to main content
Glama
egoughnour

Massive Context MCP

by egoughnour

rlm_list_contexts

List all loaded contexts and their metadata to monitor the state of recursive chunk analysis for massive datasets.

Instructions

List all loaded contexts and their metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual tool handler function for rlm_list_contexts. Returns a dict with 'contexts' key listing all loaded contexts and any disk-only contexts.
    @mcp.tool()
    async def rlm_list_contexts() -> dict:
        """List all loaded contexts and their metadata."""
        ctx_list = [
            {
                "name": name,
                "length": ctx["meta"]["length"],
                "lines": ctx["meta"]["lines"],
                "chunked": ctx["meta"].get("chunks") is not None,
            }
            for name, ctx in contexts.items()
        ]
    
        for meta_file in CONTEXTS_DIR.glob("*.meta.json"):
            disk_name = meta_file.stem.replace(".meta", "")
            if disk_name not in contexts:
                meta = json.loads(meta_file.read_text())
                ctx_list.append(
                    {
                        "name": disk_name,
                        "length": meta["length"],
                        "lines": meta["lines"],
                        "chunked": meta.get("chunks") is not None,
                        "disk_only": True,
                    }
                )
    
        return {"contexts": ctx_list}
  • Registered using the @mcp.tool() decorator on the async function rlm_list_contexts (line 1641).
    @mcp.tool()
    async def rlm_list_contexts() -> dict:
        """List all loaded contexts and their metadata."""
  • _hash_content helper used indirectly by context loading/saving functions that feed into list_contexts.
    def _hash_content(content: str) -> str:
        """Create short hash for content identification."""
        return hashlib.sha256(content.encode()).hexdigest()[:12]
  • No input args, returns dict with 'contexts' key containing list of context metadata objects (name, length, lines, chunked, disk_only).
    async def rlm_list_contexts() -> dict:
  • _load_context_from_disk helper used by list_contexts to discover contexts stored on disk but not in memory.
    def _load_context_from_disk(name: str) -> Optional[dict]:
        """Load context from disk if it exists."""
        meta_path = CONTEXTS_DIR / f"{name}.meta.json"
        content_path = CONTEXTS_DIR / f"{name}.txt"
    
        if not (meta_path.exists() and content_path.exists()):
            return None
    
        meta = json.loads(meta_path.read_text())
        meta["content"] = content_path.read_text()
        return meta
    
    
    def _save_context_to_disk(name: str, content: str, meta: dict) -> None:
        """Persist context to disk."""
        (CONTEXTS_DIR / f"{name}.txt").write_text(content)
        meta_without_content = {k: v for k, v in meta.items() if k != "content"}
        (CONTEXTS_DIR / f"{name}.meta.json").write_text(json.dumps(meta_without_content, indent=2))
    
    
    def _ensure_context_loaded(name: str) -> Optional[str]:
        """Ensure context is loaded into memory. Returns error message if not found."""
Behavior3/5

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

Without annotations, the description implies a read-only operation but provides no additional behavioral details (e.g., cost, pagination, or what 'metadata' includes).

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?

A single, front-loaded sentence with no extraneous words, efficiently conveying the tool's purpose.

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

Completeness4/5

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

Given the presence of an output schema and the simplicity of the tool, the description is nearly complete, though it could elaborate on what 'metadata' entails.

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?

No parameters exist, so the schema covers 100%; the description adds no parameter info but is not required to, earning a baseline of 4.

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

Purpose5/5

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

The description uses a specific verb 'List' and identifies the resource as 'all loaded contexts' with 'their metadata', clearly distinguishing it from sibling tools like rlm_load_context or rlm_filter_context.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives; usage is implied (list contexts when needed) but lacks exclusions or context.

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/egoughnour/massive-context-mcp'

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