Skip to content

feat: tools get accepts numeric IDs; add channels get#91

Merged
yorkable merged 1 commit into
mainfrom
feat/tools-get-id-channels-get
Jun 4, 2026
Merged

feat: tools get accepts numeric IDs; add channels get#91
yorkable merged 1 commit into
mainfrom
feat/tools-get-id-channels-get

Conversation

@yorkable

@yorkable yorkable commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Two get-by-ID ergonomics features, both resolved client-side because the API lacks the endpoints.

tools get accepts numeric IDs (#69)

The get endpoint is name-keyed (/api/v1/tools/{tool_name} is all the spec offers), but tools list leads with an ID column — copying it produced 404: Tool with name 425 not found. Per the issue's stated preference ("accept either"):

  1. Try by name first (zero overhead for the normal path — one request).
  2. On a 404 with an all-digits arg, resolve ID → name via the list endpoint's id search (search_fields=id, exact client-side match in case the server matches substrings) and retry.
  3. Unknown IDs surface the original 404 — which now also carries the context-aware hint from fix: pure JSON schema output, byte-safe takeouts, context-aware 404 hints #88: "This command takes a name, not a numeric ID — copy the NAME column from syllable tools list."

Also fixes the misleading help examples (tools get 5tools 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 from channels list -o json, as the issue requested. Not-found exits 1 pointing at channels 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-test org:

$ syllable --org cli-test tools get 523        → resolves to web_search ✓
$ syllable --org cli-test channels get 76      → Syllable Web Chat ✓
$ syllable --org cli-test channels get 999     → exit 1, "run `syllable channels list`" ✓

Closes #69
Closes #70

🤖 Generated with Claude Code

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]>
@yorkable
yorkable merged commit 7878d6c into main Jun 4, 2026
2 checks passed
@yorkable
yorkable deleted the feat/tools-get-id-channels-get branch June 4, 2026 06:31
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.

Add 'channels get <channel-id>' (parity with other resources) tools get: help example uses numeric ID but command requires a name

1 participant