feat(tags): add delete_tag_definition + document track/tag probe findings#63
Merged
Conversation
…ings
Resolves the one genuinely-buildable gap from the post-v1.6.6
connector audit, and records why the other headline gap isn't
buildable. Both gated on endpoint existence, settled by
scripts/wire-trace-v167.ts before any code was written:
- GET /tracks → 405 Method not allowed. No tenant-wide track-
instance list exists (the route only accepts POST/create).
Orphan tracks (NOTES §25) stay reachable only by known id, so a
`list_tracks` tool is NOT buildable — declined on evidence, not
assumption. Documented in NOTES §33.
- DELETE /<entity>/tags/{id} → 204, verified gone tenant-wide on a
follow-up read. Tag definitions ARE deletable, so this ships
`delete_tag_definition`.
delete_tag_definition (write, destructive, confirm-gated):
- Schema {entity, tagId, confirm: true}; entity selects the tag
namespace (parties/opportunities/kases), same as add_tag/list_tags.
- Handler: DELETE /<entity>/tags/{tagId}, idempotent on 404
(alreadyDeleted), invalidates the list_tags cache, explicit
confirm guard for direct callers (mirrors defineDelete).
- `delete_` prefix auto-applies destructiveHint via inferAnnotations
— no register-tool.ts change needed.
- Distinct from remove_tag_by_id (DETACH from one record); this
removes the definition from every record that shared it.
Catalog 87 → 88 tools; destructive-hinted 7 → 8. 529 → 536 tests
(+7). Bundle 167.37 KB stdio / 195.24 KB http. Tool-count + bundle
figures synced across README / DEPLOY / DESIGN / HOWTO /
bundle-shape canary. scripts/wire-trace-v167.ts committed for
re-runnability.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Acts on the post-v1.6.6 connector-gap audit — but only after a wire-trace probe (
scripts/wire-trace-v167.ts) graded each proposed tool buildable-or-not against the live API, instead of trusting the audit's confident-but-unchecked claims.GET /trackslist_tracksNOT buildable (the audit's "highest-leverage addition" has no endpoint). Documented in NOTES §33.DELETE /<entity>/tags/{id}delete_tag_definitionThe audit had also flagged "no people-at-org lookup" and "no party-type filter" as gaps — both already exist (
list_employees,filter_partiestype), and team-membership / custom-field-read-depth are hard Capsule API limits. So this one tool is the entire actionable surface from the audit.delete_tag_definition{entity, tagId, confirm: true}—entityselects the tag namespace (parties/opportunities/kases), same selector asadd_tag/list_tags.DELETE /<entity>/tags/{tagId}, idempotent on 404 (alreadyDeleted: true), invalidates thelist_tagscache, explicit confirm guard for direct callers (mirrorsdefineDelete).delete_prefix auto-appliesdestructiveHintviainferAnnotations— noregister-tool.tschange.remove_tag_by_id: that DETACHES a tag from one record (definition survives); this removes the definition from the namespace and from every record that shared it. The description spells out that blast radius; the confirm gate guards it.Test plan
tags.test.ts): per-entity DELETE path, idempotent 404, confirm-false/missing schema rejection, unknown-entity rejection, direct-call confirm guardmcp-integration.test.ts: catalog 87 → 88, present in writes / absent in read-only (delete_ prefix → hidden in read-only mode)tool-annotations.test.ts: destructive 7 → 8, total 88, aggregate buckets re-balanced (49 read / 8 destructive / 31 routine)Notes
scripts/wire-trace-v167.tsships for re-runnability (sameZZZ-*throwaway + cleanup pattern as v164–v166). Its probe-2 run was fully clean — the throwaway tag was created, deleted via the endpoint under test, and confirmed gone; nothing stranded.🤖 Generated with Claude Code