cli

v0.19.0
@ctxo/cli Checked 16 hours ago Published 21 days ago

MCP server delivering dependency-aware, history-enriched context for codebases

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_logic_slice

Retrieve a symbol and all its transitive dependencies as a Logic-Slice. Use this when you need to UNDERSTAND what a symbol depends on (downstream view). L1=signature only, L2=direct deps, L3=full closure, L4=with token budget and symbol annotations (attributes, columns; only L4 includes them). Use `intent` to filter dependencies by keyword (e.g., "core", "adapter"). All responses include `_meta` with item counts and truncation info. For impact analysis (what BREAKS if this changes), use get_blast_radius instead. For task-specific context, use get_context_for_task. With @ctxo/domain and a regis…

ParameterTypeDescription
intentstringFilter dependencies by intent keywords (e.g., "core", "adapter")
levelnumberDetail level (L1=signature, L2=direct deps, L3=full closure, L4=with token budget and annotations)
symbolIdstringSingle symbol ID (format: file::name::kind; a SQL table, view or procedure also as name::kind, for example dbo.loans::table)
symbolIdsarrayBatch: array of symbol IDs

get_why_context

Retrieve git commit history intent and anti-pattern warnings (reverts, rollbacks) for a symbol. Use this when you need to understand WHY code was written this way or whether it has a history of problems. Pair with get_change_intelligence for complexity/churn scores. With @ctxo/domain and a registry, `contextDrift` reports the named context of the symbol: its share of cross-context edges over time and files that moved between contexts. With @ctxo/domain and a domain graph, `decisions` lists up to five card decisions of the context of the symbol with their provenance, those naming a rule linked…

ParameterTypeDescription
symbolId *stringThe symbol ID (format: file::name::kind; a SQL table, view or procedure also as name::kind, for example dbo.loans::table)
maxCommitsintegerLimit commit history to N most recent commits

get_change_intelligence

Retrieve complexity x churn composite score for a symbol — identifies hotspots that are both complex and frequently changed. Use this to prioritize refactoring targets or assess risk before modifying code. For git history details, use get_why_context. For impact scope, use get_blast_radius.

ParameterTypeDescription
symbolId *stringThe symbol ID (format: file::name::kind)

get_blast_radius

