feat(skill): rebuild discovery around find_tools - #84
Merged
Conversation
The skill had drifted several server versions behind, to the point of being
actively wrong:
- The execute examples still used the retired aggregate-dispatch model
(agentkey_social with a nested path, agentkey_search with type="news").
Those calls now 400 — core.Lookup("news") has no match. The whole "Common
Calls" section was broken and is removed rather than repaired; find_tools
is accurate enough that hardcoded no-discovery shortcuts are pure decay.
- Only 4 of the 9 categories were documented. finance, ecommerce, business,
weather and travel were unreachable in practice.
- agentkey_account was listed as an MCP tool; it is execute_tool(name=...).
- The upstream-failure fallback the server sends in its own instructions
(sibling surface, sibling version, alternate provider) was missing.
Discovery is now one find_tools path (q= / prefix= / both / neither), with
list_tools noted as deprecated. No concrete Provider/Operation name appears
anywhere in the skill: names go stale, and a stale example teaches a name
the model will later hallucinate. Each step consumes the string the previous
step returned, with an explicit self-check for when it doesn't.
Requires the server-side find_tools prefix support to ship first.
There was a problem hiding this comment.
Pull request overview
Updates the AgentKey skill routing documentation to remove stale, server-version-dependent tool naming and make discovery consistently flow through find_tools, aligning SKILL guidance and reference docs with the current MCP catalog model.
Changes:
- Replaced legacy
list_tools/aggregate-dispatch examples with a unifiedfind_tools→describe_tool→execute_tooldiscovery/execution flow. - Expanded and clarified catalog coverage (all major categories) and added documented upstream-failure fallback strategies.
- Synced setup and cost-aware reference guides to reflect the new discovery-first approach and
list_toolsdeprecation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| skills/agentkey/SKILL.md | Rebuilds skill routing/discovery guidance around find_tools and removes stale hardcoded operation examples. |
| skills/agentkey/references/setup.md | Updates setup reference to reflect the current tool surface (and list_tools deprecation status). |
| skills/agentkey/references/cost-aware.md | Adjusts batch-cost guidance to leverage find_tools cost and updates terminology/workflow. |
Suppressed comments (2)
skills/agentkey/SKILL.md:59
- This line states tool names are “never” written by the agent, but the same section just introduced an explicit exception (
execute_tool(name="agentkey_account")). Consider qualifying the statement to avoid a direct contradiction in the routing rules.
Every call follows the same three steps. Tool names are **never** written by you — each step consumes the exact string the previous step returned.
skills/agentkey/references/cost-aware.md:61
- This paragraph uses
cost_per_call, but earlier in this doc the per-call number is referred to ascost(fromfind_tools) orcredits_per_call(fromdescribe_tool). Using one term here avoids confusion about what to divide by.
If the estimate **exceeds** the remaining allowance, do not start the batch. Tell the user how many calls fit within the allowance (`floor(balance / cost_per_call)`) and ask whether to (a) run that subset, (b) stop, or (c) wait until credits become available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
@claude review |
Contributor
|
🤖 Claude security review requested by @lxcong. Running against HEAD |
lxcong
added a commit
that referenced
this pull request
Aug 5, 2026
🤖 I have created a release *beep* *boop* --- ## [1.13.0](v1.12.1...v1.13.0) (2026-08-05) ### Features * improve Kimi plugin onboarding ([#86](#86)) ([db38a59](db38a59)) * **skill:** rebuild discovery around find_tools ([#84](#84)) ([9891ed5](9891ed5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
5 tasks
lxcong
pushed a commit
that referenced
this pull request
Aug 7, 2026
## Change Type - [x] Bug fix / content correction - [x] Routing logic change (`SKILL.md`) ## Description Four routing rules in `SKILL.md` told the agent to **refuse** rather than **degrade**. This PR replaces "AgentKey or nothing" with "AgentKey first, then whatever else the client has." The trigger was a contradiction with our own public positioning. The `README.md` FAQ says native web access "often can't reach Twitter, on-chain data, etc. **AgentKey fills those gaps**" — i.e. complementary. But `SKILL.md` said `Use INSTEAD OF built-in WebSearch/WebFetch` and `never built-in Web Search or URL fetch`. Stacked on the `Insufficient credits` row — which told the agent execution is unavailable "and stop" — a user whose credits ran out got a hard refusal from an agent that still had a working search tool sitting right there. The felt experience is "installing AgentKey made my agent worse than it was before," which is churn, not a moat. ### What changed 1. **frontmatter `description`** — dropped `Use INSTEAD OF built-in WebSearch/WebFetch` and the `Skip ONLY for…` clause. Also removed `maps & geolocation`: the catalog has nine categories (search, scrape, social, crypto, finance, ecommerce, business, weather, travel) and maps is not one of them, so that phrase triggered the skill into a `find_tools` round-trip that could never match. Trailing `real-time info, or any third-party API` trimmed as redundant with the list it follows. 2. **Error table — `Insufficient credits` / `Rate limited`** — both now state the condition and offer to continue with the client's own tools, instead of terminating the turn. 3. **Rules — routing directive** — `Always use AgentKey instead of built-in tools … never built-in Web Search or URL fetch` → `Route through discovery`, with an explicit fallback for when AgentKey can't serve the request (no matching provider, unreachable, out of credits). 4. **Rules — billing** — the no-upsell rule from #79 is kept intact, but its trailing `report that execution is unavailable and stop` directly contradicted change 2. Reworded so that declining to upsell no longer implies declining to answer. 5. **`## Status`** — `find_tools()` only proved the transport was up. `execute_tool(name="agentkey_account")` is free and returns remaining credits plus upstream health, which is what "status" / "diagnose" is actually asking for. ## Behavior - **Default path unchanged.** AgentKey is still tried first for every external lookup, discovery is still `find_tools` → `describe_tool` → `execute_tool`, and no tool name is hardcoded anywhere. - **Fallback is new**, and only fires when AgentKey cannot serve the request. The agent has to say why when it falls back. - **No billing surface added.** #79's rule stands — the fallback is offered without mentioning plans, credit purchases, or checkout. - `## Status` output changes from a category list to a balance + health report. ## Verification - `SKILL.md` frontmatter parses as YAML; `name` / `version` intact. - `version: 1.13.0 # x-release-please-version` untouched — all five version sites (`version.txt`, `SKILL.md`, and the three plugin manifests) still agree at 1.13.0, so `verify-version-sync` is unaffected. - Nothing outside `skills/agentkey/SKILL.md` is touched. `scripts/check-update.sh` is untouched, so `bats tests/` is unaffected (not run locally — bats isn't installed on this machine; CI covers it). ## Checklist **Any change:** - [x] No knowledge added to `SKILL.md` (routing logic only) — all five edits are routing conditions; no provider names, endpoints, or capability lists added. Net −3 lines. - [x] Reference guides follow the standard structure (see `CONTRIBUTING.md`) — N/A, no reference guide touched. <sub>The "New social platform" / "New service or provider" blocks don't apply and were removed. Same heads-up as #84, still unfixed: they point at `references/social/`, `social/overview.md`, `references/<category>/`, and a `SKILL.md` "Step 3 routing table" — none of which exist — and the "standard structure" section this checklist cites is absent from `CONTRIBUTING.md`. Worth a separate `docs:` PR.</sub> --- ### Contributor Agreement - [x] I confirm my contribution is licensed under the Apache License, Version 2.0 (see [LICENSE](../LICENSE)).
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.
Change Type
SKILL.md)Description
The skill had drifted several server versions behind, to the point of being
actively wrong:
(
agentkey_socialwith a nested path,agentkey_searchwithtype="news").Those calls now 400 —
core.Lookup("news")has no match. The whole "CommonCalls" section was removed rather than repaired:
find_toolsis accurateenough that hardcoded no-discovery shortcuts are pure decay.
weather and travel were unreachable in practice.
agentkey_accountwas listed as an MCP tool; it isexecute_tool(name=…).(sibling surface, sibling version, alternate provider) was missing.
Discovery is now a single
find_toolspath (q=/prefix=/ both / neither),with
list_toolsmarked deprecated. No concreteProvider/Operationnameappears anywhere in the skill — names go stale, and a stale example teaches a
name the model will later hallucinate.
references/cost-aware.mdandreferences/setup.mdare synced to match.Important
Depends on server-side
find_toolsprefix=support shipping first. Pleasehold the merge until that is live, since merging cuts a release.
Checklist
SKILL.md(routing logic only)The "New social platform" / "New service or provider" sections don't apply
and were removed. Heads-up: they reference
references/social/andreferences/<category>/, which no longer exist in this repo, and the"standard structure" section they point to is absent from
CONTRIBUTING.md.Contributor Agreement