{"at":"2026-11-23T00:58:25.726Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T00:58:26.330Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"data":{"method":"server/discover"},"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T00:58:26.431Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T00:58:27.027Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"This project has no Agentic HIL configuration yet. A request that touches a target board starts with project_config_create and then goes through these tools, before reaching for a shell. Never substitute openocd, pyocd, st-flash, JLinkExe, gdb, screen, minicom, candump, a Makefile target that runs one of them, or direct /dev/tty* or COM* access.","protocolVersion":"2025-06-18","serverInfo":{"name":"agentic-hil","version":"0.26.0"}}}}
{"at":"2026-11-23T00:58:27.027Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T00:58:27.027Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T00:58:27.028Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Debugger backend availability"},"description":"Check the debugger backend is installed: runs only --version, at most 10 s; contacts no probe or board. Replaces openocd. Returns backend, executable, version, config_status. Next: debugger_probes_list (probe ids), probe_target (board). Failures: debugger_not_found (missing), timeout; not_supported unless exactly one debugger is configured; permission_denied without allow_probe (config version 1).","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debugger_info"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"List connected debug probes"},"description":"List the probe ids of the in-circuit debuggers or programmers on this host; connects to no board. Replaces st-info. Returns probes, each with a probe_id to set as the debugger entry's probe_id. pyOCD and STM32CubeProgrammer ask their CLI; OpenOCD reads the USB serial inventory, complete false (adapters it cannot read there: not_supported). Failure: probe_discovery_failed.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debugger_probes_list"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Probe the target"},"description":"Connect the in-circuit debugger or programmer to the board and confirm it answers (target_detected true), with no reset and no flash; reset_target resets. Replaces openocd. Refused with resource_busy while a debug session is open. Failures: adapter_not_found (no probe), target_not_detected (board silent), debugger_not_found (backend missing), timeout (one command over debugger.timeout_s).","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"probe_target"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Upload a firmware artifact"},"description":"Store a firmware image in artifacts.upload_directory and return its artifact_id for flash_firmware or debug_start_session; no board needed. Give image_path, or filename with data_base64, else invalid_argument. Needs allow_upload, else permission_denied. The id is the sha256 of the bytes plus the lowercased extension: same bytes and extension, same id. Unsafe destination: unsafe_configured_path.","inputSchema":{"additionalProperties":false,"oneOf":[{"required":["image_path"]},{"required":["filename","data_base64"]}],"properties":{"data_base64":{"description":"The image as padded standard base64, whitespace ignored, else invalid_argument. Decoded, at most artifacts.max_upload_size_mb MiB (default 64), else artifact_too_large.","minLength":1,"type":"string"},"filename":{"description":"Bare name for data_base64, no path (like app.elf); its lowercased extension picks the format check and ends the artifact_id. A path: invalid_argument.","minLength":1,"type":"string"},"image_path":{"description":"Local file to store, inside the workspace and artifacts.allowed_roots (build if unset), with an allowed extension (.elf, .hex, .bin). Missing: artifact_not_found; invalid: artifact_validation_failed.","minLength":1,"type":"string"}},"type":"object"},"name":"artifact_upload"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Flash firmware"},"description":"Write firmware to the board via the in-circuit debugger or programmer, not st-flash; every call writes it again. Needs allow_flash, else permission_denied. resource_busy: debug_stop_session first; device_busy: held elsewhere. The debugger entry's timeout_s (seconds, 60 unless set) caps each debugger command, else timeout. No bench_run_start needed; capture with reset_after_flash adds boot output.","inputSchema":{"additionalProperties":false,"oneOf":[{"required":["image_path"]},{"required":["artifact_id"]}],"properties":{"artifact_id":{"description":"An artifact_id from artifact_upload, not with image_path; needs allow_upload, else permission_denied. Refused: artifact_not_found, artifact_validation_failed, artifact_too_large (max_upload_size_mb).","minLength":1,"type":"string"},"capture":{"additionalProperties":false,"description":"Read a COM port across the flash: opened before it, ended by a match, max_bytes or the wait. Needs reset_after_flash. A read failing after a good flash is ok false, image written.","properties":{"max_bytes":{"description":"Most bytes to return; the port's max_buffer_bytes by default.","minimum":1,"type":"integer"},"port_id":{"description":"Configured COM port to read.","minLength":1,"type":"string"},"until":{"description":"Text to wait for, or up to 8 texts of at most 256 characters each, as in com_read.","oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"items":{"maxLength":256,"minLength":1,"type":"string"},"maxItems":8,"minItems":1,"type":"array"}]},"wait_timeout_s":{"description":"Seconds to wait once the flash ends; 10 by default, 60 at most.","minimum":0,"type":"number"}},"required":["port_id"],"type":"object"},"image_path":{"description":"A .elf, .hex or .bin inside the workspace and artifacts.allowed_roots (build if unset). A .bin needs flash_address on every backend. pyOCD does not verify (verify false).","minLength":1,"type":"string"},"reset_after_flash":{"default":false,"description":"Reset the board after flashing; needs allow_reset, else permission_denied. Default false: not reset. If a failed flash leaves an incident, recovery.auto_recover may try a reset into halt.","type":"boolean"}},"type":"object"},"name":"flash_firmware"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Reset the target"},"description":"Reset the board through the in-circuit debugger or programmer: the firmware restarts, flash is kept. Replaces st-util. Needs allow_reset (else permission_denied). Refused with resource_busy while a debug session is open: debug_stop_session first. To check the board without a reset use probe_target. Failures: reset_failed (reset not confirmed), timeout (one command over debugger.timeout_s).","inputSchema":{"additionalProperties":false,"properties":{"mode":{"default":"run","description":"Default 'run' (core executes); 'halt' stops the core at reset; 'init' also runs the reset-init script (clocks, wait states, watchdog), OpenOCD-only, else not_supported.","enum":["run","halt","init"],"type":"string"}},"type":"object"},"name":"reset_target"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Start a debug session"},"description":"Opens a GDB session on an ELF for debug_continue and debug_halt. OpenOCD, pyOCD or ST-LINK_gdbserver; else not_supported. Needs GDB (debug.gdb_executable or PATH), the debugger's executable and allow_raw_debugger_commands off. Returns the core halted: session (status, stop_reason), log_path. A second start: session_already_active. debug_get_session_status inspects it; debug_stop_session ends it.","inputSchema":{"additionalProperties":false,"oneOf":[{"required":["image_path"]},{"required":["artifact_id"]}],"properties":{"artifact_id":{"description":"Id of an ELF stored with artifact_upload. Give this or image_path, not both.","minLength":1,"type":"string"},"image_path":{"description":"Path to a .elf file, relative to the workspace or absolute, inside the workspace and (by default) artifacts.allowed_roots. Give this or artifact_id, not both.","minLength":1,"type":"string"},"mode":{"default":"attach","description":"attach (default): halts the core, no reset. reset_halt: resets, halts; needs allow_reset. load: resets, flashes the ELF, resets, halts; needs allow_reset and allow_flash, not allow_mass_erase.","enum":["attach","reset_halt","load"],"type":"string"},"timeout_s":{"description":"Seconds. Default and ceiling: the debugger entry's timeout_s (60 unless set); 0.1 at least. Bounds the debug server's start and each GDB step (10 s at most). Expiry: timeout.","minimum":0,"type":"number"}},"type":"object"},"name":"debug_start_session"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Stop the debug session"},"description":"Ends the debug_start_session session; debug_halt keeps it open. Confirms core halted, disables resume on detach, ends GDB and debug server, drops breakpoints, frees flash_firmware and reset_target. OpenOCD, pyOCD or ST-LINK_gdbserver only; else not_supported. Success: safe_state_confirmed true. No session: ok, active false. Unproven: ok false, cleanup_required, hardware_state unknown, quarantined.","inputSchema":{"additionalProperties":false,"properties":{"timeout_s":{"description":"Seconds per teardown step. Default and ceiling: 5, or the debugger's timeout_s if lower; 0.1 at least. Fails: halt_not_confirmed, breakpoints_not_removed, detach_resume_not_confirmed, cleanup_failed.","minimum":0,"type":"number"}},"type":"object"},"name":"debug_stop_session"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Debug session status"},"description":"Reports if the debug_start_session session is open and its status: halted, running, error or cleanup_required. Records new stops; never halts or resumes the core; debug_halt halts, debug_get_stop_reason reads the last stop. Abnormal stop: ok true, target_ok false, target_error_type. No session: ok, active false, status stopped. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debug_get_session_status"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Set a breakpoint"},"description":"Adds a breakpoint in the debug_start_session session (else session_not_active) without resuming the core. Each call adds one and returns its breakpoint id; debug_list_breakpoints lists them. A location without a grant answers permission_denied. An unconfirmed insert answers cleanup_required; call debug_clear_breakpoints. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{"location":{"description":"\"main\", {\"symbol\": \"main\"}, {\"function\": \"main\"}: C identifier, needs debug.allowed_symbols or debug.allow_all_symbols. {\"file\": \"a.c\", \"line\": 9}: line from 1, no '..', needs debug.allow_all_symbols.","oneOf":[{"pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"},{"additionalProperties":false,"properties":{"symbol":{"pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"}},"required":["symbol"],"type":"object"},{"additionalProperties":false,"properties":{"function":{"pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"}},"required":["function"],"type":"object"},{"additionalProperties":false,"properties":{"file":{"not":{"pattern":"(?:^|[/\\\\])\\.\\.(?:$|[/\\\\])"},"pattern":"^[A-Za-z0-9_./\\\\:-]+$","type":"string"},"line":{"minimum":1,"type":"integer"}},"required":["file","line"],"type":"object"}]}},"required":["location"],"type":"object"},"name":"debug_set_breakpoint"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"List breakpoints"},"description":"Lists the breakpoints from the debug_start_session session's own record without asking GDB: breakpoints (id, backend_id, location), status, and cleanup_required, quarantined and hardware_state when cleanup is unconfirmed. Never halts or resumes the core. No session: ok, active false. debug_clear_breakpoints removes them. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debug_list_breakpoints"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Clear all breakpoints"},"description":"Removes every breakpoint GDB holds in the debug_start_session session (else session_not_active), then checks none is left. It neither resumes nor halts the core. It answers cleared (the count) and backend_reconciled true; a second call clears 0. Unconfirmed: ok false, breakpoint_reconciliation_failed; a retry is safe. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debug_clear_breakpoints"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Continue the target"},"description":"Resumes the core in the debug_start_session session until it stops. Needs allow_debug_execution, else permission_denied. Returns stop_reason, stop (frame): breakpoint_hit is ok; unexpected_breakpoint and target_exception are not. An exception or debugger_error stop is not resumed. No session: session_not_active. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{"timeout_s":{"description":"Seconds to wait for a stop. Default and ceiling: the debugger entry's timeout_s (60 unless set); under 0.1 counts as 0.1 first. Expiry: interrupt, its stop, up to 5 s each; timeout, halt_confirmed.","minimum":0,"type":"number"}},"type":"object"},"name":"debug_continue"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Halt the target"},"description":"Halts the core; the session stays open. Needs debug_start_session (else session_not_active) on a GDB server, exactly one debugger configured, else not_supported. Returns stop_reason halted or a stopped core's recorded stop. If an acknowledged interrupt's stop times out, ok and halt_confirmed are false, target_state unknown, quarantined; a confirmed halt lifts it unless the session is in error.","inputSchema":{"additionalProperties":false,"properties":{"timeout_s":{"description":"Seconds each for the interrupt and stop. The default and ceiling is 10, or the debugger's timeout_s if lower; under 0.1 counts as 0.1 first. Expiry answers timeout. A stopped core gets no interrupt.","minimum":0,"type":"number"}},"type":"object"},"name":"debug_halt"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Last stop reason"},"description":"Reads why the core last stopped: stop_reason (breakpoint_hit, halted, exception), stop (frame). Records a new stop; never halts or resumes the core. Abnormal stop: ok true, target_ok false, target_error_type. None yet: stop_reason_not_available. Without debug_start_session: session_not_active. Session: debug_get_session_status. GDB server only, exactly one debugger configured; else not_supported.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"debug_get_stop_reason"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Resolve a debug symbol"},"description":"Find a symbol's hex address, size_bytes and resolved_from in the ELF. Reads no target memory; for bytes use debug_symbol_value, for Intel HEX debug_dump_symbol_ihex. OpenOCD needs debug_start_session (else session_not_active). pyOCD and STM32CubeProgrammer use an open session, else the ELF flash_firmware last wrote (else symbol_source_not_available; symbol_source_changed if changed since).","inputSchema":{"additionalProperties":false,"properties":{"symbol":{"description":"C identifier, optionally ::-qualified, e.g. boot_counter. Allowed if in debug.allowed_symbols or debug.allow_all_symbols is true (default false), else permission_denied. Not in ELF: symbol_not_found.","pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"}},"required":["symbol"],"type":"object"},"name":"debug_symbol_info"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Read a symbol's value"},"description":"Reads a symbol from target memory, like gdb print. Address: debug_symbol_info; file: debug_dump_symbol_ihex. Returns hex plus value_unsigned and value_signed at 1/2/4/8 bytes. OpenOCD needs debug_start_session (else session_not_active); pyOCD and STM32CubeProgrammer use an open session, else flash_firmware's last ELF (else symbol_source_not_available). Over max_dump_size_bytes: permission_denied.","inputSchema":{"additionalProperties":false,"properties":{"symbol":{"description":"C identifier, optionally ::-qualified, e.g. boot_counter. Allowed if in debug.allowed_symbols or debug.allow_all_symbols is true (default false), else permission_denied. Not in ELF: symbol_not_found.","pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"}},"required":["symbol"],"type":"object"},"name":"debug_symbol_value"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Dump a symbol as Intel HEX"},"description":"Read a symbol from target memory and write it as Intel HEX to output_path; returns address, size_bytes and output. Value inline: debug_symbol_value. OpenOCD needs debug_start_session (else session_not_active); pyOCD and STM32CubeProgrammer use an open session, else the ELF flash_firmware last wrote (else symbol_source_not_available). Over debug.max_dump_size_bytes: permission_denied.","inputSchema":{"additionalProperties":false,"properties":{"output_path":{"description":"Workspace path ending .hex or .ihex, no '..' segment, under artifacts.allowed_roots if validation.require_allowed_root (default true), else output_validation_failed. Folders created, a file replaced.","minLength":1,"type":"string"},"symbol":{"description":"C identifier, optionally ::-qualified, e.g. boot_counter. Allowed if in debug.allowed_symbols or debug.allow_all_symbols is true (default false), else permission_denied. Not in ELF: symbol_not_found.","pattern":"^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$","type":"string"}},"required":["symbol","output_path"],"type":"object"},"name":"debug_dump_symbol_ihex"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Last structured report"},"description":"Return the newest stored hardware report, pass or fail, under `report`. For the last failure diagnosed, even after successes, use classify_last_error. Needs no board; reading changes nothing. After a failure it can be the recovery's reset_target or probe_target (report.tool). ok stays true for a failed report: judge report.ok, report.audit_ok, report.cleanup_required. None yet: report_not_found.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"get_last_report"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Classify the last failure"},"description":"Explain the last hardware failure. Unlike get_last_report, the failure survives later successes. Returns error_type (its code), likely_causes (what to check), report_path and log_path (evidence). source_tool is the failed tool, or reset_target if a flash's recovery reset failed too. Flash refusals by allow_flash or allow_mass_erase record nothing. Needs no board; no failure yet: report_not_found.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"classify_last_error"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"List COM ports"},"description":"List `com_ports` entries in ports by port_id, which com_session_start takes (not a device path), with `session_active`. Opens no port. `available_com_ports` holds host ports, or `permission_denied` on version 1 unless a configured port may be read, `serial_backend_not_available` without pyserial, `com_port_discovery_failed` on OS errors; the call stays ok. Use this instead of picocom or /dev/tty*.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"com_ports_list"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Open a COM session"},"description":"Open the serial port a com_ports entry names and hold it, with its machine-wide lock, until com_session_stop; a reader buffers what the board sends for com_read. DTR and RTS are driven as configured on open, which can reset a board. device_busy, resource_busy or com_port_busy: another server, process or program has the port. permission_denied: neither reading nor writing is allowed.","inputSchema":{"additionalProperties":false,"properties":{"clear_buffer":{"default":true,"description":"Default true: discard bytes received so far, also on a repeat start for the same port_id, which keeps a live session (already_active) and replaces a failed one. False keeps them for com_read.","type":"boolean"},"port_id":{"description":"Name of a com_ports entry (com_ports_list shows them), not a device path. Unknown names fail with com_port_not_configured; a device that will not open, with com_port_open_failed.","minLength":1,"type":"string"}},"required":["port_id"],"type":"object"},"name":"com_session_start"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Close a COM session"},"description":"Close the com_session_start session on port_id: stop its reader, close the port, release its lock. Unread bytes are dropped; the session log at log_path keeps them. Without a session it returns ok with was_active false. If the reader does not end within max(1 s, timeout_s + 0.5 s) of the close, it returns com_port_close_failed and keeps the session registered; call again to retry.","inputSchema":{"additionalProperties":false,"properties":{"port_id":{"description":"Name of a com_ports entry in the project configuration (com_ports_list shows them), not a device path; an unknown name fails with com_port_not_configured.","minLength":1,"type":"string"}},"required":["port_id"],"type":"object"},"name":"com_session_stop"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Write to a COM port"},"description":"Send bytes over the session com_session_start opened on port_id (else session_not_active); needs the port's allow_write (else permission_denied). At most max_write_bytes encoded bytes, 4096 by default. bytes_written counts the bytes sent; a short write returns serial_write_incomplete. Example: com_session_start port_id \"uart0\", com_write text \"hello\\r\\n\", com_read until \"\\n\", com_session_stop.","inputSchema":{"additionalProperties":false,"oneOf":[{"required":["text"]},{"required":["hex"]}],"properties":{"hex":{"description":"Bytes as hexadecimal byte pairs, whitespace ignored, for example \"0d 0a\". Give hex or text, not both; hex suits binary payloads.","type":"string"},"port_id":{"description":"Name of a com_ports entry in the project configuration (com_ports_list shows them), not a device path; an unknown name fails with com_port_not_configured.","minLength":1,"type":"string"},"text":{"description":"Characters to send, encoded with the port's configured encoding (utf-8 by default) and sent as is: no line ending is added, so include \\r\\n yourself. Give text or hex, not both.","type":"string"}},"required":["port_id"],"type":"object"},"name":"com_write"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Read from a COM port"},"description":"Read what the board sent on a COM port session from com_session_start (else session_not_active), instead of screen, minicom or picocom. With until, one call waits for a pattern instead of polling. Each byte is returned once, as text and hex. If until is not seen in time, the answer is still ok, with until_matched false and the bytes so far.","inputSchema":{"additionalProperties":false,"properties":{"max_bytes":{"description":"Most bytes to return; default the port's max_buffer_bytes (65536 unless configured). The rest stays buffered, see buffer_remaining_bytes. With until, a wait also ends once max_bytes are buffered.","minimum":1,"type":"integer"},"port_id":{"description":"The com_ports entry name (see com_ports_list), not a device path; an unknown name gives com_port_not_configured. Under config version 1, permission_denied unless allow_read is true.","minLength":1,"type":"string"},"until":{"description":"Text, or up to 8 texts, matched literally as bytes in the port's encoding, not as a regex. Returns the feedback through the first match; the rest stays buffered.","oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"items":{"maxLength":256,"minLength":1,"type":"string"},"maxItems":8,"minItems":1,"type":"array"}]},"wait_timeout_s":{"description":"Seconds to wait. Without until the default is 0 and a wait ends at the first bytes to arrive; with until the default is 10 s. Waits are capped at 60 s.","minimum":0,"type":"number"}},"required":["port_id"],"type":"object"},"name":"com_read"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"List CAN buses"},"description":"List every `can_buses` entry in `buses`, keyed by bus_id, the name can_session_start, can_send and can_read take. Each shows `session_active`, `listen_only` with its `listen_only_enforcement`, `fd`, `max_frame_data_bytes` and `max_buffer_frames`; a bus with `shares` adds `active_participants`. Needs no session and opens no adapter. Use this instead of ip link or candump.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"can_buses_list"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Open a CAN session"},"description":"Open a session on a configured CAN bus for can_send and can_read, until can_session_stop or server exit. Returns `session`; a repeat call answers `already_active: true`. Fails `can_bus_not_configured`, `device_busy` or `resource_busy` (bus held), `can_adapter_timeout` (bridge `timeout_s`, default 10 s), and on a `listen_only` bus `can_listen_only_unsupported` or `can_listen_only_unconfirmed`.","inputSchema":{"additionalProperties":false,"properties":{"bus_id":{"description":"A `can_buses` entry (can_buses_list). peak needs PCAN-Basic, socketcan an up interface, both via python-can (`agentic-hil[can]`, else `can_backend_not_available`); process runs a bridge `executable`.","minLength":1,"type":"string"},"clear_rx_queue":{"default":true,"description":"Default true: discard frames already queued, also on a repeat call, counted in `frames_drained`. Bounded: a queue that keeps filling fails `can_queue_clear_limit`. Ignored for a participant.","type":"boolean"},"participant":{"description":"Required on a bus with `shares`; any other name, or any name on a bus without `shares`, fails `can_participant_not_configured`. A broker owns the adapter; each participant gets its own filtered queue.","minLength":1,"type":"string"}},"required":["bus_id"],"type":"object"},"name":"can_session_start"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Close a CAN session"},"description":"Close the can_session_start session on bus_id when done with the bus; its lease is released. Its adapter closes unless other participants share the bus. A declared run still holds the bus. can_send and can_read then answer `session_not_active`. With no session open, `was_active` is false. If the close fails or a bridge is silent for 1 s, it returns `can_adapter_close_failed` and keeps the session.","inputSchema":{"additionalProperties":false,"properties":{"bus_id":{"description":"A `can_buses` entry from can_buses_list, else `can_bus_not_configured`. Example: can_session_start(bus_id=\"bench\"), can_read(bus_id=\"bench\", max_frames=10), can_session_stop(bus_id=\"bench\").","minLength":1,"type":"string"},"participant":{"description":"Required on a bus with `shares`: only this participant detaches, the others stay. A name with no open session, or any name on a bus without `shares`, answers `was_active: false` and closes nothing.","minLength":1,"type":"string"}},"required":["bus_id"],"type":"object"},"name":"can_session_stop"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Send a CAN frame"},"description":"Send one CAN frame (CAN FD on an `fd: true` bus) on the can_session_start session, else `session_not_active`. Needs the bus `allow_write`, else `permission_denied`; a `listen_only` bus refuses with `can_listen_only_mode`. A repeat sends again. `ok`: the adapter accepted it, not that a node ACKed it. `can_send_failed` sets `cleanup_required`: it may have gone out. Use this instead of cansend.","inputSchema":{"additionalProperties":false,"properties":{"bus_id":{"description":"A `can_buses` entry (can_buses_list), else `can_bus_not_configured`. The adapter gets the bus `timeout_s` (default 10 s) to take the frame; replies come from can_read.","minLength":1,"type":"string"},"data_hex":{"default":"","description":"Hex byte pairs, whitespace ignored; default empty. At most `max_frame_data_bytes`; classic over 8 bytes: `can_classic_frame_too_large`; FD only 0-8,12,16,20,24,32,48,64: `can_fd_frame_length_invalid`.","type":"string"},"extended":{"default":false,"description":"Default false: 11-bit standard id. True: 29-bit extended id.","type":"boolean"},"frame_id":{"description":"Arbitration id: an integer, a decimal string or a 0x hex string. 0 to 0x7FF, or 0 to 0x1FFFFFFF when extended, else `invalid_argument`. The result echoes the sent `frame`.","oneOf":[{"minimum":0,"type":"integer"},{"pattern":"^(?:0[xX][0-9A-Fa-f]+|[0-9]+)$","type":"string"}]},"participant":{"description":"Required with `shares`; needs its own `allow_write`. frame_id must pass its filter (`can_participant_filter_violation`). Sends spend its budget; `can_participant_frame_budget_exhausted` ends its run.","minLength":1,"type":"string"},"rtr":{"default":false,"description":"Default false: a data frame. True sends a remote frame; an `fd: true` bus refuses it with `can_fd_remote_frame_unsupported`.","type":"boolean"}},"required":["bus_id","frame_id"],"type":"object"},"name":"can_send"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Read CAN frames"},"description":"Read the CAN frames your can_session_start session received into `frames`, counted by `frames_read`. Use it instead of candump; to wait for a reply, pass until_id rather than polling. Without a session: `session_not_active`. Returned frames are consumed; an empty read is still ok. Adapter faults: `can_read_failed`; after `can_adapter_invalid_response`, can_session_stop and start again.","inputSchema":{"additionalProperties":false,"properties":{"bus_id":{"description":"A `can_buses` entry (can_buses_list), else `can_bus_not_configured`.","minLength":1,"type":"string"},"max_frames":{"description":"Most frames to return, 1 to the bus `max_buffer_frames` (1024 unless configured), else `invalid_argument`. Default `max_buffer_frames`.","minimum":1,"type":"integer"},"participant":{"description":"Required on a bus with `shares`. It reads only frames its filter accepts, never its own sends. Each frame read spends its budget; `can_participant_frame_budget_exhausted` ends its run.","minLength":1,"type":"string"},"until_id":{"description":"Integer id (0 to 0x1FFFFFFF) to wait for, or a list of 1 to 8. Returns the frames read through the first match. Only the numeric id is compared, not the extended flag.","oneOf":[{"maximum":536870911,"minimum":0,"type":"integer"},{"items":{"maximum":536870911,"minimum":0,"type":"integer"},"maxItems":8,"minItems":1,"type":"array"}]},"wait_timeout_s":{"description":"Seconds to wait for frames. Without until_id: default 0 (answer at once with what is queued), at most the bus `timeout_s` (default 10 s) and 60 s. With until_id: default 10 s, at most 60 s.","minimum":0,"type":"number"}},"required":["bus_id"],"type":"object"},"name":"can_read"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Read a power supply"},"description":"Read a configured bench power supply: per channel its set points, measured voltage and current, output state, protection and effective limits, each exact or null where the type cannot read it. Writes nothing and needs no grant. `missing_limits` and `writes_refused_reason` say why writes on a channel would be refused. A unit other than the configured one fails `power_supply_identity_mismatch`.","inputSchema":{"additionalProperties":false,"properties":{"channel":{"description":"Output channel, numbered from 1. Without it every channel is read.","minimum":1,"type":"integer"},"supply_id":{"description":"A `power_supplies` entry of the authoritative configuration, else `unknown_device`.","minLength":1,"type":"string"}},"required":["supply_id"],"type":"object"},"name":"power_supply_status"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Set a power supply channel"},"description":"Set the voltage, the current or both on one supply channel. Needs `allow_set`. Refused before contact when the configuration sets no limit for the channel, or a value is above its effective limit (`power_supply_limit_exceeded`). Arms the supply's protection at the limits first, writes, and reads every value back exactly (`power_supply_readback_mismatch`). Does not switch the output.","inputSchema":{"additionalProperties":false,"properties":{"channel":{"description":"Output channel, numbered from 1. Required on a supply with more than one channel.","minimum":1,"type":"integer"},"current_a":{"description":"Current set point in A, a multiple of the type's resolution and at most the effective limit. Never rounded.","minimum":0,"type":"number"},"supply_id":{"description":"A `power_supplies` entry of the authoritative configuration, else `unknown_device`.","minLength":1,"type":"string"},"voltage_v":{"description":"Voltage set point in V, a multiple of the type's resolution and at most the effective limit. Never rounded.","minimum":0,"type":"number"}},"required":["supply_id"],"type":"object"},"name":"power_supply_set"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Switch a power supply output"},"description":"Switch one supply channel's output on or off and read the state back. Needs `allow_output`. Before switching on, the stored set points are held to the effective limits and the protection is armed at them. A type that cannot read its output state is refused before contact (`not_supported`). Switching to the state already held changes nothing.","inputSchema":{"additionalProperties":false,"properties":{"channel":{"description":"Output channel, numbered from 1. Required on a supply with more than one channel.","minimum":1,"type":"integer"},"on":{"description":"true switches the output on, false switches it off.","type":"boolean"},"supply_id":{"description":"A `power_supplies` entry of the authoritative configuration, else `unknown_device`.","minLength":1,"type":"string"}},"required":["supply_id","on"],"type":"object"},"name":"power_supply_output"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Power-cycle a board"},"description":"Power-cycle the board on one supply channel: output off, wait `off_s`, output on, each state read back. Needs `allow_output`. The stored set points are held to the effective limits and the protection is armed at them first. A type that cannot read its output state is refused before contact (`not_supported`). Every call cycles the board again.","inputSchema":{"additionalProperties":false,"properties":{"channel":{"description":"Output channel, numbered from 1. Required on a supply with more than one channel.","minimum":1,"type":"integer"},"off_s":{"description":"Seconds the output stays off, 0.5 to 30.","maximum":30,"minimum":0.5,"type":"number"},"supply_id":{"description":"A `power_supplies` entry of the authoritative configuration, else `unknown_device`.","minLength":1,"type":"string"}},"required":["supply_id","off_s"],"type":"object"},"name":"power_supply_cycle"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Declare a bench run"},"description":"Declare a run holding the devices a sequence like flash, reset, read needs until bench_run_stop or server exit, no timeout; without one the board is free between calls. All or nothing: a refused start holds none. Other devices fail `undeclared_device`; a second start, `run_already_active`; a standing incident, `resource_quarantined`. A single call, or flash_firmware with capture, needs no run.","inputSchema":{"additionalProperties":false,"properties":{"devices":{"description":"The devices the run holds, one selector each, all resolved before any is locked. Success returns them as `declared_devices`, with `run_label`.","items":{"additionalProperties":false,"properties":{"id":{"description":"The config entry's name, else `unknown_device`. Required for uart, can and power_supply; a debugger may omit it, meaning the one this server is bound to or the only one, else `invalid_argument`.","minLength":1,"type":"string"},"kind":{"description":"debugger (a `debuggers` entry), uart (`com_ports`), can (`can_buses`) or power_supply (`power_supplies`). The board under test is not a kind.","enum":["debugger","uart","can","power_supply"],"type":"string"},"participant":{"description":"Only for can, else `invalid_argument`. Required on a bus with `shares` (`can_participant_required`); a name the bus lacks fails `can_participant_not_configured`.","minLength":1,"type":"string"}},"required":["kind"],"type":"object"},"minItems":1,"type":"array"},"label":{"description":"Optional, no default: free text returned as `run_label` and shown as the holder's label to anyone refused `device_busy`.","minLength":1,"type":"string"},"wait_s":{"description":"Seconds to wait for a device another holder has, 0 to 900. Default 0: a held device fails `device_busy` at once.","maximum":900,"minimum":0,"type":"number"}},"required":["devices"],"type":"object"},"name":"bench_run_start"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"End the bench run"},"description":"End the bench_run_start run and release its devices (`released_devices`). With no run open it answers `run_was_active: false`. A COM, CAN or debug session still open keeps its own device: `open_leases`, `still_held_devices`. With an incident open it runs the recovery `recovery.auto_recover` allows (by default reset into halt, then a probe re-read), reported in `recovery`.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"bench_run_stop"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Bench run status"},"description":"Report whether this server has a run open (`run_active`), what it declared (`declared_devices`, `run_label`) and which devices it holds (`held_devices`); read it when unsure whether you still hold the bench. In memory only: what another process holds shows in hardware_lease_status.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"bench_run_status"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Run a test plan"},"description":"Run a test plan file (agentic-hil://reference/test-plan) on the board. For calls made one by one, use bench_run_start, whose open run refuses this with `run_already_active`. `permission_denied` and `device_busy` refuse at once, before any step. A failing step gets the recovery `recovery.auto_recover` allows, reported in `recovery`. With detach, poll test_reactor_status; test_reactor_stop ends it.","inputSchema":{"additionalProperties":false,"properties":{"detach":{"default":false,"description":"Default false: answers at the plan's end with `ok`, `steps`. True: once a worker holds the devices (30 s max), not at the plan's end: `run`, `state` or the verdict; else `run_worker_unresponsive`.","type":"boolean"},"test_config_path":{"description":"Path inside workspace_root, relative to it; default `.agentic-hil/testconfig.yaml`. Missing: `test_config_not_found`; unreadable: `test_config_unreadable`; outside or malformed: `test_config_invalid`.","minLength":1,"type":"string"}},"type":"object"},"name":"test_reactor_run"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Test run status"},"description":"Follow a detached test_reactor_run by its handle; for a bench_run_start run, use bench_run_status. `state` goes starting, running, then finished or stopped, or worker_gone if its process died; `stop_requested_at` dates a test_reactor_stop. Once ended, `run_ok` is the verdict and `canonical_report_path` its own report; `report_path` is a mirror the next run overwrites. Fails `run_state_invalid`.","inputSchema":{"additionalProperties":false,"properties":{"run":{"description":"A handle from test_reactor_run's `run`: `run-` and 16 hex digits, else `invalid_argument`; unknown: `run_not_found`. Leave it out to list this bench's runs: `runs`, `active_runs`.","minLength":1,"type":"string"}},"type":"object"},"name":"test_reactor_status"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Stop a test run"},"description":"Ask a test plan run to stop by writing a request it reads between steps. It finishes the step it is in (a delay or device wait ends early), closes its devices and writes its report; one still starting ends before any step. Answers at once `stop_requested: true`, also on a repeat; an ended run answers `stop_requested: false`. Fails `run_state_invalid`, or `run_worker_gone` (its process died).","inputSchema":{"additionalProperties":false,"properties":{"run":{"description":"A handle from test_reactor_run's `run`: `run-` and 16 hex digits, else `invalid_argument`; one this bench never issued fails `run_not_found`.","minLength":1,"type":"string"}},"required":["run"],"type":"object"},"name":"test_reactor_stop"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Clear a bench quarantine"},"description":"Clear the standing quarantine that blocks hardware calls. Call it when hardware_lease_status shows incident_stands, rather than deleting state files. It needs allow_recover and touches no hardware. A no-contact reason clears with no argument. Any other reason answers recovery_requires_physical_check: ask the operator, pass their answer verbatim as operator_statement, never invent one.","inputSchema":{"additionalProperties":false,"properties":{"accept_config_change":{"default":false,"description":"Default false. True only after the operator has reviewed both digests a config_changed refusal reports: accepts the configuration change since the incident; recorded in the ledger.","type":"boolean"},"operator_statement":{"description":"The operator's own answer, asked in chat, passed verbatim; recorded in the ledger as theirs. Never invent one. No statement clears an audit_broken reason: only its operator_command does.","minLength":1,"type":"string"}},"type":"object"},"name":"hardware_recover"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Bench lease status"},"description":"Read who holds this bench, from any process (`bench_held`, `held_devices`), and any open incident: `blocked`, `cleanup_reasons`, `auto_recoverable`, `quarantine_guidance`, `next_step`. Only `incident_stands: true` needs hardware_recover; otherwise the next hardware call settles it or stands it down. `standing_incidents` are other projects' incidents, not yours to clear. Drives no device.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"hardware_lease_status"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Generate the project configuration"},"description":"Generate this workspace's configuration from attached hardware instead of writing one by hand: every permission true except allow_raw_debugger_commands and allow_mass_erase, which it writes false. Never ask for those two to be turned on. Regenerating is the operator's call, not a way to narrow or re-open.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"project_config_create"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Describe the configuration"},"description":"List the keys project_config_set may change: writable_keys with current_value and value_schema, locked_keys naming in unlocked_by the permission that opens each. Read it before project_config_set instead of guessing; it needs no permission. writes_blocked_by_open_run is true while this server holds a run or session. Bad YAML answers config_invalid, an unreadable file config_unreadable.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"project_config_describe"},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false,"title":"Change configuration keys"},"description":"Write values you choose to named keys of the configuration file. Call it after project_config_describe lists the keys, rather than editing the configuration file. Device keys need allow_config_description_write, permission keys allow_config_permissions_write, else permission_denied. Permissions only narrow: closing allow_config_permissions_write freezes them all at once (permissions_frozen).","inputSchema":{"additionalProperties":false,"properties":{"changes":{"description":"One or more {key, value} pairs, each key at most once, validated together: an unknown or repeated key or a value its value_schema refuses answers invalid_argument and nothing is written.","items":{"additionalProperties":false,"properties":{"key":{"description":"Dotted key project_config_describe lists. Not in force until re-read (reload_required): project_config_reload_description takes target, debuggers, com_ports, can_buses keys, not debug or permissions.","minLength":1,"type":"string"},"value":{"description":"A single scalar matching the key's value_schema; objects and arrays are refused. A permission key takes only false: true answers permission_widening_denied, since only the operator widens.","type":["string","number","integer","boolean","null"]}},"required":["key","value"],"type":"object"},"minItems":1,"type":"array"}},"required":["changes"],"type":"object"},"name":"project_config_set"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false,"title":"Adopt attached hardware"},"description":"Fill the configuration keys that still hold placeholders from the attached probe. Call it once a board is attached, so nobody retypes its serial. It may also rename a COM device to its stable name and correct a stale identity_source. It writes only when apply is true, never flashes or erases. A read that leaves the board state unknown may get it reset into halt by recovery (resource_quarantined).","inputSchema":{"additionalProperties":false,"properties":{"apply":{"default":false,"description":"Default false writes nothing. true writes carried via project_config_set (allow_config_description_write, else permission_denied), then call project_config_reload_description; none: applied false.","type":"boolean"},"com_port_id":{"description":"com_ports entry for the discovered device; default: the one naming it, else the only one, else a new dut_uart, created with every permission false. Several, none named: unavailable.","minLength":1,"type":"string"},"debugger_id":{"description":"Configured debuggers entry that receives the values; needed when there are several (else invalid_argument). Not configured: unknown_device. An entry naming another probe: hardware_mismatch.","minLength":1,"type":"string"},"probe_id":{"description":"Serial of the attached probe to read, each read step taking up to 10 s; defaults to the configured probe_id. With neither, several attached probes answer ambiguous_hardware. Selects, never adds one.","minLength":1,"type":"string"}},"type":"object"},"name":"project_config_adopt_hardware"},{"annotations":{"openWorldHint":false,"readOnlyHint":true,"title":"Reload the bench description"},"description":"Re-read target, debuggers, com_ports and can_buses from this workspace's configuration into the running server, never permissions or debug. Call it after project_config_set, project_config_adopt_hardware or a hand edit, rather than a restart. New devices get every permission false; changed grants need a restart (restart_required_for). description_changes lists what moved.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"project_config_reload_description"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false,"title":"Upgrade this Agentic HIL installation"},"description":"Upgrade this installation to the newest release with the uv, pipx or pip that installed it. Use it when the operator asks; it takes no arguments and needs allow_upgrade. Each manager run may take 600 s. running_version stays old until this server restarts. On Windows, ask the operator to run agentic-hil upgrade (upgrade_cli_only_on_host). On failure the operator runs any reinstall_command.","inputSchema":{"additionalProperties":false,"properties":{},"type":"object"},"name":"server_upgrade"}]}}}
