feat: repo_delete tool #11

Closed
opened 2026-05-14 08:51:25 +00:00 by mathias · 1 comment
Owner

Summary

Allow agents and claude.ai sessions to delete repositories without manual web UI.

Gitea API

DELETE /api/v1/repos/{owner}/{repo}

Tool spec

tool: repo_delete
params:
  owner:   string  // repo owner
  name:    string  // repo name
  confirm: string  // must equal name — hard guard against accidental deletion

Required token permission

delete_repo scope on the Gitea API token.

Risk classification

HIGH — irreversible. Must require explicit ntfy approval in agent workflows.

Implementation notes

  • Follow existing pattern in internal/tools/
  • Return error immediately if confirm != name (before any API call)
  • Table-driven tests: success, wrong confirm, repo not found, insufficient permissions

Motivation

2026-05-14: wanted to delete zombie repo ingestion-svc from claude.ai. Had to fall back to tombstone README instead of clean deletion. Blocked by missing tool.

## Summary Allow agents and claude.ai sessions to delete repositories without manual web UI. ## Gitea API `DELETE /api/v1/repos/{owner}/{repo}` ## Tool spec ``` tool: repo_delete params: owner: string // repo owner name: string // repo name confirm: string // must equal name — hard guard against accidental deletion ``` ## Required token permission `delete_repo` scope on the Gitea API token. ## Risk classification **HIGH** — irreversible. Must require explicit ntfy approval in agent workflows. ## Implementation notes - Follow existing pattern in `internal/tools/` - Return error immediately if `confirm != name` (before any API call) - Table-driven tests: success, wrong confirm, repo not found, insufficient permissions ## Motivation 2026-05-14: wanted to delete zombie repo `ingestion-svc` from claude.ai. Had to fall back to tombstone README instead of clean deletion. Blocked by missing tool.
Author
Owner

Shipped in v0.2.4. Closing during cleanup pass.

Shipped in v0.2.4. Closing during cleanup pass.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/gitea-mcp#11