Let a catalog search name a scope without a query - #17
Merged
Conversation
The gateway's ranked search accepts any non-empty combination of q, category and platform, so /catalog/search?platform=reddit is a 200. The CLI could not express that: `search` took the query positionally and `AnyApiClient.search` unconditionally set `q`, so "every reddit API" was reachable over MCP and over curl but not over `anyapi search`. The query argument is now optional and `--category`/`--platform` join it, following `list --category` rather than inventing a new flag shape. `anyapi search reddit` is unchanged. An absent query is omitted from the query string rather than sent empty, and a search naming none of the three is rejected in the client with a clear message instead of being sent to the gateway to earn a 400. The bundled anyapi-discover skill and the README document the scope form, because they document this command's usage. Co-Authored-By: Claude Opus 5 (1M context) <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.
What was broken
The gateway's ranked search requires at least one of
q,category,platform, in any combination. Measured against production today:The CLI was stricter.
searchtook the query positionally andAnyApiClient.searchunconditionally calledurl.searchParams.set('q', options.query), so "every reddit API" was expressible over MCP and over curl but impossible throughanyapi search. Gateway PR getanyapi-com/anyapi#1013 relaxed the MCP side; the CLI was never updated.What changed
anyapi search [query]- the query argument is now optional, and--category <category>/--platform <platform>join it. The flag shape follows the existinganyapi list --category, not a new convention.AnyApiClient.searchomitsqentirely when there is no query. It never sends it empty.Search needs a query, --category, or --platform.and never reaches the gateway.anyapi-discoverskill and the README document the scope form, since this command's documented usage changed.anyapi search redditis unchanged. No limit, default, or cap was introduced.The tolerant-reader rules are untouched:
readSearchResponsestill rejectscreditkeys and anyproviderthat is not"AnyAPI", and nothing derives or repairs relationships among returned fields.Proof
Gate, on this branch:
Both new tests were confirmed red against the pre-fix
searchbody:Live against
https://api.getanyapi.com, from the built CLI:Not in this PR
No version bump, tag, or npm publish. Releasing is a separate decision.
The sibling fix for the n8n node is in
getanyapi-com/n8n-nodes-anyapi.🤖 Generated with Claude Code