Skip to main content

Module optimizer

Module optimizer 

Source
Expand description

Description token-pruning.

Two layers:

  1. HeuristicOptimizer — deterministic, offline, no model dependency. Targets the known failure modes of human-written MCP descriptions: politeness filler, self-reference (“This tool is a tool that…”), duplicate sentences, Markdown emphasis, whitespace runs.

  2. DescriptionOptimizer trait — drop-in slot for an LLM-driven rewriter (e.g. Claude, GPT) implemented outside this crate so the core binary stays pure-CPU and offline.

A Jaccard guardrail prevents the heuristic pass from losing meaning.

Structs§

HeuristicOptimizer
Default offline pruner.
OptimizationOutcome

Traits§

DescriptionOptimizer
Pluggable optimizer interface. Out-of-tree backends (Claude/GPT/…) implement this.