Skip to content

feat(apps): show_attention, a read-only report of what needs action in an account - #287

Open
acoyfellow wants to merge 2 commits into
cloudflare:mainfrom
acoyfellow:jcoeyman/attention-report
Open

acoyfellow wants to merge 2 commits into
cloudflare:mainfrom
acoyfellow:jcoeyman/attention-report

Conversation

@acoyfellow

@acoyfellow acoyfellow commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

show_attention returns what needs action in one Cloudflare account. It reads three feeds with the caller's token:

  • notifications that fired in the last 7 days
  • open Security Center insights
  • active Workers Observability issues

It sorts the items by severity and returns them as text and as structuredContent. Both tool modes register it. This PR has no UI. The MCP App panel is #282, which builds on this PR.

// tools/call
{ "name": "show_attention", "arguments": { "account_id": "<32 hex, optional with one account>" } }

When a feed fails, the result says so:

  • A 401 or 403 names the missing permission: Notifications Read, Account Security Center Insights Read or Workers Observability Read.
  • A 5xx is retried up to 3 times. If it still fails, the feed goes in unavailable and the other feeds still return.
  • An account_id that the session cannot reach gets the same error as execute. No feed is called.

The tool declares only the three read scopes. It keeps a link only when it is https://dash.cloudflare.com.

Size: 425 lines of source in 3 new files and 2 edited ones, and 352 lines of tests. The 6 existing tool-list tests each gain show_attention. No new dependencies.

npm run check passes (499 tests). I ran the same tool code against wrangler dev with a real token on an internal account, before splitting it from #282. Live Workers issues came back, and the Security insights feed named its missing permission.

#268 and #275 ask the client to grant a missing OAuth scope when an API call is refused. This tool reports a missing permission in its own result and returns the feeds that loaded.

Open question: without Notifications Read, alert history returns success: true, result: null. The tool cannot tell "no alerts" from "not allowed" for that feed.

…n an account

show_attention lists notifications that fired in the last 7 days, open
Security Center insights and active Workers Observability issues, most
severe first, as text and structuredContent. It is registered in both tool
modes.

- Feeds are read with the caller's token. A refused feed names the missing
  permission, a 5xx is retried, and a feed that fails is reported instead of
  shown as empty.
- An account_id the session cannot reach is rejected before any feed call.
  Only https://dash.cloudflare.com links are kept.
…rd links

Security Center returns dashboard translation keys in resolve_text and
relative paths such as /:account_id/turnstile in resolve_link. Fall back to
the insight class for keys, and resolve relative paths on dash.cloudflare.com.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant