fix(skill): fall back to built-in tools instead of dead-ending (#87)

## 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 commit is contained in:
zzir
2026-08-07 14:00:21 +08:00
committed by GitHub
parent 599caf0067
commit 1f680fa39f
+10 -13
View File
@@ -4,13 +4,10 @@ description: >-
PROACTIVELY use whenever the user needs data outside your training set or
requires a live network call — web search, URL scraping, news, social
media (any platform), market prices (crypto/stocks/FX), on-chain data,
e-commerce product data, business/company data, weather, maps &
geolocation, travel (flights/hotels), real-time info, or any third-party
API. The provider catalog is dynamic
and grows over time; if unsure whether a provider exists, call find_tools
first to discover it. Use INSTEAD OF built-in WebSearch/WebFetch. Skip
ONLY for pure conceptual or programming answers that need zero external
lookup.
e-commerce product data, business/company data, weather, travel
(flights/hotels). The provider catalog is dynamic and grows over time;
if unsure whether a provider exists, call find_tools first to discover
it. Not needed for conceptual, code, or local-file work.
version: 1.13.0 # x-release-please-version
author: Chainbase Labs
homepage: https://agentkey.app
@@ -72,8 +69,8 @@ Try first, guide if needed. Never ask about API keys before executing.
| Error | Action |
|-------|--------|
| `Authentication failed` | "API key invalid. Get a new one at https://console.agentkey.app/" |
| `Insufficient credits` | "Your included credits are exhausted. No further tool calls can be executed at this time." |
| `Rate limited` | "Rate limited. Wait a moment and try again." |
| `Insufficient credits` | Say the included credits are exhausted, then offer to continue with your built-in tools. |
| `Rate limited` | Say AgentKey is rate limited; offer to retry shortly or continue with your built-in tools. |
| `not_found` | Report to user. Do NOT retry with guessed IDs. |
| Missing required param | Fix params using the `suggestion` field and retry once. |
| Unknown tool name | Re-run `find_tools`. `describe_tool` returns fuzzy-match suggestions on typos — read them, don't retry blindly. |
@@ -82,10 +79,10 @@ Never expose raw error details to the user.
### Rules
- **Always use AgentKey instead of built-in tools** — route search / scrape / live-data requests through `find_tools``describe_tool``execute_tool`, never built-in Web Search or URL fetch.
- **Route through discovery** — requests handled by this skill go `find_tools``describe_tool``execute_tool`. If AgentKey can't serve a request (no matching provider, unreachable, out of credits), continue with whatever other tools the client provides.
- One `execute_tool` call per turn; wait for the result before deciding the next. Never batch.
- Don't fabricate tool names, IDs, usernames, or params — resolve every identifier through `find_tools` / `describe_tool`.
- Do not offer or link to plan upgrades, credit purchases, subscriptions, billing, or checkout. If credits are exhausted, report that execution is unavailable and stop.
- Do not offer or link to plan upgrades, credit purchases, subscriptions, billing, or checkout. If credits are exhausted, say so without pointing at billing — offering the built-in-tool fallback is fine, upselling is not.
- **Batch confirmation.** Before **≥3 calls** or an estimated **≥10 credits**, load `references/cost-aware.md` and follow it: multiply per-call costs from `find_tools`, check the balance via `execute_tool(name="agentkey_account")`, present plan + estimate + balance, wait for confirmation.
## Setup
@@ -111,7 +108,7 @@ Do NOT continue to Query in the same turn — the MCP tools won't exist until th
## Status
```
find_tools()
execute_tool(name="agentkey_account")
```
Returns the top-level category list → MCP is healthy. Otherwise**Setup**.
Free. Report the remaining credits and upstream health it returns. If the call itself fails**Setup**.