Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Source: [`crates/konnect-core/src/observability.rs`](crates/konnect-core/src/obs

## Tool Routing (Starter Kit + On-Demand Loading)

The server does NOT expose all 224 tools (231 total with the 7 meta-tools) in `tools/list` by default — that would cost ~23K tokens of context on every listing. Instead:
The server does NOT expose all 225 tools (232 total with the 7 meta-tools) in `tools/list` by default — that would cost ~23K tokens of context on every listing. Instead:

- **Startup**: only `STARTER_KIT` toolsets are pre-loaded (see `router/registry.rs::STARTER_KIT`). Currently: `project`, `config`. Combined with the 7 meta-tools, baseline `tools/list` is 21 tools ≈ 2K tokens.
- **On demand**: the LLM reads `list_toolboxes` → calls `load_toolset(name)` to expose a toolset's tools in subsequent `tools/list` responses. `unload_toolset(name)` prunes them when the task shifts.
Expand Down Expand Up @@ -395,9 +395,9 @@ convention for other `kicad-cli`-calling code.

## Current Stats

- **21 toolsets, 224 tools** + 7 meta-tools (4 routing + 2 observability + 1 runtime diagnostic — see `tool-directory.md`)
- **21 toolsets, 225 tools** + 7 meta-tools (4 routing + 2 observability + 1 runtime diagnostic — see `tool-directory.md`)
- Baseline `tools/list`: 21 tools / ~2K tokens (starter kit + meta-tools)
- Full-catalog `tools/list` (all loaded): 231 tools (224 registered + 7 meta) / ~25K tokens
- Full-catalog `tools/list` (all loaded): 232 tools (225 registered + 7 meta) / ~25K tokens
- **0 IPC stubs** (all protobuf methods implemented)
- **0 unimplemented tools**
- **Specctra DSN/SES are PCB-editor operations**, not `kicad-cli` commands.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Rust binary — that lets Claude and other AI assistants design schematics and PCBs
through the [Model Context Protocol](https://modelcontextprotocol.io) (MCP).

**224 tools across 21 on-demand toolsets.** Schematic capture, PCB layout and
**225 tools across 21 on-demand toolsets.** Schematic capture, PCB layout and
routing, ERC/DRC, design-review audits, JLCPCB part search, reference
circuits, and a full manufacturing export pipeline — with bundled skills and agents
that teach Claude KiCAD conventions out of the box.
Expand Down Expand Up @@ -70,7 +70,7 @@ through its own S-expression engine with atomic writes (write, fsync, rename), U
preservation, and round-trip tests — no third-party schematic library with known
gaps, no text-manipulation workarounds.

**Context economy is a feature.** Exposing all 224 tools to an LLM costs roughly 23K
**Context economy is a feature.** Exposing all 225 tools to an LLM costs roughly 23K
tokens of context on every listing. Konnect's router loads a starter kit (~2K
tokens) and lets the model pull in toolsets on demand — plus built-in observability
(`get_recent_calls`, `server_stats`, JSONL call logs) so the model can diagnose its
Expand Down
15 changes: 15 additions & 0 deletions crates/konnect-core/src/mcp/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ pub enum ToolErrorKind {
capability: String,
kicad_version: Option<String>,
},
/// KiCad accepted a semantic mutation, but a fresh observation did not
/// prove the exact requested post-operation state.
ReadbackMismatch {
operation: String,
requested_kiids: Vec<String>,
before_kiids: Vec<String>,
after_kiids: Vec<String>,
},
/// A board was live earlier in this server process, but IPC is now gone;
/// its saved file may be stale relative to lost editor state.
UnsafeFileFallback { path: String, reason: String },
Expand Down Expand Up @@ -117,6 +125,7 @@ impl ToolErrorKind {
Self::StaleTarget { .. } => "stale_target",
Self::EditorUnavailable { .. } => "editor_unavailable",
Self::UnsupportedCapability { .. } => "unsupported_capability",
Self::ReadbackMismatch { .. } => "readback_mismatch",
Self::UnsafeFileFallback { .. } => "unsafe_file_fallback",
Self::AmbiguousOpenBoard { .. } => "ambiguous_open_board",
Self::HandlerError { .. } => "handler_error",
Expand Down Expand Up @@ -270,6 +279,12 @@ mod tests {
capability: "activate_sheet".into(),
kicad_version: Some("10.0.5".into()),
},
ToolErrorKind::ReadbackMismatch {
operation: "add".into(),
requested_kiids: vec!["b".into()],
before_kiids: vec!["a".into()],
after_kiids: vec!["a".into()],
},
ToolErrorKind::UnsafeFileFallback {
path: "p".into(),
reason: "r".into(),
Expand Down
2 changes: 1 addition & 1 deletion crates/konnect-core/src/router/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub static ALL_TOOLSETS: &[ToolsetMeta] = &[
name: "editor_navigation",
description: "Observe and semantically navigate exact KiCad editor, document, sheet, selection, and cross-probe context",
category: "project",
tool_count: 3,
tool_count: 4,
},
ToolsetMeta {
name: "sch_components",
Expand Down
Loading
Loading