MCP Tools Reference
Complete reference for all 18 MCP tools available in Semfora Engine. Tools marked as "Recommended" are the best starting points for common workflows.
get_contextRecommendedContextGet quick git and project context in ~200 tokens. Use this FIRST when starting work on a repository to understand: current branch, last commit, index status, and project type.
get_overviewRecommendedContextGet the repository overview from a pre-built sharded index. Returns a compact summary with framework detection, module list (max 30), risk breakdown, and entry points.
get_languagesContextGet all programming languages supported by semfora-engine for semantic analysis.
server_statusContextGet server status including mode, features, and optionally detailed layer status. Requires persistent mode for layer details.
analyzeRecommendedAnalysisUnified analysis: auto-detects file, directory, or module. For files: extracts semantic info. For directories: returns overview with module grouping. For modules: returns detailed semantic info from index. Supports line ranges for large files.
analyze_diffRecommendedAnalysisUse for code reviews - analyzes changes between git branches or commits semantically. Shows new/modified symbols, changed dependencies, and risk assessment. Use target_ref='WORKING' for uncommitted changes. Supports pagination.
searchRecommendedSearchUnified search - runs BOTH symbol and semantic search by default (hybrid mode). Returns symbol matches AND conceptually related code in one call. Use mode='symbols' for exact name, mode='semantic' for BM25, or mode='raw' for regex patterns.
get_symbolSymbolsGet detailed semantic information for symbol(s). Three modes: (1) Single hash: use symbol_hash. (2) Batch: use hashes array (max 20). (3) Location: use file+line to find symbol at that position.
get_sourceRecommendedSymbolsGet source code for symbol(s) or line range. Three modes: (1) Batch: use hashes array (max 20, most efficient). (2) Single hash: use symbol_hash. (3) File+lines: use file_path with start_line/end_line.
get_fileSymbolsGet symbols from a file or module (mutually exclusive). Use file_path for file-centric view, or module for module-centric view. Returns lightweight index entries with optional source snippets. Max 200 results.
get_callersRecommendedCall GraphUse before modifying existing code to understand impact radius. Answers 'what functions call this symbol?' Shows what will break if you change this function. Returns direct callers with optional depth control (max 3, max 50 results).
get_callgraphCall GraphUnderstand code flow and dependencies between functions. Use with filters (module, symbol) for targeted analysis - unfiltered output can be very large (max 2000 edges). Set export='sqlite' to export to SQLite database with batching.
validateRecommendedQualityUnified quality audit - validates complexity, duplicates, and impact radius. Auto-detects scope: provide symbol_hash OR file_path+line for single symbol, file_path alone for all symbols in file, or module for module-level validation. Max 500 symbols.
find_duplicatesQualityUnified duplicate detection. Codebase scan (default): Find all duplicate clusters for health audits (max 200 clusters). Single symbol check: Pass symbol_hash to check one symbol before writing new code or during refactoring.
indexRecommendedIndexingUnified index management - smart refresh by default (checks freshness, rebuilds only if stale within max_age). Use force=true to always regenerate. Returns index status and statistics. Supports incremental indexing.
testTestingUnified test runner - runs tests by default (auto-detects framework: pytest, cargo, npm, vitest, jest, go). Use detect_only=true to only detect available test frameworks without running. Supports filtering and timeout control.
lintRecommendedLintingUnified linter - auto-detects and runs linters across 26 linters and 16 languages. Use detect_only=true to list available linters. Use mode='fix' to auto-fix issues. Supports severity filtering and safety controls.
prep_commitRecommendedCommitPrepare information for writing a commit message. Gathers git context, analyzes staged and unstaged changes semantically, and returns a compact summary with optional complexity metrics. This tool NEVER commits - it only provides information.
Recommended Workflows
Starting with a New Codebase
Use these tools in order to understand a new repository:
get_context— Quick orientation (~200 tokens)get_overview— Architecture and modules (max 30)search— Find specific functionality (hybrid mode)get_source— Read the code with context
Code Review
Analyze changes before merging:
analyze_diffwithbase_ref="main"— See all changes with paginationget_callers— Check impact of modified functions (max depth 3)validate— Run quality checks on changed fileslint— Auto-detect and run linters with fix mode
Before Modifying Code
Understand impact before making changes:
search— Find the function to modify (hybrid mode)get_callers— See what depends on it (up to 50 callers)find_duplicates— Check for similar code to updatevalidate— Check current complexity before changes
Codebase Health Audit
Assess code quality across the repository:
get_overview— Get module list and risk breakdownvalidatewithmodule— Check complexity per module (max 500 symbols)find_duplicates— Identify code duplication (max 200 clusters)lint— Run 26+ linters across 16 languagestest— Detect and run available test frameworks
Performance & Optimization
Optimize development workflows:
index— Smart refresh with incremental indexingget_callgraph— Export to SQLite for large analysis (max 2000 edges)server_status— Check persistent mode and layer statusprep_commit— Semantic commit analysis with metrics
Usage Tips
Start with Context
Always use get_context first when working with a new repository. It provides git status, branch info, and project type in ~200 tokens.
Unified Tools are More Efficient
Tools like search (hybrid mode), analyze (auto-detect), and validate (scope detection) combine multiple operations into one call, saving tokens and round-trips.
Check Impact Before Changes
Use get_callers before modifying functions to understand what code depends on them (max depth 3, up to 50 results) and might break.
Use Hashes from Results
Search results return symbol hashes. Use these directly with get_symbol, get_source (batch up to 20), or get_callers instead of re-searching.
Pagination for Large Results
Use pagination with analyze_diff (limit/offset), find_duplicates (max 200 clusters), and get_callgraph (max 2000 edges) for better performance.
Smart Index Management
The index tool uses smart refresh by default - only rebuilds if stale. Use force=true for complete regeneration or enable incremental indexing for large codebases.