Skip to content

MCP Tool Reference

Toprak Ahmet Aydoğmuş edited this page Nov 30, 2026 · 1 revision

T-Zero Algorithm MCP Tool Reference

Tool names, handler signatures, and source docstrings extracted from tzero/tzero_mcp.py.

Important: source version and runtime list

The implementation selects one registration group. The default TZERO_MCP_TOOL_MODE is canonical; setting it to all, legacy, or 47 selects the alternate group. The checked-in decorators contain 14 canonical names and 51 alternate names (65 registrations across mutually exclusive modes). A source comment still refers to 47 alternate tools. Use the connected server's tools/list response for the installed build; comments, README counts, and this index can become stale.

Tool descriptions and docstrings are source declarations, not proof that every claimed guarantee has been independently tested. The entries below list implementation signatures and handler docstrings.

How registration works

  1. create_mcp_server() selects an MCP SDK class from the installed package API.
  2. The mode value chooses whether _canon_tool or _maybe_tool applies the actual server decorator.
  3. Each decorated function is defined inside create_mcp_server(), so declarations are registered when the server is constructed.
  4. main() defaults to MCP over stdio; HTTP startup is a separate explicit path.
  5. The stdout stream is reserved for MCP protocol messages; root logging handlers directed to stdout are moved to stderr before stdio startup.

Source: create_mcp_server, main.

Canonical registration mode (14 source registrations)

Each handler signature is reconstructed from the parsed source declaration. Parameter annotations include MCP schema metadata where expressed in the Python signature.

analyze_change_impact

Registered handler: analyze_change_impact
Decorator: tzero/tzero_mcp.py:3327
Implementation: tzero/tzero_mcp.py:3353-3362

Python signature:

def analyze_change_impact(target_symbol: Annotated[str, Field(description='Name of the function, class, or method being modified or refactored.')], project_root: Annotated[str, Field(default='.', description='Root directory of the repository (default: current directory).')] = '.', file_path: Annotated[str, Field(default='', description='Optional file path where the target symbol is defined.')] = '') -> str:

Handler docstring from source:

Calculates blast radius score and downstream dependents before modifying a target symbol.

analyze_code_dependencies

Registered handler: analyze_code_dependencies
Decorator: tzero/tzero_mcp.py:3277
Implementation: tzero/tzero_mcp.py:3306-3322

Python signature:

def analyze_code_dependencies(analysis_type: Annotated[str, Field(default='dependencies', description="Type of structural analysis: 'dependencies' for module import/export graph, 'call_chain' for deep caller/callee execution trace, 'pagerank' for architectural backbone centrality, 'dead_code' for unreferenced symbols.")] = 'dependencies', project_root: Annotated[str, Field(default='.', description='Root directory of the repository to scan (default: current directory).')] = '.', target_symbol: Annotated[str, Field(default='', description="Target class or function name when analysis_type is 'call_chain'.")] = '', file_path: Annotated[str, Field(default='', description='Optional path to a specific file to analyze.')] = '') -> str:

Handler docstring from source:

Analyzes structural dependencies, call chains, and module centrality across codebase.

audit_code_quality

Registered handler: audit_code_quality
Decorator: tzero/tzero_mcp.py:3406
Implementation: tzero/tzero_mcp.py:3434-3465

Python signature:

