What a Card Looks Like
Here is a complete symbol card for avalidateToken function:
Field Reference
| Field | Description |
|---|---|
| kind | Symbol type: function, class, interface, type, variable, method, etc. Exported symbols are flagged. |
| file | File path and line range (src/auth/jwt.ts:42-67). |
| signature | Full call signature including parameter names, types, return type, generics, and overloads. |
| summary | 1–2 line semantic description. Generated by LLM during indexing or extracted from JSDoc/docstrings. |
| invariants | Preconditions and postconditions the symbol enforces (e.g., "throws on expired token"). |
| side effects | Observable effects beyond the return value (e.g., "logs to audit trail"). |
| deps.calls | Symbols this symbol calls, with confidence scores. |
| deps.imports | Modules and symbols this symbol imports. |
| metrics.fan-in | Number of distinct symbols that call this one. High fan-in means high blast radius on change. |
| metrics.fan-out | Number of distinct symbols this one calls. High fan-out means broad dependencies. |
| metrics.churn | Number of times this symbol changed in the last 30 days. |
| cluster | Community detection group membership. Symbols in the same cluster are architecturally related. |
| process | Named call chain this symbol participates in, plus its role (entry, intermediate, or exit) and depth. |
| test proximity | Nearest test file, hop distance, and a proximity score (0–1). |
| ETag | Content-addressed hash for conditional requests. Unchanged symbols return 304 Not Modified. |
Confidence-Scored Call Resolution
Thedeps.calls field is produced by SDL-MCP’s two-pass resolver, which traces imports, aliases, barrel re-exports, and tagged templates to produce accurate dependency edges. Each edge carries a confidence score:
- 1.0 — Directly resolved to a single symbol with no ambiguity
- 0.7–0.9 — Resolved through an alias or re-export chain
- 0.4–0.6 — Resolved through a barrel export with multiple candidates
- < 0.4 — Unresolved or highly ambiguous (filtered by default)
minConfidence or minCallConfidence to keep the result tight.
Community Detection (Cluster Membership)
SDL-MCP runs community detection over the symbol graph to identify architectural clusters — groups of symbols that are densely connected to each other and loosely connected to the rest of the codebase. Thecluster field on a card tells you:
- Which cluster the symbol belongs to (by name, e.g.,
auth-module) - How many members are in that cluster
Call-Chain Tracing (Process Participation)
Theprocess field reveals which named call chains (“processes”) a symbol participates in and its role within each:
- entry — The symbol initiates the call chain (e.g., an HTTP handler)
- intermediate — The symbol is called by entry symbols and calls exit symbols (e.g.,
validateTokenat depth 1 inrequest-pipeline) - exit — The symbol terminates the call chain (e.g., a database write or external API call)
ETag-Based Conditional Requests
Every card has a content-addressed ETag — a hash of the symbol’s semantic content. When requesting cards you already have:{ "notModified": true } — zero tokens spent on an unchanged card. For batch requests via sdl.symbol.getCards, pass knownCardEtags as a map of symbol ID to ETag to skip all unchanged cards in a single call.
Getting Cards
- Single card
- Batch fetch
- Via search
- Via slice
Fetch one card by symbol ID:
Why Cards vs. Reading Files
| Symbol Card | Raw File | |
|---|---|---|
| Token cost | ~100 | ~2,000 |
| Contains signature | Yes | Yes (buried) |
| Contains summary | Yes | No |
| Contains invariants | Yes | No |
| Contains side effects | Yes | No |
| Dependency graph | Yes (confidence-scored) | No |
| Metrics (fan-in, churn) | Yes | No |
| Cluster membership | Yes | No |
| Call-chain role | Yes | No |
| Test proximity | Yes | No |
| ETag caching | Yes | No |
The ~100 token estimate is for a typical function card. Large classes with many methods and overloads can be larger, but they are always dramatically smaller than reading the source file.