Reference for coding agents
Exact MCP tools, CLI commands, and human-agent handoff rules for working with neatlogs Incidents.
Coding agents (Claude Code, Codex, Cursor, and MCP-compatible assistants) can read incidents, inspect cited traces, propose fixes, and record updates using the neatlogs MCP server and standalone neatlogs CLI.
Which interface to use
| Goal | Recommended interface | Auth required |
|---|---|---|
| Read open incidents, investigation steps, and cited traces from your editor | MCP server (triage_* and search_traces / get_trace_context tools) | User OAuth or project-scoped Bearer token (MCP setup) |
| Publish an incident or review from CI, automation, or an external watcher | CLI (neatlogs-cli 0.2.3+) or Public API | Scoped OAuth profile or service-account token (CLI guide) |
| Test a proposed fix before opening or merging a PR | Experiments (beta) via neatlogs experiments + neatlogs-local-testing skill | Human OAuth sign-in with 7 scopes (Experiments agent reference) |
MCP tools for Incidents
Connect the neatlogs MCP server so your agent can inspect and update incidents directly. Tool names keep their stable triage_* identifiers; see MCP tools reference for full parameter schemas.
| MCP tool | Purpose | Write / approval boundary |
|---|---|---|
triage_list | List incidents in the project with status and filter options | Read-only |
triage_get | Fetch one incident's brief, metadata, linked traces, and recommended fix | Read-only |
triage_get_investigation | Read the full investigation report and reasoning for an incident | Read-only |
triage_list_steps | Inspect individual investigation steps and evidence references | Read-only |
triage_list_versions / triage_get_version | Compare earlier investigation or report versions | Read-only |
search_traces / get_trace_context | Pull the underlying failing traces and span trees cited by the incident | Read-only |
triage_update | Edit incident content or metadata when refining a fix brief | Requires write access; keep cited evidence intact |
triage_accept / triage_dismiss | Accept a candidate incident onto the board or dismiss a false positive | Confirm with a human unless operating under an explicit triage policy |
triage_update_status | Move an incident status (for example open, in_progress, resolved) | Ask a human before marking resolved until production traces verify the fix |
triage_restore_version | Restore an earlier report version | Confirm with a human before reverting teammate edits |
CLI commands for Incidents and trace evidence
Install neatlogs-cli 0.2.3 or later (npm install --global neatlogs-cli) and select your host, profile, and project (CLI quickstart):
# Inspect traces cited by an incident
neatlogs --host "$NEATLOGS_CLI_HOST" --profile "$NEATLOGS_CLI_PROFILE" \
--credential-source profile --project "$NEATLOGS_CLI_PROJECT" \
traces get '<trace-id>' --json
# Read spans for a failing run
neatlogs --host "$NEATLOGS_CLI_HOST" --profile "$NEATLOGS_CLI_PROFILE" \
--credential-source profile --project "$NEATLOGS_CLI_PROJECT" \
traces spans list '<trace-id>' --limit 25 --json
# Publish an external incident snapshot or review (automation / integrations)
neatlogs incidents publish --help
neatlogs incidents publish-review --helpSee incident commands and trace commands for full options and exit codes.
Recommended agent workflow: incident to verified fix
- Read the incident first. Call
triage_getandtriage_get_investigation(or ask the user to paste Copy context from the incident header). Never fix from a title alone. - Verify the raw evidence. Call
get_trace_contexton at least one cited trace to confirm the exact failing input, tool call, or model response. - Check ambiguity before coding. If the expected behavior is a product or policy call not stated in the codebase, stop and ask a human before editing code.
- Implement and test with Experiments. Make the focused fix, then run an A/B comparison on the failing cases plus passing controls using Experiments (beta).
- Hand back for review and closure. Share the PR diff, experiment verdict, and verification plan. Leave the incident open until a human confirms recovery in production.
Human-agent gap checklist
Stop and hand control to a human whenever:
- Credentials or OAuth consent are missing: only an SDK
NEATLOGS_API_KEYis present (it cannot read Public API or MCP incidents), orneatlogs auth loginneeds browser approval. - Business expectations are unclear: traces show what happened, but only a human knows whether a policy, refusal, or tone change is desirable.
- Production changes or closures are required: merging PRs, promoting managed prompts to
production, approving drafted detections, or closing an incident.
