Six MCP tools, short answers.
Lattice gives coding agents structural answers from the stored graph: what a symbol is, what calls it, what it calls, and what breaks if it changes. Every response carries signatures and file:line locations, never file bodies.
What each one returns.
| Tool | Returns |
|---|---|
context(symbol) | Signature, first docstring line, exact location, decorators, direct callers, direct callees, and metrics (depth, PageRank, fan-in, fan-out) for one symbol. Accepts a partial name such as EngramRecorder.record. |
impact(symbol, max_hops) | Everything that transitively depends on a symbol, grouped by hop distance. Run it before editing. |
search(query, kind?) | Symbols whose names match, ranked by PageRank so the central match sorts first, each with its location. |
overview(module) | A module's public surface and its dependencies, to orient in an unfamiliar package. |
code_instrument(symbol, max_hops, revision, supersedes?) | A complete Chirp message candidate (a PubMark Instrument) carrying exact graph evidence for one symbol. Lattice never sends it, it contains no executable action, and it reports its graph audit as incomplete until unresolved edges are reviewed. |
verify_blueprint(path) | Compares a PubMark Code Blueprint's declared files and architecture with the indexed graph and reports contract, evidence, coverage, and drift, keeping declaration, observation, and verification separate. It never runs code from the blueprint and never writes the analyzed repository. |
The same queries are also available at /api/v1 on Lattice's local backend and as lattice command-line subcommands.
Four responses from the sample codebase.
These are the JSON documents Lattice returns for StrataForge Robotics' made-up control, recording, and mesh code. They were produced with the lattice command line, which runs the same query functions as the MCP tools, and are shown unedited. Nothing here comes from a Renkara repository.
context
lattice context EngramRecorder.record{
"qualified_name": "engram_fabric.recorder.EngramRecorder.record",
"repo": "strataforge-robotics",
"head_commit": null,
"kind": "method",
"signature": "def record(self, meta: dict[str, float], experience: list[float]) -> CognitiveFrame",
"location": "engram_fabric/recorder.py:32-45",
"docstring": "Capture one moment at the density its novelty earns.",
"decorators": [],
"is_entry_point": false,
"callers": [
{
"name": "dom_control.loop.ControlLoop._record",
"at": "dom_control/loop.py:87",
"confidence": 1.0
},
{
"name": "engram_fabric.api.handler",
"at": "engram_fabric/api.py:39",
"confidence": 1.0
}
],
"callees": [
{
"name": "engram_fabric.density.DensityController.adjust",
"at": "engram_fabric/density.py:36",
"confidence": 1.0
},
{
"name": "engram_fabric.layers.CognitiveFrame",
"at": "engram_fabric/layers.py:37",
"confidence": 1.0
},
{
"name": "engram_fabric.layers.ExperientialLayer.thin",
"at": "engram_fabric/layers.py:41",
"confidence": 1.0
},
{
"name": "engram_fabric.layers.MetaCognitiveLayer.keep",
"at": "engram_fabric/layers.py:40",
"confidence": 1.0
},
{
"name": "engram_fabric.novelty.NoveltyDetector.observe",
"at": "engram_fabric/novelty.py:35",
"confidence": 1.0
},
{
"name": "engram_fabric.recorder.EngramRecorder._frame_kbps",
"at": "engram_fabric/recorder.py:36",
"confidence": 1.0
},
{
"name": "engram_fabric.store.EngramStore.write_frame",
"at": "engram_fabric/store.py:43",
"confidence": 1.0
},
{
"name": "sf_core.clock.Clock.now_ns",
"at": "sf_core/clock.py:39",
"confidence": 1.0
},
{
"name": "sf_core.telemetry.TelemetrySink.emit",
"at": "sf_core/telemetry.py:44",
"confidence": 1.0
}
],
"metrics": {
"topo_depth": 1,
"pagerank": 0.008188,
"in_degree": 2,
"out_degree": 9
},
"alternatives": []
} One symbol: where it lives, who calls it, what it calls, and how central it is. A response like this is a few hundred tokens.
impact
lattice impact sf_core.units.clamp --hops 2{
"target": "sf_core.units.clamp",
"max_hops": 2,
"total_affected": 21,
"by_hop": {
"1": [
{
"name": "dom_control.actuators.MyoformActuator.apply",
"kind": "method",
"at": "dom_control/actuators.py:20"
},
{
"name": "dom_control.pid.PidController._anti_windup",
"kind": "method",
"at": "dom_control/pid.py:31"
},
{
"name": "dom_control.pid.PidController.step",
"kind": "method",
"at": "dom_control/pid.py:22"
},
{
"name": "engram_fabric.density.DensityController.adjust",
"kind": "method",
"at": "engram_fabric/density.py:22"
},
{
"name": "engram_fabric.novelty.NoveltyDetector.score",
"kind": "method",
"at": "engram_fabric/novelty.py:22"
},
{
"name": "robomesh5.link.LinkQuality.record",
"kind": "method",
"at": "robomesh5/link.py:18"
},
{
"name": "sf_core.config.load_config",
"kind": "function",
"at": "sf_core/config.py:33"
},
{
"name": "sf_core.units.lerp",
"kind": "function",
"at": "sf_core/units.py:13"
},
{
"name": "soulcore.affect.smooth_arousal",
"kind": "function",
"at": "soulcore/affect.py:8"
}
],
"2": [
{
"name": "dom_control.actuators.ActuatorBank.drive_joint",
"kind": "method",
"at": "dom_control/actuators.py:43"
},
{
"name": "dom_control.api.loop_for",
"kind": "function",
"at": "dom_control/api.py:17"
},
{
"name": "dom_control.cli.calibrate",
"kind": "function",
"at": "dom_control/cli.py:22"
},
{
"name": "dom_control.cli.run_loop",
"kind": "function",
"at": "dom_control/cli.py:15"
},
{
"name": "dom_control.loop.ControlLoop._compute",
"kind": "method",
"at": "dom_control/loop.py:74"
},
{
"name": "dom_control.planner.TrajectoryPlanner.targets",
"kind": "method",
"at": "dom_control/planner.py:29"
},
{
"name": "engram_fabric.density.DensityController.target_density",
"kind": "method",
"at": "engram_fabric/density.py:18"
},
{
"name": "engram_fabric.novelty.NoveltyDetector.observe",
"kind": "method",
"at": "engram_fabric/novelty.py:30"
},
{
"name": "engram_fabric.recorder.EngramRecorder.record",
"kind": "method",
"at": "engram_fabric/recorder.py:32"
},
{
"name": "robomesh5.link.RadioLink.send",
"kind": "method",
"at": "robomesh5/link.py:32"
},
{
"name": "soulcore.adapter.SoulCoreAdapter.gain",
"kind": "method",
"at": "soulcore/adapter.py:25"
},
{
"name": "soulcore.adapter.SoulCoreAdapter.observe",
"kind": "method",
"at": "soulcore/adapter.py:20"
}
]
}
} Blast radius of a shared helper, grouped by hop distance.
search
lattice search novelty[
{
"name": "engram_fabric.novelty.NoveltyDetector.distance",
"kind": "method",
"signature": "def distance(self, features: list[float]) -> float",
"at": "engram_fabric/novelty.py:18",
"pagerank": 0.004685,
"topo_depth": 4
},
{
"name": "engram_fabric.novelty.NoveltyDetector.score",
"kind": "method",
"signature": "def score(self, features: list[float]) -> float",
"at": "engram_fabric/novelty.py:22",
"pagerank": 0.004363,
"topo_depth": 3
},
{
"name": "engram_fabric.novelty.NoveltyDetector.update_baseline",
"kind": "method",
"signature": "def update_baseline(self, features: list[float]) -> None",
"at": "engram_fabric/novelty.py:26",
"pagerank": 0.004363,
"topo_depth": 3
},
{
"name": "engram_fabric.novelty.NoveltyDetector.observe",
"kind": "method",
"signature": "def observe(self, features: list[float]) -> float",
"at": "engram_fabric/novelty.py:30",
"pagerank": 0.003604,
"topo_depth": 2
},
{
"name": "engram_fabric.novelty.NoveltyDetector",
"kind": "class",
"signature": "class NoveltyDetector",
"at": "engram_fabric/novelty.py:12",
"pagerank": 0.003288,
"topo_depth": 3
},
{
"name": "engram_fabric.novelty",
"kind": "module",
"signature": null,
"at": "engram_fabric/novelty.py:1",
"pagerank": 0.002831,
"topo_depth": null
}
] Matches ranked by PageRank, with locations.
overview
lattice overview robomesh5.node{
"module": "robomesh5.node",
"public_symbols": [
{
"name": "robomesh5.node.MeshNode.peer_ids",
"kind": "method",
"signature": "def peer_ids(self) -> list[str]",
"at": "robomesh5/node.py:67"
},
{
"name": "robomesh5.node.MeshNode.send_message",
"kind": "method",
"signature": "def send_message(self, destination: str, kind: str, body: dict[str, float]) -> bool",
"at": "robomesh5/node.py:28"
},
{
"name": "robomesh5.node.MeshNode.expire_peers",
"kind": "method",
"signature": "def expire_peers(self) -> list[str]",
"at": "robomesh5/node.py:76"
},
{
"name": "robomesh5.node.MeshNode.tick",
"kind": "method",
"signature": "def tick(self) -> int",
"at": "robomesh5/node.py:56"
},
{
"name": "robomesh5.node.MeshNode.mean_link_quality",
"kind": "method",
"signature": "def mean_link_quality(self) -> float",
"at": "robomesh5/node.py:71"
},
{
"name": "robomesh5.node.MeshNode.on_frame",
"kind": "method",
"signature": "def on_frame(self, frame: MeshFrame) -> None",
"at": "robomesh5/node.py:39"
},
{
"name": "robomesh5.node.MeshNode",
"kind": "class",
"signature": "class MeshNode",
"at": "robomesh5/node.py:18"
},
{
"name": "robomesh5.node.build_node",
"kind": "function",
"signature": "def build_node(unit_id: str, clock: Clock, sink: TelemetrySink) -> MeshNode",
"at": "robomesh5/node.py:81"
}
],
"entry_points": [],
"imports": [
"dataclasses.dataclass",
"__future__.annotations",
"robomesh5.frames.MeshFrame",
"robomesh5.gossip.GossipProtocol",
"robomesh5.link.RadioLink",
"robomesh5.peers.PeerTable",
"robomesh5.routing.MeshRouter",
"sf_core.clock.Clock",
"sf_core.telemetry.TelemetrySink"
]
} A module's surface and its dependencies.
Each edge says how it was found.
Callers and callees carry a confidence. Edges at 1.0 were resolved from scope, imports, self, or declared types. An edge at 0.5 is a unique-name guess and is marked as heuristic. Calls Lattice cannot resolve are not invented: they are recorded as unresolved, so a missing caller can mean the call is dynamic or untyped, not that nobody calls the symbol. How resolution works.