agent-tool-builder
Design tools for AI agents — clean function interfaces, typed schemas, informative errors, idempotency, and tool documentation. Use when giving an agent new capabilities or fixing flaky tool use.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- agent-tool-builder
- category
- ai-research
- description
- Design tools for AI agents — clean function interfaces, typed schemas, informative errors, idempotency, and tool documentation. Use when giving an agent new capabilities or fixing flaky tool use.
03 SKILL.md 正文
Agent Tool Builder
Tools are the agent's hands and senses. A well-designed tool is small, predictable, and self-documenting; a bad one is the source of most agent unreliability. Build tools like public APIs — because to the agent, they are.
Overview
The model sees only a tool's name, description, and schema. Everything else — side effects, latency, failure modes — is invisible until it bites. Good tool design therefore means: narrow scope, explicit schemas, errors that explain how to recover, and descriptions written for a reader that takes everything literally. Test each tool as a standalone function before the agent ever calls it.
When to use
- Adding a new capability to an agent (search, database, file ops, API calls).
- The agent misuses an existing tool: wrong arguments, wrong tool chosen, ignoring errors.
- Consolidating several overlapping tools into one clean interface.
- Writing tools that wrap internal APIs for agent consumption.
Core concepts
- Single responsibility: one tool, one job. A
search_orderstool beats ado_database_stufftool every time. - Schema as documentation: typed parameters with descriptions, enums for fixed choices, sensible defaults. The schema is the primary instruction the agent reads.
- Descriptive naming:
get_customer_order_status, notquery2. Names should make the right tool choice obvious. - Informative errors: errors should say what went wrong and what to try next ("order not found; try listing orders for this customer with list_orders").
- Idempotency: repeated identical calls should be safe. Agents retry; design for it — use idempotency keys for writes.
- Least privilege: each tool exposes only what the agent needs. A read-only variant for exploration, a write variant with stricter gating.
Practical workflow
- Write the tool's contract first: name, description, parameters, return shape, error cases — before any code.
- Implement it as a plain function with no agent-specific logic; test it standalone with representative inputs.
- Write the description for a literal-minded reader: what it does, when to use it, what the arguments mean, what errors mean.
- Add validation at the boundary: reject bad inputs with helpful messages rather than failing deep inside.
- Load-test the failure paths: timeouts, empty results, malformed data. The agent will hit all of them.
- Version the tool contract; log every call with arguments for debugging agent behavior.
Tool contract template:
NAME: get_order_status
DOES: Returns current status + tracking for one order.
ARGS: order_id (string, required) — the ID from list_orders
RETURNS:{status, tracking_url, updated_at}
ERRORS: NOT_FOUND → use list_orders to find valid IDs
AUTH → credentials missing; escalate to user
Common pitfalls
- Vague descriptions: "queries the database." The agent can't choose tools it doesn't understand. Describe inputs, outputs, and when to use it.
- Mega-tools: one tool with a mode parameter doing five things. Split them; the agent picks tools, not modes.
- Silent failures: returning empty results or generic errors. The agent will hallucinate around the gap — make errors loud and specific.
- Non-idempotent writes: the agent retries a failed payment and charges twice. Design writes to be safely repeatable.
- Leaking internals: stack traces and internal IDs in tool output. Sanitize; give the agent actionable information.
- No logging: when the agent misbehaves you need the call history. Log every invocation with arguments and results.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).