Skip to main content
These four tools manage the lifecycle of a repository in SDL-MCP: registering it, checking its health, understanding its structure, and triggering re-indexing.
Call sdl.repo.status first in every session to confirm the index is current before doing deeper queries.

sdl.repo.register

Registers a new repository (or updates an existing one) for indexing. This is typically the first tool called when connecting a new codebase to SDL-MCP. Creates a repository record in the graph database with the given configuration. Auto-detects package.json, tsconfig.json, and workspace configuration. Validates that the root path exists and is not a path-traversal attempt.
Re-registering an existing repoId updates the configuration without losing indexed data. Registration does not trigger indexing — call sdl.index.refresh afterward.

Parameters

repoId
string
required
Unique identifier for the repository (e.g., "my-app").
rootPath
string
required
Absolute path to the repository root directory.
ignore
string[]
Glob patterns to ignore. Defaults to node_modules, dist, .next, build.
languages
string[]
Language extensions to index. Defaults to all 12 supported languages: ts, tsx, js, jsx, py, go, java, cs, c, cpp, php, rs, kt, sh.
maxFileBytes
number
Maximum file size to index in bytes. Default: 2,000,000.

Response

{
  "ok": true,
  "repoId": "my-app"
}

Example

{
  "repoId": "my-repo",
  "rootPath": "/workspace/my-repo",
  "ignore": ["node_modules", "dist"],
  "languages": ["typescript", "javascript"]
}

sdl.repo.status

Returns the current indexing state and health metrics for a registered repository. Provides a single-call snapshot of everything happening in the repository: file counts, symbol counts, health score, watcher state, prefetch stats, and live editor buffer status.

Parameters

repoId
string
required
Repository identifier.
surfaceMemories
boolean
Include relevant development memories in the response. Default: false.

Response

repoId
string
Repository identifier.
rootPath
string
Absolute path to the repository root.
latestVersionId
string | null
Most recent ledger version, or null if never indexed.
filesIndexed
number
Total files currently tracked.
symbolsIndexed
number
Total symbols in the graph.
lastIndexedAt
string | null
ISO timestamp of the most recent indexing.
healthScore
number
Composite health score from 0–100.
healthComponents
object
Breakdown of health score components.
healthAvailable
boolean
Whether health metrics are populated.
watcherHealth
object | null
File watcher state.
watcherNote
string
Guidance when watcher is inactive.
prefetchStats
object
Predictive prefetch metrics.
liveIndexStatus
object
Live editor buffer state.
memories
array | null
Relevant development memories auto-surfaced for this repo. Only present when surfaceMemories: true.

Example

{ "repoId": "my-repo" }

sdl.repo.overview

Returns a token-efficient summary of the entire codebase structure, tunable from a cheap stats-only view up to a full architectural overview with hotspots, clusters, and process call-chain summaries.
Start with level: "stats" (~100 tokens). Escalate to "directories" or "full" only when you need deeper structure.

Parameters

repoId
string
required
Repository identifier.
level
'stats' | 'directories' | 'full'
required
Detail level. "stats" is cheapest (~100 tokens). "directories" adds per-directory summaries. "full" adds hotspots and architecture.
includeHotspots
boolean
Force hotspot inclusion at any level. Auto-enabled at "full".
directories
string[]
Filter to specific directory paths.
maxDirectories
number
Limit the number of directories returned. Range: 1–200.
maxExportsPerDirectory
number
Limit exports listed per directory. Range: 1–50.

Response

stats
object
Aggregate codebase statistics.
directories
array
Per-directory summaries. Present when level is "directories" or "full".
hotspots
object
Codebase hotspot analysis. Present at "full" level or when includeHotspots: true.
clusters
object
Community detection summary.
processes
object
Call-chain process summary.
tokenMetrics
object
Token compression metrics.

Examples

{ "repoId": "my-repo", "level": "stats" }

sdl.index.refresh

Triggers re-indexing of a repository in either full or incremental mode. Scans for changed files, parses them, extracts symbols and edges, runs pass-2 call resolution, and writes results to the graph database. Creates a new ledger version and clears slice and card caches. Supports MCP progress notifications.
Incremental mode compares file content hashes to detect changes — only changed files are re-parsed. After indexing, all slice caches and card caches are invalidated.

Parameters

repoId
string
required
Repository identifier.
mode
'full' | 'incremental'
required
"full" re-indexes everything; "incremental" only processes files changed since the last index.
reason
string
Optional reason for the refresh (logged for audit purposes).

Response

ok
boolean
Success flag.
repoId
string
Repository identifier.
versionId
string
The new ledger version ID created by this indexing run.
changedFiles
number
Number of files processed during this run.

Example

{ "repoId": "my-repo", "mode": "incremental", "reason": "post-edit refresh" }

Build docs developers (and LLMs) love