feat(tools): add incident activity-log listing tools#162
Merged
Conversation
Expose an incident's full activity log — both user notes (comments) and
system actions (status changes, assignments, severity edits, new locations
detected, etc.) — as read-only MCP tools. This is broader than the existing
notes-only listings and lets the agent reconstruct an incident's timeline.
Adds list_incident_activity_logs and list_public_incident_activity_logs
(gated by incidents:read), wrapping the public API endpoints
GET /v1/incidents/secrets/{id}/activity-logs and the public-incidents
equivalent. Internal and public incidents get separate tools since their
activity logs and ids are not interchangeable. Supports content_key and
member_id filters plus cursor pagination.
The endpoints are not deployed in production yet, so the VCR cassettes are
hand-authored to match the public API response shape and cannot be
re-recorded against prod until the endpoints ship.
Refs: SI-3520
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two read-only MCP tools that list an incident's full activity log — both user notes (comments) and system actions (status changes, assignments, severity edits, new locations detected, etc.) in one chronological timeline:
list_incident_activity_logs— internal incidentslist_public_incident_activity_logs— Public Monitoring incidentsBoth gated by
incidents:read. They wrap the public API endpointsGET /v1/incidents/secrets/{id}/activity-logsandGET /v1/public-incidents/secrets/{id}/activity-logs. Each entry exposes acontentdiscriminated union:{type: "note", comment}or{type: "action", content_key, data}. Supportscontent_keyandmember_idfilters plus cursor pagination.Why
This is broader than the existing notes-only
list_*_incident_commentstools: it lets the agent reconstruct an incident's complete history, not just the discussion. Internal and public incidents get separate tools since their activity logs and ids are not interchangeable (mirroring theassign_incident/assign_public_incidentsplit).Testing
tests/tools/test_activity_logs.py— mocked tool-layer tests (filter forwarding, note/action mixing, error wrapping). Run today.tests/client/vcr/test_activity_logs.py— VCR tests for the client methods./activity-logsendpoints are not deployed in production yet. The VCR cassettes are hand-authored to match the documented public API response shape and cannot be re-recorded against prod until the endpoints ship. Once they're live, re-record withmake update-cassettes.Full suite: 654 passed, 3 skipped.
Refs: SI-3520