Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KDM_PROJECTNoPath to the Keil project directory. Used to fix the project instead of discovering `.kdm/` by walking up from the working directory.
KDM_FAKE_BACKENDNoPath to a JSON file describing a fake chip so the server can be tested without Keil or a board. Development use only; data does not come from hardware.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

KDM đọc trạng thái vi điều khiển trong phiên debug Keil uVision đang mở. Bắt đầu bằng kdm_status. Không kết luận từ một mẫu atomic=false đơn lẻ. Chỉ gọi tool điều khiển/ghi khi người dùng đồng ý và nhắc halt_warning trước khi dừng chip.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
kdm_statusA

Trạng thái kết nối, project, chip, firmware_match, lỗi, freeze/watchdog, mức quyền. Tự kết nối. Gọi đầu tiên.

read_varsB

Đọc biến/biểu thức chỉ đọc (vd "g_motor.duty", "buf[3]", "p->state"). Mảng dài được tóm tắt.

read_memoryB

Đọc khối nhớ (<= 4096 byte), trả hex theo word. Vùng có tác dụng phụ khi đọc bị chặn.

read_registersA

Thanh ghi lõi (cần halt) và/hoặc thanh ghi lỗi SCB đã giải mã (đọc được khi chạy).

read_periphA

Thanh ghi ngoại vi giải mã theo SVD, vd ["TIM2", "USART1.SR"]. force=true (mức control + reason) mới đọc thanh ghi có tác dụng phụ.

lookupC

Tra đúng một trong: symbol, pattern (+kind), addr -> hàm/dòng, file_line -> addr.

read_logC

Đọc sự kiện trong log phiên của KDM theo bộ lọc.

call_stackA

Call stack (và biến cục bộ nếu locals=true). Chỉ khi chip đang dừng.

diagnose_faultA

Phân tích HardFault/MemManage/BusFault/UsageFault: loại lỗi, file:dòng, nguyên nhân xếp hạng. Lưu báo cáo.

watchB

Lấy mẫu biến theo thời gian khi chip chạy: thống kê, vi phạm luật; until dừng khi điều kiện đúng.

snapshotC

Biến + ngoại vi + kết quả luật tức thời trong một lần gọi (nhóm khai báo trong watch.toml).

recorderB

Flight recorder chạy nền: giữ lịch sử biến ngay trước lúc lỗi; dump để xem.

baselineC

Lưu giá trị lúc chạy đúng (save) hoặc so với hiện tại (diff).

journalB

Nhật ký bug: read lúc đầu phiên; append khi tìm ra nguyên nhân (người dùng duyệt).

read_outputC

Output debug: printf qua ITM, cửa sổ serial, Event Recorder.

rtos_tasksB

Danh sách task RTOS, trạng thái, ưu tiên, stack.

Prompts

Interactive templates invoked by user choice

NameDescription
debug_sessionQuy trình debug chung với KDM.

Resources

Contextual data attached and managed by the client

NameDescription
profileprofile.toml của dự án hiện tại.
watch_configwatch.toml: nhóm biến và luật.
journal_textNhật ký bug của dự án.

TDQS

B3.1/5.0

Scored across 16 tools

Disambiguation4/5

The large family of read_* tools is mostly differentiated by data source (variables, memory blocks, core registers, SVD-decoded peripherals, ITM/serial output, session log), so an agent can pick correctly. Minor overlap remains between read_vars and read_memory, and between watch (time-sampled) and snapshot (instant sample of vars+peripherals+rules), which require reading descriptions carefully to separate.

Naming Consistency3/5

Several conventions coexist: verb_noun (read_output, read_vars, diagnose_fault), bare nouns (baseline, journal, recorder, watch, snapshot), prefixed status (kdm_status), and noun phrases (rtos_tasks, call_stack, read_log). Individual names are readable but there is no single predictable pattern.

Tool Count4/5

16 tools is at the upper end of the comfortable range, but a full embedded-debug workflow legitimately needs status, inspection, tracing, and fault analysis surfaces. Each tool appears to map to a distinct debugging need rather than being filler.

Completeness3/5

Inspection, tracing, and fault analysis are well covered (vars, memory, registers, peripherals, watch, recorder, call stack, diagnose_fault, journal). However, the surface is read-only: there are no execution-control tools (halt/run/step/reset), no breakpoint management, and no variable/memory write, which are core debugger operations an agent will likely need.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues