token-savior
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| WORKSPACE_ROOTS | No | Comma-separated list of absolute paths to project roots to index. | |
| TOKEN_SAVIOR_CLIENT | No | Optional identifier for the client (e.g., 'claude-code', 'cursor', 'windsurf', 'cline', 'hermes') used to attribute savings in the live dashboard. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_projectsA | List all registered workspace projects with index status. |
| switch_projectC | Switch the active project. |
| get_diagnosticsA | Type-checker errors for this project, grouped by file, each mapped to its enclosing symbol. Runs the checker the project already declares (tsc / mypy / pyright) - no new dependency. Use after an edit instead of shelling out to a build: the output is bounded and says exactly what it truncated. |
| get_git_statusB | Structured git status: branch, ahead/behind, staged, unstaged, untracked. |
| get_changed_symbolsB | Symbol-level summary of worktree changes (or HEAD vs ref). |
| build_commit_summaryC | Compact commit/review narrative with stats, hotspots, suggested type. |
| checkpointB | Unified checkpoint CRUD. op = create | list (default) | restore | delete | prune | compare. |
| replace_symbol_sourceB | Rewrite a whole function or class by name, no Read needed. |
| edit_lines_in_symbolA | Edit code without reading the file first: exact old_string -> new_string, like Edit, matched only inside one function or class. Edit refuses a file you have not Read, which in a large file means reading all of it; this needs only the symbol name. replace_all=true changes every occurrence inside that symbol. |
| insert_near_symbolC | Insert content before or after an indexed symbol. |
| move_symbolA | Move a symbol to a different file, updating imports in all call sites. |
| add_field_to_modelB | Add a field to a model/class/interface. Supports .prisma, .py (dataclass, SQLAlchemy), .ts/.tsx. |
| find_impacted_test_filesA | Infer pytest files likely impacted by changed files or symbols. |
| run_impacted_testsB | Run pytest on files impacted by the current worktree changes. |
| discover_project_actionsA | Detect conventional project actions from build files (tests, lint, build, run) without executing. |
| run_project_actionB | Run a discovered project action by id (bounded output, bounded timeout). |
| get_project_summaryB | Project overview: file count, packages, top classes/functions, infra dirs. |
| list_filesB | List indexed files, optionally filtered by glob. |
| get_structure_summaryB | Structure of one file (functions, classes, imports, line counts), or project-wide if file omitted. |
| read_linesA | Read an exact line range from a file (1-indexed, inclusive). The tool to reach for when you hold a LINE NUMBER rather than a symbol name: a traceback frame, a |
| get_function_sourceB | Full source of a function or method by name, no path needed: reads the symbol instead of the whole file. |
| get_class_sourceC | Fetch a class source body (including methods). |
| get_functionsA | List functions in a file (file_path=...) or across the project. |
| get_classesB | List classes (name, lines, methods, bases, file). |
| get_importsB | List imports (module, names, line). |
| find_symbolA | Where is X defined: file, line, signature and preview in one call, the definition only where Grep returns every mention. Functions and classes first, then module constants and variables. |
| get_dependenciesA | Outgoing deps of a symbol: what X calls/uses (downstream). |
| get_dependentsB | Incoming deps: who calls/uses X, direct references only. |
| get_change_impactB | Impact analysis: direct + transitive dependents of a symbol. |
| get_full_contextC | Symbol bundle: location + source + deps/dependents (depth=1) or + change_impact (depth=2). |
| get_call_chainB | Shortest dependency path between two symbols (BFS through the dep graph). |
| get_edit_contextA | Pre-edit bundle: source + direct deps + callers + same-file siblings + impacted tests. |
| get_file_dependenciesB | Files imported by this file (outgoing file-level import edges). |
| get_file_dependentsB | Files that import this file (incoming file-level import edges). |
| search_codebaseA | Use instead of Grep/rg on code. Each hit also names the function or class that contains it ( |
| search_in_symbolsB | Regex search that returns the enclosing function/class for each match, in addition to file:line. |
| reindexC | Rebuild the project index. |
| set_project_rootA | Register a new project root and switch to it. If the path is already registered, this becomes a cheap active-root switch (no reindex) unless force=true is set. |
| get_feature_filesB | Files matching a feature keyword + traced imports, classified by role (core, test, config). |
| ts_discoverA | Scan Claude Code transcripts for missed Token Savior opportunities (native-call chains that should have been a single TS call) and/or report TS-vs-native adoption ratios. Scans ALL transcript projects by default; pass project= to filter. format='table' (default) or 'json' returns ranked Findings; format='adoption' or 'adoption_json' returns the TS adoption summary with trend + worst sessions. Read-only, PII-safe. |
| ts_stale_contextA | Scan the recent session transcript(s) and list tool results made obsolete later in the SAME session — a file read then re-read, a file read then edited, a Bash command re-run. Returns the stale refs so you can drop that content or refetch the fresh copy, keeping the context window lean. Agent-agnostic, read-only, PII-safe. format='table' (default) or 'json'. |
| get_statsC | Unified stats dispatcher. category = usage (default) | session_budget | tca | dcp | linucb | warmstart | leiden | speculation | lattice. |
| get_routesB | Detect API routes and pages in a Next.js App Router project: path, file, HTTP methods, type. |
| get_env_usageA | Cross-reference an env var across code, .env files, and workflow configs. Shows where it's defined, read, written. |
| analyze_configB | Audit config files (.env/.yaml/.toml/.json): duplicates, secrets, orphans. |
| find_dead_codeA | Project-wide audit of unreferenced functions/classes (zero callers, excludes entry points, tests, route handlers). |
| find_hotspotsB | Rank functions by hotspot kind. complexity (all langs) | allocation (Java) | performance (Java). |
| detect_breaking_changesB | Breaking API changes vs a git ref: removed funcs/params, added required params, signature changes. |
| analyze_dockerB | Audit Dockerfiles: base images, stages, exposed ports, ENV/ARG, cross-ref with config files. |
| get_db_schemaA | Condensed SQL-migration snapshot: tables (cols, types, nullability, defaults), PKs, FKs, indexes, RLS policies. |
| get_entry_pointsB | Score functions by likelihood of being execution entry points: routes, handlers, main, exported APIs. |
| memory_saveC | Persist a fact, guardrail, or note across sessions. |
| memory_searchB | Layer 2 FTS5 search over memory observations, compact rows with snippets (~60 tokens/result). |
| memory_getA | Layer 3: full observation content by IDs (~200 tokens/result). Final progressive-disclosure layer. |
| memory_deleteA | Soft-delete an observation by ID (sets archived=1). |
| memory_indexB | Layer 1: compact index of recent observations — ID, type, title, importance, age, citation URI. |
| corpus_buildB | Build a thematic corpus from observations filtered by type / tags / symbol. |
| find_semantic_duplicatesA | Find duplicate functions. method='ast' (fast, hash-based, catches copy-paste) or 'embedding' (Nomic cosine, catches conceptual clones, tagged sim=min..mean per cluster). |
| find_import_cyclesB | Detect import cycles (strongly-connected components) in the file-level import graph (Tarjan's). |
| corpus_queryB | Format all observations of a named corpus as markdown context + a question, ready for answering. |
| reasoning_saveB | Persist a reasoning trace (goal + steps + conclusion) for later reuse. |
| reasoning_searchB | Search stored reasoning chains by goal similarity (FTS5 + Jaccard). |
| reasoning_listB | List stored reasoning chains by access_count then recency. |
| capture_putB | Sandbox a verbose tool output to FTS5 store; returns id + preview. |
| capture_searchB | BM25 search across sandboxed tool outputs. Returns id, snippet, bytes. |
| capture_getB | Read a capture (range: head/tail/all/preview/line:N-M). |
| capture_aggregateC | Aggregate over a capture: stats|count_lines|unique_lines|extract:|count:. |
| capture_listC | List recent captures (newest first). |
| capture_purgeA | Delete captures by age/session/project (filter required). |
| memory_adminB | Single dispatch for all memory admin / maintenance ops (status, doctor, dedup_sweep, distill, roi_gc, consistency, vector_reindex, etc.). |
| ts_executeA | Run a JS script in a Node sandbox with a typed facade. The script body executes as |
| ts_searchA | Find the top-K Token Savior tools most relevant to a natural-language query via embedding cosine similarity. Use when the manifest is in 'tiny' or 'code_mode' profile or you don't know which tool fits. Returns each candidate with its full inputSchema (format='schema') or a one-line TypeScript signature (format='ts') suitable for ts_execute scripts. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| review | Review the current change, including breakage outside the diff, with Token Savior's impact tools. |
| audit | Audit the whole project and rank what to fix first, using Token Savior's analysis tools. |
| lean | Do a task as the smallest complete change, scoped by Token Savior. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 72 tools
Multiple tool families overlap heavily: get_dependencies/get_dependents/get_change_impact/get_full_context/get_edit_context all analyze symbol relationships; search_codebase/search_in_symbols/ts_search all search code; memory_search/reasoning_search/capture_search all search stores. Descriptions help somewhat, but boundaries remain unclear and agents must memorize subtle distinctions to avoid misselection.
Nearly all tools use snake_case with predictable verb_noun patterns and consistent family prefixes (get_, memory_, capture_, reasoning_, ts_, corpus_). Minor deviations like 'checkpoint' (noun-only) and 'reindex' are readable but slightly inconsistent.
72 tools is far beyond the typical 3-15 range and meets the rubric's extreme mismatch threshold. Even for a broad code-intelligence platform, this creates an overwhelming selection burden and increases the chance of wrong tool choice.
The surface covers code navigation, editing, refactoring, dependency analysis, git status, diagnostics, memory, reasoning, captures, and project management comprehensively. Only minor gaps exist, such as dedicated file creation/deletion and git commit/push operations, but major workflows are supported.