def audit_code_quality(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to audit (default: current directory).')] = '.', check_type: Annotated[str, Field(default='all', description="Audit scope: 'all' for complete check, 'smells' for code complexity/smells, 'duplicity' for copy-paste blocks, 'hallucinations' for invalid imports/signatures, 'debt' for TODO/FIXME/HACK/XXX/TEMP markers grouped by scope with estimated remediation hours.")] = 'all', file_path: Annotated[str, Field(default='', description='Optional path to a single file to audit.')] = '') -> str:

Handler docstring from source:

Audits AST code smells, cyclomatic complexity, copy-paste duplicity, hallucinations, and debt markers.

build_project_context

Registered handler: build_project_context
Decorator: tzero/tzero_mcp.py:2993
Implementation: tzero/tzero_mcp.py:3024-3054

Python signature:

def build_project_context(project_root: Annotated[str, Field(default='.', description='Target repository root path to scan (default: current working directory).')] = '.', context_type: Annotated[str, Field(default='tree', description="Context generation mode: 'tree' for hierarchical multi-tier AST tree, 'repo_map' for compact symbol index, 'skeleton' for focus-file implementation with 1st-degree caller/callee skeletons, 'zero_waste_prompt' for agent prompt prefix with pruned AST, 'incremental_diff' for git diff context.")] = 'tree', focus_file: Annotated[str, Field(default='', description="Optional path to a focus file when context_type is 'skeleton' or 'incremental_diff'.")] = '', reduction_mode: Annotated[str, Field(default='ultra', description="AST reduction level: 'ultra' for signatures & docstrings (80-95% reduction), 'balanced' for signatures + control headers, 'none' for verbatim source.")] = 'ultra', max_tokens: Annotated[int, Field(default=64000, description='Upper token budget threshold for returned context.')] = 64000, include_file_contents: Annotated[bool, Field(default=True, description='When True, includes AST-reduced file bodies; when False, emits directory hierarchy only.')] = True) -> str:

Handler docstring from source:

Builds a token-optimized AST context payload for LLM prompts across hierarchy tiers.

enforce_architecture_rules

Registered handler: enforce_architecture_rules
Decorator: tzero/tzero_mcp.py:3200
Implementation: tzero/tzero_mcp.py:3227-3235

Python signature:

def enforce_architecture_rules(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to validate (default: current directory).')] = '.', strict_mode: Annotated[bool, Field(default=True, description='When True, fails on any boundary infraction; when False, warns without raising errors.')] = True) -> str:

Handler docstring from source:

Enforces architectural boundary rules and layer isolation constraints across workspace AST.

estimate_token_cost

Registered handler: estimate_token_cost
Decorator: tzero/tzero_mcp.py:3513
Implementation: tzero/tzero_mcp.py:3540-3549

Python signature:

def estimate_token_cost(text: Annotated[str, Field(default='', description='Raw text string to count tokens and calculate cost for.')] = '', project_root: Annotated[str, Field(default='.', description='Root directory of the repository to calculate workspace ROI savings for.')] = '.', tokens: Annotated[int, Field(default=0, description='Optional raw token count to calculate cost directly.')] = 0, export_agent_rules: Annotated[str, Field(default='', description="Optional format to export agent rules: 'cursorrules', 'clinerules', 'markdown', or empty for cost estimation only.")] = '') -> str:

Handler docstring from source:

Calculates token counts, commercial provider pricing estimates, and developer ROI savings.

generate_architecture_blueprint

Registered handler: generate_architecture_blueprint
Decorator: tzero/tzero_mcp.py:3240
Implementation: tzero/tzero_mcp.py:3266-3272

Python signature:

def generate_architecture_blueprint(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to analyze (default: current directory).')] = '.', use_ai: Annotated[bool, Field(default=False, description='When True, uses configured AI provider to synthesize deep narrative; when False (default), runs 100% offline AST analysis.')] = False, model: Annotated[str, Field(default='', description='Optional model identifier override when use_ai is True.')] = '') -> str:

Handler docstring from source:

Generates a complete ARCHITECTURE.md document with live Mermaid component diagrams.

manage_architecture_rules

Registered handler: manage_architecture_rules
Decorator: tzero/tzero_mcp.py:3099
Implementation: tzero/tzero_mcp.py:3128-3195

Python signature:

def manage_architecture_rules(action: Annotated[str, Field(default='query', description="Rule lifecycle action: 'query' to inspect active rules, 'update' to add or modify rules, 'delete' to remove a rule, 'reset' to restore defaults.")] = 'query', project_root: Annotated[str, Field(default='.', description='Target repository root where tzero.rules.json is located (default: current directory).')] = '.', rule_name: Annotated[str, Field(default='', description="Name or identifier of the rule to update or delete when action is 'update' or 'delete'.")] = '', rule_definition: Annotated[str, Field(default='', description="JSON string or markdown specification of the rule to set when action is 'update'.")] = '') -> str:

Handler docstring from source:

Manages the complete lifecycle of architectural layer boundary rules.

manage_memory_store

Registered handler: manage_memory_store
Decorator: tzero/tzero_mcp.py:3599
Implementation: tzero/tzero_mcp.py:3628-3691

Python signature:

def manage_memory_store(operation: Annotated[str, Field(default='list', description="Memory lifecycle operation: 'list' to show active memory stores, 'compress' to encode text into semantic triples, 'consolidate' to merge memory, 'export' to dump graph, 'reset' to clear all memory, 'delete' to remove a specific store.")] = 'list', content: Annotated[str, Field(default='', description="Text document or knowledge content to compress or store when operation is 'compress'.")] = '', store_name: Annotated[str, Field(default='default', description='Identifier of the target memory store to manage.')] = 'default', project_root: Annotated[str, Field(default='.', description='Workspace root where memory stores are managed (default: current directory).')] = '.') -> str:

Handler docstring from source:

Manages the lifecycle of persistent semantic memory stores and knowledge graphs.

orchestrate_agent_swarm

Registered handler: orchestrate_agent_swarm
Decorator: tzero/tzero_mcp.py:3696
Implementation: tzero/tzero_mcp.py:3725-3752

Python signature:

def orchestrate_agent_swarm(goal: Annotated[str, Field(description='High-level goal description, swarm proposal, or failing test traceback to heal.')], orchestration_mode: Annotated[str, Field(default='goal_execute', description="Orchestration mode: 'goal_execute' for autonomous goal planning and execution, 'swarm_consensus' for Byzantine fault-tolerant voting, 'self_healing' for AST error diagnosis and automated patching, 'dynamic_subagents' for dynamic task decomposition and on-the-fly subagent synthesis.")] = 'goal_execute', agents: Annotated[str, Field(default='', description="Comma-separated list of agent roles participating in swarm execution (e.g. 'architect,coder,tester').")] = '', project_root: Annotated[str, Field(default='.', description='Workspace root for swarm execution (default: current directory).')] = '.') -> str:

Handler docstring from source:

Coordinates autonomous multi-agent swarms, goal execution, PBFT consensus, and self-healing.

prune_code_snippet

Registered handler: prune_code_snippet
Decorator: tzero/tzero_mcp.py:3059
Implementation: tzero/tzero_mcp.py:3085-3094

Python signature:

def prune_code_snippet(code: Annotated[str, Field(description='Raw source code, schema definition (JSON/YAML), or unified diff text to compress.')], file_name_or_lang: Annotated[str, Field(default='snippet.py', description="File name or language extension (e.g. 'service.ts', '.go', '.rs', 'schema.json') to select appropriate AST parser.")] = 'snippet.py', reduction_mode: Annotated[str, Field(default='ultra', description="AST reduction level: 'ultra' for signatures only, 'balanced' for signatures + control structures, 'micro_patch' for surgical unified diff pruning.")] = 'ultra') -> str:

Handler docstring from source:

Prunes implementation bodies from in-memory code snippets or diff streams.

query_memory_store

Registered handler: query_memory_store
Decorator: tzero/tzero_mcp.py:3554
Implementation: tzero/tzero_mcp.py:3582-3594

Python signature:

def query_memory_store(query: Annotated[str, Field(description='Entity name, concept, or search query to look up in the memory store.')], query_mode: Annotated[str, Field(default='semantic', description="Query strategy: 'semantic' for triple & relation lookup, 'causal_chain' for temporal cause-and-effect traces, 'minhash' for sub-microsecond entity similarity clusters.")] = 'semantic', project_root: Annotated[str, Field(default='.', description='Workspace root where memory store is located (default: current directory).')] = '.') -> str:

Handler docstring from source:

Queries semantic triples, causal reasoning graphs, and similarity clusters from memory.

search_codebase

Registered handler: search_codebase
Decorator: tzero/tzero_mcp.py:3367
Implementation: tzero/tzero_mcp.py:3395-3401

Python signature:

def search_codebase(query: Annotated[str, Field(description='Search term or natural language description of the code to locate.')], project_root: Annotated[str, Field(default='.', description='Root directory of the repository to search (default: current directory).')] = '.', top_k: Annotated[int, Field(default=5, description='Maximum number of ranked results to return (default: 5).')] = 5) -> str:

Handler docstring from source:

Performs private local hybrid BM25 and semantic search across repository code.

verify_security_guard

Registered handler: verify_security_guard
Decorator: tzero/tzero_mcp.py:3470
Implementation: tzero/tzero_mcp.py:3498-3508

Python signature:

def verify_security_guard(action: Annotated[str, Field(default='scan', description="Security action: 'scan' to inspect files or content for secret leaks, 'install_pre_commit' to install the automated git zero-leak hook.")] = 'scan', project_root: Annotated[str, Field(default='.', description='Target repository root to scan or install hook into (default: current directory).')] = '.', content: Annotated[str, Field(default='', description='Optional raw text string to scan for secrets in memory without scanning disk files.')] = '') -> str:

Handler docstring from source:

Scans for credential and secret leaks or installs automated git pre-commit zero-leak guard.

Alternate / legacy registration mode (51 source registrations)

Each handler signature is reconstructed from the parsed source declaration. Parameter annotations include MCP schema metadata where expressed in the Python signature.

analyze_change_impact

Registered handler: _legacy_analyze_change_impact
Decorator: tzero/tzero_mcp.py:1030
Implementation: tzero/tzero_mcp.py:1058-1070

Python signature:

def _legacy_analyze_change_impact(target_symbol: Annotated[str, Field(description='Name of the function, class, or method to analyze for change blast radius.')], project_root: Annotated[str, Field(default='.', description='Workspace root directory containing target symbols (default: current directory).')] = '.', file_path: Annotated[str, Field(default='', description='Optional file path to disambiguate target symbol.')] = '') -> str:

Handler docstring from source:

Traces symbol references, inbound dependents, and calculates blast radius score.

analyze_instruction_drift

Registered handler: analyze_instruction_drift
Decorator: tzero/tzero_mcp.py:4038
Implementation: tzero/tzero_mcp.py:4062-4085

Python signature:

def analyze_instruction_drift(workspace_dir: Annotated[str, Field(default='.', description='Target repository root directory (default: current directory).')] = '.') -> str:

Handler docstring from source:

Measures instruction drift and architectural rule decay across the codebase.

audit_codebase_quality

Registered handler: _legacy_audit_codebase_quality
Decorator: tzero/tzero_mcp.py:740
Implementation: tzero/tzero_mcp.py:765-866

Python signature:

def _legacy_audit_codebase_quality(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to audit (default: current directory).')] = '.', file_path: Annotated[str, Field(default='', description='Optional path to a specific file to audit. If empty, audits all code files in the workspace.')] = '') -> str:

Handler docstring from source:

Audits codebase quality, AST smells, and secret exposure.

        Args:
            project_root: Root directory of the repository (default: current directory).
            file_path: Optional path to a specific file to audit. If empty, audits all Python files.

calculate_token_cost_roi

Registered handler: calculate_token_cost_roi
Decorator: tzero/tzero_mcp.py:3991
Implementation: tzero/tzero_mcp.py:4015-4036

Python signature:

def calculate_token_cost_roi(workspace_dir: Annotated[str, Field(default='.', description='Target repository root directory (default: current directory).')] = '.') -> str:

Handler docstring from source:

Calculates token reduction and quantitative financial ROI across LLM providers.

compress_stream_tokens

Registered handler: _legacy_compress_stream_tokens
Decorator: tzero/tzero_mcp.py:2756
Implementation: tzero/tzero_mcp.py:2782-2799

Python signature:

def _legacy_compress_stream_tokens(content: Annotated[str, Field(description='Streaming text, log chunk, or partial code buffer to compress.')], filename_hint: Annotated[str, Field(default='', description="Optional filename or extension hint (e.g. 'app.py', 'schema.sql', 'patch.diff') to optimize AST reduction (default: '').")] = '', tier: Annotated[str, Field(default='T-3', description="Compression tier ('T-3' for AST signatures, 'T-2' for light structure, 'T-4' for agent rules) (default: 'T-3').")] = 'T-3') -> str:

Handler docstring from source:

Compresses streaming code tokens on-the-fly.

enforce_architecture_boundaries

Registered handler: _legacy_enforce_architecture_boundaries
Decorator: tzero/tzero_mcp.py:1075
Implementation: tzero/tzero_mcp.py:1100-1110

Python signature:

def _legacy_enforce_architecture_boundaries(project_root: Annotated[str, Field(default='.', description='Workspace root to validate against architectural rules (default: current directory).')] = '.', rules_file: Annotated[str, Field(default='tzero.rules.json', description="Path to rules JSON file (default: 'tzero.rules.json'). Resolves relative to project_root.")] = 'tzero.rules.json') -> str:

Handler docstring from source:

Audits imports against architectural layer boundaries.

estimate_token_cost

Registered handler: _legacy_estimate_token_cost
Decorator: tzero/tzero_mcp.py:948
Implementation: tzero/tzero_mcp.py:976-1025

Python signature:

def _legacy_estimate_token_cost(text: Annotated[str, Field(default='', description='Optional raw text to estimate. If empty, analyzes context generated from project_root.')] = '', project_root: Annotated[str, Field(default='.', description='Project directory to scan if text is empty (default: current directory).')] = '.', reduction_mode: Annotated[str, Field(default='ultra', description="Reduction tier ('ultra', 'balanced', 'none') applied when scanning project_root.")] = 'ultra') -> str:

Handler docstring from source:

Calculates token counts and costs across LLM providers.

        Args:
            text: Optional raw text to estimate. If empty, analyzes context from project_root.
            project_root: Project directory to scan if text is empty (default: current directory).
            reduction_mode: Reduction mode to apply when scanning project_root.

export_agent_rules

Registered handler: _legacy_export_agent_rules
Decorator: tzero/tzero_mcp.py:1155
Implementation: tzero/tzero_mcp.py:1180-1226

Python signature:

def _legacy_export_agent_rules(project_root: Annotated[str, Field(default='.', description='Target workspace directory where agent rule files will be created (default: current directory).')] = '.', target: Annotated[str, Field(default='all', description="Target editor format: 'cursor', 'cline', 'windsurf', 'claude', 'copilot', or 'all' (default: 'all').")] = 'all') -> str:

Handler docstring from source:

Exports AI coding agent rules into workspace.

find_code_duplicity

Registered handler: _legacy_find_code_duplicity
Decorator: tzero/tzero_mcp.py:871
Implementation: tzero/tzero_mcp.py:896-943

Python signature:

def _legacy_find_code_duplicity(project_root: Annotated[str, Field(default='.', description="Repository root directory to scan (default: '.').")] = '.', min_lines: Annotated[int, Field(default=6, description='Minimum consecutive identical code lines required to flag a duplicate block (default: 6).')] = 6) -> str:

Handler docstring from source:

Identifies duplicate code blocks across workspace files.

        Args:
            project_root: Repository root directory to scan (default: '.').
            min_lines: Minimum consecutive identical code lines required to flag a duplicate block (default: 6).

find_dead_code

Registered handler: _legacy_find_dead_code
Decorator: tzero/tzero_mcp.py:1666
Implementation: tzero/tzero_mcp.py:1690-1702

Python signature:

def _legacy_find_dead_code(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to scan for unreferenced symbols (default: current directory).')] = '.') -> str:

Handler docstring from source:

Discovers unused symbols and dead code candidates across the codebase.

        Args:
            project_root: Root directory of the repository (default: current directory).

generate_architecture_blueprint

Registered handler: _legacy_generate_architecture_blueprint
Decorator: tzero/tzero_mcp.py:605
Implementation: tzero/tzero_mcp.py:633-676

Python signature:

def _legacy_generate_architecture_blueprint(project_root: Annotated[str, Field(default='.', description="Repository root directory to inspect (default: '.').")] = '.', use_ai: Annotated[bool, Field(default=False, description='When True, supplements deterministic AST topology with local zero-cost AI architectural insights (default: False).')] = False, model: Annotated[str, Field(default='', description="Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True (default: '').")] = '') -> str:

Handler docstring from source:

Generates a complete ARCHITECTURE.md document with live Mermaid diagrams.

        Args:
            project_root: Repository root directory to inspect (default: '.').
            use_ai: When True, supplements deterministic AST topology with local zero-cost AI architectural insights.
            model: Optional model identifier override (e.g. 'deepseek-v4.1-flash', 'gpt-4o') when use_ai is True.

generate_repo_map

Registered handler: _legacy_generate_repo_map
Decorator: tzero/tzero_mcp.py:681
Implementation: tzero/tzero_mcp.py:706-735

Python signature:

def _legacy_generate_repo_map(project_root: Annotated[str, Field(default='.', description="Target repository root directory to scan (default: '.').")] = '.', max_tokens: Annotated[int, Field(default=4000, description='Maximum token ceiling for the returned symbol map (default: 4000).')] = 4000) -> str:

Handler docstring from source:

Builds a compressed AST symbol map for the repository.

        Args:
            project_root: Target repository root directory to scan (default: '.').
            max_tokens: Maximum token ceiling for the returned symbol map (default: 4000).

generate_smart_micro_patch

Registered handler: _legacy_generate_smart_micro_patch
Decorator: tzero/tzero_mcp.py:2672
Implementation: tzero/tzero_mcp.py:2697-2703

Python signature:

def _legacy_generate_smart_micro_patch(diff_content: Annotated[str, Field(description='Raw unified diff text (e.g. git diff output) to compress.')], max_context_lines: Annotated[int, Field(default=1, description='Maximum unchanged context lines to keep around hunk modifications (default: 1).')] = 1) -> str:

Handler docstring from source:

Compresses unified git diff into a compact semantic micro-patch.

generate_zero_waste_prompt_context

Registered handler: _legacy_generate_zero_waste_prompt_context
Decorator: tzero/tzero_mcp.py:2708
Implementation: tzero/tzero_mcp.py:2733-2751

Python signature:

def _legacy_generate_zero_waste_prompt_context(target_dir: Annotated[str, Field(default='.', description="Target repository root directory (default: '.').")] = '.', entrypoints: Annotated[Optional[List[str]], Field(default=None, description="List of entrypoint filenames (e.g. ['main.py', 'app.py']). If omitted or null, entrypoints are auto-detected.")] = None) -> str:

Handler docstring from source:

Constructs zero-waste LLM prompt context by pruning dead code via AST reachability.

get_incremental_diff_context

Registered handler: _legacy_get_incremental_diff_context
Decorator: tzero/tzero_mcp.py:1279
Implementation: tzero/tzero_mcp.py:1304-1312

Python signature:

def _legacy_get_incremental_diff_context(base_ref: Annotated[str, Field(default='HEAD~1', description="Git revision or branch to diff against (default: 'HEAD~1').")] = 'HEAD~1', project_root: Annotated[str, Field(default='.', description='Git repository root path (default: current directory).')] = '.') -> str:

Handler docstring from source:

Generates incremental PR diff context and downstream caller signatures.

get_project_context_tree

Registered handler: _legacy_get_project_context_tree
Decorator: tzero/tzero_mcp.py:313
Implementation: tzero/tzero_mcp.py:340-439

Python signature:

def _legacy_get_project_context_tree(project_root: Annotated[str, Field(default='.', description='Target repository root path to scan (default: current working directory).')] = '.', reduction_mode: Annotated[str, Field(default='ultra', description="AST reduction level: 'ultra' for signatures & docstrings (80-95% reduction), 'balanced' for signatures + control headers, 'none' for verbatim source.")] = 'ultra', max_tokens: Annotated[int, Field(default=64000, description='Upper token budget threshold for returned context. When exceeded, PageRank & Git recency prioritizes critical architectural files.')] = 64000, include_file_contents: Annotated[bool, Field(default=True, description='When True, includes AST-reduced file bodies; when False, emits only the directory hierarchy and high-level architectural outline.')] = True) -> str:

Handler docstring from source:

Builds a hierarchical T-Zero context tree for the specified workspace.

        Args:
            project_root: Root directory of the repository to scan (default: current directory).
            reduction_mode: Token reduction mode ('ultra' for AST signatures only, 'balanced' for signatures + control flow, 'none' for full source).
            max_tokens: Maximum token budget cap for the returned context payload.
            include_file_contents: If False, returns only the directory tree and high-level architecture overview.

get_smart_skeleton_context

Registered handler: _legacy_get_smart_skeleton_context
Decorator: tzero/tzero_mcp.py:1529
Implementation: tzero/tzero_mcp.py:1555-1570

Python signature:

def _legacy_get_smart_skeleton_context(focus_file: Annotated[str, Field(description='Target file path to focus on and retain with full implementation.')], focus_symbol: Annotated[str, Field(default='', description='Optional specific function or class name within focus_file to isolate.')] = '', project_root: Annotated[str, Field(default='.', description='Root directory of the repository (default: current directory).')] = '.') -> str:

Handler docstring from source:

Returns focus implementation with 1st-degree surrounding AST skeletons.

        Args:
            focus_file: Target file path to focus on.
            focus_symbol: Optional specific function or class name within focus_file to inspect.
            project_root: Root directory of the repository (default: current directory).

get_token_savings_metrics

Registered handler: _legacy_get_token_savings_metrics
Decorator: tzero/tzero_mcp.py:1231
Implementation: tzero/tzero_mcp.py:1256-1274

Python signature:

def _legacy_get_token_savings_metrics(project_root: Annotated[str, Field(default='.', description="Target workspace directory to measure (default: '.').")] = '.', team_size: Annotated[int, Field(default=5, description='Number of developers in the engineering team used to model monthly ROI savings (default: 5).')] = 5) -> str:

Handler docstring from source:

Calculates token reduction and economic ROI.

install_git_security_guard

Registered handler: _legacy_install_git_security_guard
Decorator: tzero/tzero_mcp.py:2804
Implementation: tzero/tzero_mcp.py:2828-2843

Python signature:

def _legacy_install_git_security_guard(repo_dir: Annotated[str, Field(default='.', description="Target git repository root directory where the pre-commit hook will be installed (default: '.').")] = '.') -> str:

Handler docstring from source:

Installs the pre-commit zero-leak and token optimization guard.

jarvis_bft_swarm_consensus

Registered handler: _legacy_jarvis_bft_swarm_consensus
Decorator: tzero/tzero_mcp.py:2521
Implementation: tzero/tzero_mcp.py:2546-2568

Python signature:

def _legacy_jarvis_bft_swarm_consensus(mission_goal: Annotated[str, Field(description='Action, refactoring plan, or critical decision requiring swarm consensus.')], context: Annotated[str, Field(default='', description="Supporting architectural context, risk parameters, or verification constraints (default: '').")] = '') -> str:

Handler docstring from source:

Executes Byzantine Fault-Tolerant swarm consensus.

jarvis_causal_chain_query

Registered handler: _legacy_jarvis_causal_chain_query
Decorator: tzero/tzero_mcp.py:2105
Implementation: tzero/tzero_mcp.py:2130-2152

Python signature:

def _legacy_jarvis_causal_chain_query(target_node_id: Annotated[str, Field(description='Incident identifier, bug description, or symbol name to trace root cause for.')], query_type: Annotated[str, Field(default='root_causes', description="Analysis mode: 'root_causes' (backward causal trace), 'effect_chain' (downstream consequence chain), 'rollback_order' (safe rollback sequence), or 'timeline' (chronological event history) (default: 'root_causes').")] = 'root_causes') -> str:

Handler docstring from source:

Queries 4D Causal & Temporal Knowledge Graph.

jarvis_compress_document

Registered handler: _legacy_jarvis_compress_document
Decorator: tzero/tzero_mcp.py:2001
Implementation: tzero/tzero_mcp.py:2025-2050

Python signature:

def _legacy_jarvis_compress_document(document_text: Annotated[str, Field(description='Full text of technical documentation, README, or article to compress.')]) -> str:

Handler docstring from source:

Compresses multi-paragraph technical documents into knowledge graph virtual tokens.

        Args:
            document_text: Full document text to ingest and compress.

jarvis_compress_semantic_memory

Registered handler: _legacy_jarvis_compress_semantic_memory
Decorator: tzero/tzero_mcp.py:1707
Implementation: tzero/tzero_mcp.py:1731-1756

Python signature:

def _legacy_jarvis_compress_semantic_memory(text: Annotated[str, Field(description='Natural language statement, hardware setup, system log, or architecture instruction to compress.')]) -> str:

Handler docstring from source:

Compresses text into 3-Layer semantic triplets, VQ discrete codes, and virtual memory tokens.

        Args:
            text: Input text to compress.

jarvis_consolidate_memory

Registered handler: _legacy_jarvis_consolidate_memory
Decorator: tzero/tzero_mcp.py:2225
Implementation: tzero/tzero_mcp.py:2249-2263

Python signature:

def _legacy_jarvis_consolidate_memory(action: Annotated[str, Field(default='consolidate', description="Consolidation mode: 'consolidate' (runs compaction cycle) or 'summary' (reports consolidation status).")] = 'consolidate') -> str:

Handler docstring from source:

Consolidates episodic memory into permanent abstracted knowledge.

jarvis_decompress_semantic_memory

Registered handler: _legacy_jarvis_decompress_semantic_memory
Decorator: tzero/tzero_mcp.py:1761
Implementation: tzero/tzero_mcp.py:1785-1807

Python signature:

def _legacy_jarvis_decompress_semantic_memory(token_or_code: Annotated[str, Field(description="Virtual memory token (e.g. '<|tzero:mem:8421|>') or discrete code ID (e.g. '8421').")]) -> str:

Handler docstring from source:

Resolves virtual memory tokens back to their semantic graph representation.

        Args:
            token_or_code: The virtual token or code ID to resolve.

jarvis_export_graph_visualization

Registered handler: _legacy_jarvis_export_graph_visualization
Decorator: tzero/tzero_mcp.py:2386
Implementation: tzero/tzero_mcp.py:2410-2436

Python signature:

def _legacy_jarvis_export_graph_visualization(output_path: Annotated[str, Field(default='', description="Destination file path for the generated HTML visualizer (default: '' uses 'tzero_graph_hud.html').")] = '') -> str:

Handler docstring from source:

Exports interactive cyberpunk HTML graph visualization.

jarvis_export_memory_store

Registered handler: _legacy_jarvis_export_memory_store
Decorator: tzero/tzero_mcp.py:2055
Implementation: tzero/tzero_mcp.py:2080-2100

Python signature:

def _legacy_jarvis_export_memory_store(action: Annotated[str, Field(default='save', description="Action to perform: 'save' (export to disk) or 'load' (import from disk) (default: 'save').")] = 'save', file_path: Annotated[str, Field(default='', description="Optional custom JSON file path (default: '' uses 'tzero_memory_store.json').")] = '') -> str:

Handler docstring from source:

Saves or loads persistent semantic memory store.

        Args:
            action: 'save' or 'load'.
            file_path: Target JSON file path.

jarvis_hybrid_search

Registered handler: _legacy_jarvis_hybrid_search
Decorator: tzero/tzero_mcp.py:2268
Implementation: tzero/tzero_mcp.py:2294-2326

Python signature:

def _legacy_jarvis_hybrid_search(query: Annotated[str, Field(description='Search query, question, or code pattern to locate.')], top_k: Annotated[int, Field(default=10, description='Maximum number of ranked results to return.')] = 10, domain: Annotated[str, Field(default='', description="Optional domain filter ('HARDWARE', 'PROTOCOL', 'SOFTWARE', etc.). Empty string searches across all domains.")] = '') -> str:

Handler docstring from source:

Sub-millisecond in-memory BM25 + latent code hybrid search.

jarvis_latent_press_compress

Registered handler: _legacy_jarvis_latent_press_compress
Decorator: tzero/tzero_mcp.py:2573
Implementation: tzero/tzero_mcp.py:2598-2619

Python signature:

def _legacy_jarvis_latent_press_compress(context_text: Annotated[str, Field(description='Long text or documentation string to compress before feeding to LLM.')], near_dup_threshold: Annotated[float, Field(default=0.65, description='Similarity threshold (0.0 to 1.0) for collapsing redundant sentences.')] = 0.65) -> str:

Handler docstring from source:

Executes LatentPress pre-prefill context compression.

jarvis_minhash_similarity

Registered handler: _legacy_jarvis_minhash_similarity
Decorator: tzero/tzero_mcp.py:2441
Implementation: tzero/tzero_mcp.py:2467-2516

Python signature:

def _legacy_jarvis_minhash_similarity(text_a: Annotated[str, Field(description='First text or code snippet to compare.')], text_b: Annotated[str, Field(default='', description='Second text to compare against. If empty string, searches memory codebook.')] = '', threshold: Annotated[float, Field(default=0.5, description='Minimum Jaccard similarity threshold (0.0 to 1.0) to flag as a positive match.')] = 0.5) -> str:

Handler docstring from source:

Sub-microsecond MinHash LSH similarity comparison.

jarvis_orchestrate_goal

Registered handler: _legacy_jarvis_orchestrate_goal
Decorator: tzero/tzero_mcp.py:1812
Implementation: tzero/tzero_mcp.py:1838-1886

Python signature:

def _legacy_jarvis_orchestrate_goal(goal: Annotated[str, Field(default='plan', description="Autonomous engineering task, refactoring directive, or 'plan'/'help' to view capabilities and executive plan.")] = 'plan', project_root: Annotated[str, Field(default='.', description='Target workspace directory to orchestrate within (default: current directory).')] = '.', mode: Annotated[str, Field(default='auto', description="Execution mode: 'auto', 'plan', 'execute', or 'capabilities'.")] = 'auto') -> str:

Handler docstring from source:

Executes autonomous workspace orchestration or presents an executive engineering plan.

jarvis_query_knowledge_graph

Registered handler: _legacy_jarvis_query_knowledge_graph
Decorator: tzero/tzero_mcp.py:1940
Implementation: tzero/tzero_mcp.py:1966-1996

Python signature:

def _legacy_jarvis_query_knowledge_graph(query: Annotated[str, Field(default='', description='General natural language search term to locate in graph (default: empty string).')] = '', entity: Annotated[str, Field(default='', description='Specific entity name to filter knowledge graph nodes (default: empty string).')] = '', predicate: Annotated[str, Field(default='', description="Relationship or predicate type to filter edges, e.g. 'depends_on' (default: empty string).")] = '') -> str:

Handler docstring from source:

Queries the semantic memory knowledge graph.

        Args:
            query: Freeform search keyword.
            entity: Target entity name.
            predicate: Target predicate.

jarvis_self_healing_execute

Registered handler: _legacy_jarvis_self_healing_execute
Decorator: tzero/tzero_mcp.py:2157
Implementation: tzero/tzero_mcp.py:2183-2220

Python signature:

def _legacy_jarvis_self_healing_execute(command: Annotated[str, Field(description='Shell command or test script to execute.')], max_retries: Annotated[int, Field(default=3, description='Zero disables repair; a positive value permits one repair attempt.')] = 3) -> str:

Handler docstring from source:

Runs command with autonomous AST error diagnosis and auto-repair.

jarvis_swarm_orchestrate

Registered handler: _legacy_jarvis_swarm_orchestrate
Decorator: tzero/tzero_mcp.py:2331
Implementation: tzero/tzero_mcp.py:2356-2381

Python signature:

def _legacy_jarvis_swarm_orchestrate(mission_goal: Annotated[str, Field(description='High-level mission directive or engineering objective for the swarm.')], context: Annotated[str, Field(default='', description="Optional workspace context or specific constraints to guide agent execution (default: '').")] = '') -> str:

Handler docstring from source:

Executes autonomous multi-agent swarm mission coordination.

jarvis_zero_key_query

Registered handler: _legacy_jarvis_zero_key_query
Decorator: tzero/tzero_mcp.py:1891
Implementation: tzero/tzero_mcp.py:1916-1935

Python signature:

def _legacy_jarvis_zero_key_query(prompt: Annotated[str, Field(description='Prompt, code question, or instruction for the Zero-Key intelligence engine.')], system_prompt: Annotated[str, Field(default='You are T-Zero Jarvis Autonomous Code Engineer.', description='System instruction context.')] = 'You are T-Zero Jarvis Autonomous Code Engineer.') -> str:

Handler docstring from source:

Queries the zero-key free AI inference engine.

        Args:
            prompt: User prompt or instruction.
            system_prompt: System role prompt.

prune_code_snippet

Registered handler: _legacy_prune_code_snippet
Decorator: tzero/tzero_mcp.py:1317
Implementation: tzero/tzero_mcp.py:1345-1373

Python signature:

def _legacy_prune_code_snippet(code: Annotated[str, Field(description='Raw source code content to prune.')], file_path_or_ext: Annotated[str, Field(default='snippet.py', description="File name or extension (e.g. 'service.ts', 'main.go', 'app.py', '.rs', '.java', '.cs', '.kt', '.swift') indicating language parser.")] = 'snippet.py', reduction_mode: Annotated[str, Field(default='ultra', description="Reduction tier: 'ultra' for AST signatures only (80-95% reduction), 'balanced' for signatures + control flow.")] = 'ultra') -> str:

Handler docstring from source:

Compresses code snippets into functional signatures on-the-fly.

        Args:
            code: Source code text to prune.
            file_path_or_ext: File name or extension (e.g. 'service.ts', 'main.go', 'app.py', '.rs', '.java', '.cs').
            reduction_mode: 'ultra' for AST signatures only, 'balanced' for signatures + control flow.

prune_schema_definition

Registered handler: _legacy_prune_schema_definition
Decorator: tzero/tzero_mcp.py:2624
Implementation: tzero/tzero_mcp.py:2650-2667

Python signature:

def _legacy_prune_schema_definition(content: Annotated[str, Field(description='Raw schema content (SQL DDL, Kubernetes YAML, Dockerfile, or Terraform HCL).')], schema_type_or_filename: Annotated[str, Field(default='schema.sql', description="Schema type ('sql', 'yaml', 'dockerfile', 'terraform') or filename with extension.")] = 'schema.sql', reduction_mode: Annotated[str, Field(default='ultra', description="Reduction tier: 'ultra' for pure interfaces (80-95% reduction), 'balanced' for interfaces + key attributes.")] = 'ultra') -> str:

Handler docstring from source:

Compresses database or infrastructure schema definitions on-the-fly.

query_architecture_boundaries

Registered handler: _legacy_query_architecture_boundaries
Decorator: tzero/tzero_mcp.py:551
Implementation: tzero/tzero_mcp.py:576-600

Python signature:

def _legacy_query_architecture_boundaries(project_root: Annotated[str, Field(default='.', description='Root directory of the repository where tzero.rules.json is located (default: current directory).')] = '.', extra_guidance: Annotated[str, Field(default='', description='Optional custom rules, architecture styles, or conventions to inject into the boundary definition.')] = '') -> str:

Handler docstring from source:

Generates architectural guardrails and boundary rules for AI agents.

        Args:
            project_root: Root directory of the repository (default: current directory).
            extra_guidance: Optional custom rules, architecture styles, or conventions.

query_module_dependencies

Registered handler: _legacy_query_module_dependencies
Decorator: tzero/tzero_mcp.py:444
Implementation: tzero/tzero_mcp.py:469-546

Python signature:

def _legacy_query_module_dependencies(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to scan (default: current directory).')] = '.', file_path: Annotated[str, Field(default='', description='Optional relative or absolute path to a specific file to inspect. If empty, analyzes the whole workspace.')] = '') -> str:

Handler docstring from source:

Analyzes dependency structure and import graphs.

        Args:
            project_root: Root directory of the repository (default: current directory).
            file_path: Optional relative or absolute path to a specific file to inspect. If empty, analyzes the whole workspace.

rank_repository_pagerank

Registered handler: _legacy_rank_repository_pagerank
Decorator: tzero/tzero_mcp.py:1575
Implementation: tzero/tzero_mcp.py:1600-1614

Python signature:

def _legacy_rank_repository_pagerank(project_root: Annotated[str, Field(default='.', description='Root directory of the repository to analyze (default: current directory).')] = '.', top_k: Annotated[int, Field(default=15, description='Number of top central modules to return in the ranking report (default: 15).')] = 15) -> str:

Handler docstring from source:

Computes PageRank architectural centrality scores for repository modules.

        Args:
            project_root: Root directory of the repository (default: current directory).
            top_k: Number of top central modules to return in the ranking report (default: 15).

search_codebase_semantic

Registered handler: _legacy_search_codebase_semantic
Decorator: tzero/tzero_mcp.py:1115
Implementation: tzero/tzero_mcp.py:1141-1150

Python signature:

def _legacy_search_codebase_semantic(query: Annotated[str, Field(description='Natural language or technical keyword query describing the desired code logic.')], project_root: Annotated[str, Field(default='.', description='Workspace root directory to index and search (default: current directory).')] = '.', top_k: Annotated[int, Field(default=5, description='Maximum number of top-matching code snippets to return (default: 5).')] = 5) -> str:

Handler docstring from source:

Performs private local hybrid semantic search across the codebase.

suggest_reusable_helpers

Registered handler: _legacy_suggest_reusable_helpers
Decorator: tzero/tzero_mcp.py:2848
Implementation: tzero/tzero_mcp.py:2876-2892

Python signature:

def _legacy_suggest_reusable_helpers(query: Annotated[str, Field(default='', description="Natural language task description, functionality needed, or function name (default: '').")] = '', code_snippet: Annotated[str, Field(default='', description='Optional code snippet being written to check for duplicate helper reimplementation.')] = '', project_root: Annotated[str, Field(default='.', description='Target repository root directory (default: current directory).')] = '.', top_k: Annotated[int, Field(default=5, description='Maximum number of reusable helpers to recommend (default: 5).')] = 5, include_body: Annotated[bool, Field(default=True, description='Whether to include full implementation bodies of suggested helpers.')] = True) -> str:

Handler docstring from source:

Discovers existing reusable helpers across codebase AST.

superdesign_extract_system

Registered handler: superdesign_extract_system
Decorator: tzero/tzero_mcp.py:3846
Implementation: tzero/tzero_mcp.py:3872-3884

Python signature:

def superdesign_extract_system(input_path_or_description: Annotated[str, Field(description='Description of visual styling, theme requirements, or image path to extract tokens from.')], system_name: Annotated[str, Field(default='tzero_design_system', description='Identifier for the design system (saved to superdesign/design_system/<name>.json).')] = 'tzero_design_system', workspace_path: Annotated[str, Field(default='.', description='Workspace root (default: current directory).')] = '.') -> str:

Handler docstring from source:

Extracts and saves structured design systems from screenshots or descriptions.

superdesign_gallery

Registered handler: superdesign_gallery
Decorator: tzero/tzero_mcp.py:3918
Implementation: tzero/tzero_mcp.py:3942-3948

Python signature:

def superdesign_gallery(workspace_path: Annotated[str, Field(default='.', description='Workspace directory root (default: current directory).')] = '.') -> str:

Handler docstring from source:

Generates an interactive HTML gallery to preview all created designs.

superdesign_generate

Registered handler: superdesign_generate
Decorator: tzero/tzero_mcp.py:3757
Implementation: tzero/tzero_mcp.py:3785-3801

Python signature:

def superdesign_generate(prompt: Annotated[str, Field(description="Description of what design to create (e.g. 'modern developer platform dashboard with analytics').")], design_type: Annotated[str, Field(default='ui', description="Type of design: 'ui' (full responsive web app), 'wireframe' (monochrome wireframe), 'component' (modular component), 'logo' (SVG logo), or 'icon' (SVG icon).")] = 'ui', variations: Annotated[int, Field(default=3, description='Number of variations to generate (1 to 5, default 3).')] = 3, framework: Annotated[str, Field(default='html', description="Component framework: 'html', 'react', or 'vue'.")] = 'html', workspace_path: Annotated[str, Field(default='.', description='Workspace directory root for output files (default: current directory).')] = '.') -> str:

Handler docstring from source:

Returns structured specifications for the AI coding agent to generate designs.

superdesign_iterate

Registered handler: superdesign_iterate
Decorator: tzero/tzero_mcp.py:3803
Implementation: tzero/tzero_mcp.py:3830-3844

Python signature:

def superdesign_iterate(design_file: Annotated[str, Field(description='Path to the existing HTML, SVG, or component design file to iterate on.')], feedback: Annotated[str, Field(description="Improvement instructions or feedback to apply (e.g. 'Refine card contrast and add responsive navbar').")], variations: Annotated[int, Field(default=1, description='Number of new iterative variations to generate (1 to 5).')] = 1, workspace_path: Annotated[str, Field(default='.', description='Workspace root (default: current directory).')] = '.') -> str:

Handler docstring from source:

Returns iteration instructions for the AI coding agent to refine existing designs.

superdesign_list

Registered handler: superdesign_list
Decorator: tzero/tzero_mcp.py:3886
Implementation: tzero/tzero_mcp.py:3910-3916

Python signature:

def superdesign_list(workspace_path: Annotated[str, Field(default='.', description='Workspace directory root (default: current directory).')] = '.') -> str:

Handler docstring from source:

Lists all Superdesign iterations and design systems in the workspace.

sync_workspace_rules

Registered handler: sync_workspace_rules
Decorator: tzero/tzero_mcp.py:3950
Implementation: tzero/tzero_mcp.py:3974-3989

Python signature:

def sync_workspace_rules(workspace_dir: Annotated[str, Field(default='.', description='Target repository root directory (default: current directory).')] = '.') -> str:

Handler docstring from source:

Synchronizes active codebase AST topologies and rules across Cursor, Claude, Windsurf, and Git hooks.

trace_symbol_call_chain

Registered handler: _legacy_trace_symbol_call_chain
Decorator: tzero/tzero_mcp.py:1619
Implementation: tzero/tzero_mcp.py:1645-1661

Python signature:

def _legacy_trace_symbol_call_chain(symbol_name: Annotated[str, Field(description='Function or method identifier to trace.')], project_root: Annotated[str, Field(default='.', description='Root directory of the repository.')] = '.', max_depth: Annotated[int, Field(default=3, description='Maximum recursive call graph traversal depth.')] = 3) -> str:

Handler docstring from source:

Traces upstream and downstream call chains for any function or method.

        Args:
            symbol_name: Function or method identifier to trace.
            project_root: Root directory of the repository (default: '.').
            max_depth: Maximum recursive call graph traversal depth (default: 3).

verify_hallucination_guard

Registered handler: _legacy_verify_hallucination_guard
Decorator: tzero/tzero_mcp.py:1482
Implementation: tzero/tzero_mcp.py:1508-1524

Python signature:

def _legacy_verify_hallucination_guard(proposed_code: Annotated[str, Field(description='Python code proposed to be written or edited.')], target_file: Annotated[str, Field(default='', description='Optional path of the target file being modified to resolve relative imports.')] = '', project_root: Annotated[str, Field(default='.', description='Workspace root directory providing the ground-truth AST symbol catalog (default: current directory).')] = '.') -> str:

Handler docstring from source:

Validates proposed code against workspace AST signatures and contracts.

        Args:
            proposed_code: Python code proposed to be written or edited.
            target_file: Optional path of the target file being modified.
            project_root: Root directory of the repository (default: current directory).

verify_zero_leak_security

Registered handler: _legacy_verify_zero_leak_security
Decorator: tzero/tzero_mcp.py:1378
Implementation: tzero/tzero_mcp.py:1404-1477

Python signature:

def _legacy_verify_zero_leak_security(project_root: Annotated[str, Field(default='.', description='Workspace root directory to scan for secret leaks (default: current directory).')] = '.', target_file: Annotated[str, Field(default='', description='Optional single file path to inspect instead of the full workspace.')] = '', code_snippet: Annotated[str, Field(default='', description='Optional in-memory code string to inspect instead of files on disk.')] = '') -> str:

Handler docstring from source:

Runs Zero-Leak secret detection audit across workspace or snippets.

Reading schemas safely

  • Treat the function parameters and Annotated/Field annotations as the source-level contract; inspect the actual tools/list payload for the installed server.
  • Validate required fields, defaults, and output shape against the live package and tests.
  • Some tools can write workspace files, run local commands, or contact configured services. Check the handler implementation and annotations before granting a client access.
  • Do not infer read-only behavior from the feature name.

Source of truth

tzero/tzero_mcp.py contains the registration decorators and handlers. The package version comes from pyproject.toml. The hosted Gradio OpenAPI file is separate; see MCP-and-OpenAPI.

Clone this wiki locally