BEFORE modifying any symbol (a function, class, method or type, or a SQL table, view or procedure), call this to understand impact. Returns every symbol that depends on the target, directly or transitively, with risk scores that fall with depth. `overallRiskScore` is `sum / (sum + 5)` over those scores and never reaches 1: above 0.7 is high (about 12 direct dependents), above 0.3 medium (about 3). Each dependent is in the tier of its strongest edge: confirmed (`calls`, `extends`, `implements` and the data edges `reads`, `writes`, `executes`), likely (co-changed or `uses`), and potential (`impo…

ParameterTypeDescription
symbolId *stringThe symbol ID (format: file::name::kind; a SQL table, view or procedure also as name::kind, for example dbo.loans::table). Every definition of a SQL object, and its name::kind id, has the same depende…
confidencestringFilter by confidence tier
intentstringFilter impacted symbols by intent keywords (e.g., "test", "adapter")

get_architectural_overlay

Get the project architecture map. mode "both" (default) returns the regex layer map (Domain, Infrastructure, Adapter, Test, Composition, Configuration) plus data-driven Louvain communities; "regex" or "communities" returns one of them. mode "contexts" returns candidate bounded contexts computed by `ctxo index`: file-level clusters of dependencies and co-change with hub files damped. The summary lists every candidate with label, size, cohesion and top terms, plus hubs and name collisions (type names whose shapes differ between candidates). Use this when onboarding to a new codebase, validating…

ParameterTypeDescription
candidateintegerWith mode "contexts": the id of one candidate to return in full (files, terms, cross edges, co-change pairs, its hubs and collisions); omit for the summary of all candidates
layerstringFilter by specific layer name
modestringView to return: "both" (default) layers plus communities, "regex" layer map, "communities" Louvain clusters, "contexts" candidate contexts (file level)

find_dead_code

Find unreachable symbols and files that are never imported or called anywhere. Use this during cleanup, refactoring, or before deleting code to confirm it is truly unused. Symbols in .sql files are never reported. Use `intent` to filter results by keyword (e.g., "adapter", "function"). Large results are auto-truncated with `_meta`. For reverse dependency lookup of a specific symbol, use find_importers instead.

ParameterTypeDescription
includeTestsbooleanInclude test files (default test globs and files with a test-framework annotation such as @Test) in analysis (default: exclude)
intentstringFilter dead code results by intent keywords (e.g., "adapter", "function")

get_context_for_task

Get task-optimized context for a symbol based on what you are about to do. Specify taskType: "fix" (bug investigation - includes history + anti-patterns), "extend" (add feature - includes deps + blast radius), "refactor" (restructure - includes importers + complexity), or "understand" (learn - includes full slice + architecture). Context entries that depend on the symbol (its blast radius) carry an optional `confidence` tier: confirmed, likely or potential, where co-change history can raise potential to likely. This is the BEST starting point when you know both the symbol and your intent. With…

ParameterTypeDescription
symbolId *stringThe symbol ID (format: file::name::kind; a SQL table, view or procedure also as name::kind, for example dbo.loans::table)
taskType *stringTask type determines which context is most relevant
tokenBudgetnumberMax tokens for context (default 4000)

get_ranked_context

Search and rank symbols by relevance to a natural language query, packed within a token budget. Uses BM25 text matching + PageRank importance scoring. Results include `_meta` with truncation info. Use this when you have a question or topic but do not know which specific symbol to look at. For exact symbol name search, use search_symbols instead.

ParameterTypeDescription
query *stringSearch query (matches symbol names)
searchModestring"fts" (default): BM25 ranking with camelCase splitting, trigram fallback and typo correction; "legacy": substring matching; strategy "importance" always uses legacy matching
strategystringRanking strategy
tokenBudgetnumberMax tokens for results (default 4000)

search_symbols

Search symbols by exact name or regex pattern across the codebase index. Use this when you know (part of) the symbol name and need to find its ID for use with other tools. For semantic/relevance-based search, use get_ranked_context instead. With @ctxo/domain and a registry, each result carries `context` (its named context id).

ParameterTypeDescription
pattern *stringSearch pattern (substring or regex)
filePatternstringFilter by file path substring
kindstringFilter by symbol kind (table, view and procedure come from SQL plugins)
limitintegerMax results (default 25)
modestring"regex" (default): case-insensitive regex or substring match on names; "fts": BM25 relevance search

get_changed_symbols

Get symbols in recently changed files based on git diff. Use this to see what was modified in recent commits. For full PR risk assessment (changed symbols + blast radius + co-changes), use get_pr_impact instead.

ParameterTypeDescription
maxFilesintegerMax changed files to process (default 50)
sincestringGit ref to diff against (default HEAD~1)

find_importers

Find all symbols that import or depend on a given symbol (reverse dependency / "who uses this?"). Use this to check if a symbol is safe to modify or delete. Supports transitive traversal for deep impact chains. Use `intent` to filter by keyword (e.g., "test", "core"). For forward dependencies (what this symbol uses), use get_logic_slice. For aggregated impact with risk scores, use get_blast_radius. With @ctxo/domain and a registry, each importer carries `context` (its named context id).

ParameterTypeDescription
symbolId *stringThe symbol ID (format: file::name::kind; a SQL table, view or procedure also as name::kind, for example dbo.loans::table). Every definition of a SQL object, and its name::kind id, has the same importe…
edgeKindsarrayFilter by edge kinds (reads, writes and executes are data access)
intentstringFilter importers by intent keywords (e.g., "test", "core", "adapter")
maxDepthintegerMax BFS depth for transitive mode (default 5)
transitivebooleanFollow transitive reverse edges (default false)

get_class_hierarchy

Get class inheritance hierarchy — ancestors (extends/implements chain) and descendants (subclasses). Use this when working with OOP code to understand type relationships before modifying a base class or interface. For dependency-based relationships (imports/calls), use get_logic_slice or find_importers.

ParameterTypeDescription
directionstringTraversal direction (default both)
symbolIdstringRoot symbol ID (omit for full project hierarchy)

get_symbol_importance

Rank symbols by structural importance using PageRank centrality on the dependency graph. Use this to identify the most critical symbols in the codebase — high-PageRank symbols are heavily depended upon and risky to change. For finding unused/unimportant code, use find_dead_code instead.

ParameterTypeDescription
dampingnumberPageRank damping factor (default 0.85)
filePatternstringFilter by file path substring
kindstringFilter by symbol kind (table, view and procedure come from SQL plugins)
limitintegerMax results (default 25)

get_pr_impact

Analyze the full impact of a PR or recent changes in a SINGLE call: combines changed symbols + blast radius + co-change history into one risk assessment. `riskLevel` is high when a changed symbol's blast-radius `overallRiskScore` is above 0.7 (about 12 direct dependents), medium above 0.3 (about 3), else low. Results include `_meta` with truncation info. Use this FIRST when reviewing a PR or evaluating recent commits. For single-symbol analysis, use get_blast_radius instead. With @ctxo/domain and a registry, changed symbols carry `context` and `contextBoundaryViolations` lists edges that touch…

ParameterTypeDescription
confidencestringFilter impacted symbols by confidence tier
maxFilesintegerMax changed files to analyze
sincestringGit ref to diff against (default HEAD~1)