Skip to content

feat(admin): add GET /admin/tool-requests for ops review - #405

Open
JayZeeDesign wants to merge 2 commits into
mainfrom
cursor/admin-tool-requests-a417
Open

JayZeeDesign wants to merge 2 commits into
mainfrom
cursor/admin-tool-requests-a417

Conversation

@JayZeeDesign

Copy link
Copy Markdown
Contributor

What this does

Adds a super-admin read API for catalog tool requests so ops can review them without querying Postgres. GET /admin/tool-requests follows the same pattern as GET /admin/feedback:

  • require_superadmin gate
  • limit + before pagination (descending by id)
  • Optional status (open|done|dismissed) and source (web|cli|mcp|claude-connector|api) filters
  • Returns all triage fields: id, created_at, capability, query, note, contact, source, status, org_id, user_email

Does not change the public POST /tool-requests intake.

How it was tested

uv run --with pytest-xdist pytest -n auto -q tests/test_tool_requests.py tests/test_app_roles.py
# 24 passed

uv run lint-imports
# Contracts: 14 kept, 0 broken.

New tests cover:

  • Auth requirement (403 for regular members)
  • Listing recent filings with all expected fields
  • Filtering by status and source
  • Pagination with limit and before
  • Validation of invalid filter values (400)

Checklist

  • uv run --with pytest-xdist pytest -n auto -q passes locally
  • Added or updated tests for the change (if it affects behavior)
  • Updated the relevant docs/context/ fragment (if a subsystem changed)
  • No secrets in the diff (keys, tokens, .env values)
Open in Web Open in Cursor 

Add a superadmin-only endpoint to list recent ToolRequest rows without
querying Postgres directly. Follows the same pattern as GET /admin/feedback:

- require_superadmin gate
- limit + before pagination (descending by id)
- optional status and source filters
- returns all triage fields (id, created_at, capability, query, note,
  contact, source, status, org_id, user_email)

Changes:
- Add domain/toolrequest.py with recent() query function
- Add admin endpoint in routers/feedback.py alongside /admin/feedback
- Register route in bootstrap.py _CONTROL_ROUTE_KEYS
- Update routes.json snapshot
- Add comprehensive tests for auth, filtering, pagination
- Update data-model.md and api.md docs

Co-authored-by: Jason Zhou <JayZeeDesign@users.noreply.github.com>
@github-actions github-actions Bot added the area:docs Documentation & design fragments label Sep 9, 2026
@JayZeeDesign
JayZeeDesign marked this pull request as ready for review September 9, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation & design fragments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants