Skip to content

Feature: MCP tool profiles or enabledTools filter to reduce context window consumption #222

@Job28703

Description

@Job28703

Problem

The Nowledge Mem MCP server exposes 27 tools with full JSON schema descriptions. On agents with limited context windows (e.g., Copilot CLI at ~200KB), this consumes an estimated 15-25KB (8-12%) of the context window before any conversation begins.

Current tool inventory (27 tools)

High-frequency (daily use):

  • memory_search, memory_add, memory_update, memory_delete
  • read_working_memory
  • thread_search, thread_fetch_messages

Medium-frequency:

  • query_library, query_sources, read_artifact_content, read_source_content
  • search_artifact_chunks, search_source_chunks
  • create_artifact

Low-frequency (rarely used in typical sessions):

  • explore_graph, graph_stats, list_communities, get_community_details
  • list_crystals, list_memory_labels, get_wiki_page
  • analyze_artifact_data, analyze_source_data
  • memory_evolves_chain, memory_neighbors
  • search_thread_messages, thread_delete

Impact

On a 200KB context window agent (Copilot CLI), the breakdown is roughly:

  • ~15-20KB: Copilot CLI built-in system prompt (unavoidable)
  • ~15-25KB: Nowledge MCP tool definitions ← this issue
  • ~8-12KB: Copilot CLI built-in tools (unavoidable)
  • ~6KB: User instructions
  • ~2.5KB: Plugin AGENTS.md

The 27 Nowledge tools represent the largest single configurable context consumer. Many users never use graph exploration, community detection, or data analysis tools in typical coding sessions.

Proposed Solution

Option A: enabledTools config

Allow users to specify which tools to expose via config:

// ~/.nowledge-mem/config.json
{
  "mcp": {
    "enabledTools": [
      "memory_search", "memory_add", "memory_update", "memory_delete",
      "read_working_memory",
      "thread_search", "thread_fetch_messages"
    ]
  }
}

Option B: Preset profiles

Provide built-in profiles:

  • lite: Core memory tools only (search, add, update, delete, working memory, thread search) — ~8 tools
  • standard: Current default — all 27 tools
  • full: Everything including experimental tools
{
  "mcp": {
    "profile": "lite"
  }
}

Option C: Dynamic loading

Load tool descriptions on-demand based on conversation context (similar to the approach discussed in amd/gaia#688).

Environment

  • Nowledge Mem: v0.8.3
  • Copilot CLI plugin: nowledge-mem@nowledge-community
  • Agent: GitHub Copilot CLI v1.0.41
  • Context window: ~200KB

Related

  • The broader ecosystem is moving toward dynamic tool loading (see OpenClaw defer_loading flag discussions)
  • This would benefit all MCP clients with limited context, not just Copilot CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions