feat: tools get accepts numeric IDs; add channels get#91
Merged
Conversation
tools get (#69): the endpoint is name-keyed, but `tools list` leads with an ID column, so a copied ID produced a confusing 404. An all-digits arg that 404s by name is now resolved to the tool's name via the list endpoint's id search (exact client-side match) and retried; unknown IDs surface the original 404. Help examples no longer show numeric args for the name-keyed get/update/delete. channels get (#70): new command for parity with other resources. The API has no by-ID GET for channels (the by-id path only supports DELETE), so the channel is resolved via the list endpoint's id search and printed as a single item — same shape as one item from `channels list -o json`. Not-found exits 1 pointing at channels list. Both live-verified against the cli-test org. Closes #69 Closes #70 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Two get-by-ID ergonomics features, both resolved client-side because the API lacks the endpoints.
tools getaccepts numeric IDs (#69)The get endpoint is name-keyed (
/api/v1/tools/{tool_name}is all the spec offers), buttools listleads with an ID column — copying it produced404: Tool with name 425 not found. Per the issue's stated preference ("accept either"):search_fields=id, exact client-side match in case the server matches substrings) and retry.syllable tools list."Also fixes the misleading help examples (
tools get 5→tools get my_tool, same for update/delete — all three are name-keyed).syllable channels get <channel-id>(#70)New command for parity with every other resource. The API has no by-ID GET for channels (the
{channel_id}path only supports DELETE — see the triage note on the issue), so this resolves via the list endpoint's id search and prints the matching item — exactly the shape of a single item fromchannels list -o json, as the issue requested. Not-found exits 1 pointing atchannels list. The help text documents the client-side mechanism; if the platform adds a by-ID GET later, spec drift will flag it and the command can switch over.Verification
Unit tests (stub server): fallback chain (name-miss → id-resolve → name-get), by-name single-request, unknown-ID keeps original 404, channels exact-match-wins (ids 4 vs 40), channels not-found.
Live against the
cli-testorg:Closes #69
Closes #70
🤖 Generated with Claude Code