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

GoalRecommended interfaceAuth required
Read open incidents, investigation steps, and cited traces from your editorMCP 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 watcherCLI (neatlogs-cli 0.2.3+) or Public APIScoped OAuth profile or service-account token (CLI guide)
Test a proposed fix before opening or merging a PRExperiments (beta) via neatlogs experiments + neatlogs-local-testing skillHuman 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 toolPurposeWrite / approval boundary
triage_listList incidents in the project with status and filter optionsRead-only
triage_getFetch one incident's brief, metadata, linked traces, and recommended fixRead-only
triage_get_investigationRead the full investigation report and reasoning for an incidentRead-only
triage_list_stepsInspect individual investigation steps and evidence referencesRead-only
triage_list_versions / triage_get_versionCompare earlier investigation or report versionsRead-only
search_traces / get_trace_contextPull the underlying failing traces and span trees cited by the incidentRead-only
triage_updateEdit incident content or metadata when refining a fix briefRequires write access; keep cited evidence intact
triage_accept / triage_dismissAccept a candidate incident onto the board or dismiss a false positiveConfirm with a human unless operating under an explicit triage policy
triage_update_statusMove an incident status (for example open, in_progress, resolved)Ask a human before marking resolved until production traces verify the fix
triage_restore_versionRestore an earlier report versionConfirm 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 --help

See incident commands and trace commands for full options and exit codes.

  1. Read the incident first. Call triage_get and triage_get_investigation (or ask the user to paste Copy context from the incident header). Never fix from a title alone.
  2. Verify the raw evidence. Call get_trace_context on at least one cited trace to confirm the exact failing input, tool call, or model response.
  3. 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.
  4. 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).
  5. 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_KEY is present (it cannot read Public API or MCP incidents), or neatlogs auth login needs 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.

On this page

neatlogs
neatlogs

Ask neatlogs AI

Answers grounded in the docs

neatlogs

How can I help?

Ask anything about Incidents, Experiments, tracing, or the neatlogs dashboard.