tool-schema-design
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "tool-schema-design":https://skillpi.com/zh/skills/deepskill-238a25d72896b895c489dc199487f4af721f8fd6a4539d16cd53cbd737f854b3。安装前核对上游来源和版本:https://github.com/seb1n/awesome-ai-agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
为面向模型的工具设计并验证:明确定义的名称、以动作为导向的描述、有边界的 JSON Schema 参数、明确的副作用说明、安全默认值、幂等性要求、错误处理策略与真实测试。适用于创建函数调用工具、MCP 工具、代理动作或结构化工具输入,以及在模型选错工具、虚构参数或引发不安全副作用时的防护设计与验证。
介绍来源: third_party · seb1n · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: tool-schema-design
description: Design and validate model-facing tool definitions with clear names, action-oriented descriptions, bounded JSON Schema parameters, explicit side effects, safe defaults, idempotency, errors, and realistic tests. Use when creating function-calling tools, MCP tools, agent actions, structured tool inputs, or when a model selects the wrong tool, invents arguments, or causes unsafe side effects.Tool Schema Design
Make the safe, intended call easier for a model to choose than an ambiguous or destructive alternative.
Use when
- Add or revise a function-calling, MCP, plugin, or internal agent tool.
- Split an overloaded API operation into model-usable actions.
- Reduce wrong-tool selection, malformed arguments, or fabricated fields.
- Document authorization, confirmation, idempotency, and error behavior.
Inputs
Collect supported user intents, backend operation semantics, required credentials, actor and tenant scope, side effects, reversibility, latency, rate limits, failure modes, and provider-specific schema constraints. Obtain representative valid and invalid requests.
Output contract
Produce:
- A tool-boundary decision and overlap analysis.
- A model-facing name and description with explicit use and non-use conditions.
- A valid parameter schema with constraints, examples, and unknown-field policy.
- Side-effect, confirmation, authorization, idempotency, timeout, and error contracts.
- Positive, boundary, adversarial, and tool-selection tests.
- Validation results and any provider-specific limitations.
Workflow
- Define one coherent user intent per tool. Split tools whose modes have different permissions, side effects, or required fields; avoid tiny tool sets with indistinguishable names.
- Choose a stable verb-led name. Write the description to say what the tool does, when to call it, when not to call it, and what state it changes.
- Design parameters from user intent rather than mirroring a backend SDK. Require only indispensable fields, use enums for closed choices, set numeric and length bounds, and describe formats and units. Read schema-patterns.md for composition and mutation patterns.
- Reject unknown fields when the runtime supports it. Represent conditional shapes with separate tools or explicit schema branches instead of prose-only dependencies.
- Keep actor identity, authorization scope, and trusted tenant context server-side. Do not ask the model to supply secrets or claims the runtime already knows.
- Define execution semantics outside the JSON shape: read-only versus mutating, confirmation level, idempotency key, retry safety, timeout, partial success, and compensating action.
- Return compact structured results and stable machine-readable error codes. Distinguish invalid input, denied authorization, confirmation required, conflict, rate limit, dependency failure, and unknown failure.
- Test tool selection against neighboring tools and test execution with valid, omitted, extra, boundary, malicious, and stale inputs.
Use python3 scripts/validate_tool_schema.py tool.json --strict before wiring the schema into a runtime. Structural errors always fail. Strict mode also fails on review findings such as free-form command execution, caller-controlled privilege flags, credential parameters, arbitrary URL/path surfaces, permissive unknown fields, and useful missing bounds. structurally_valid describes JSON shape only; even strict_pass: true is not a semantic safety, authorization, sandbox, provider-compatibility, or implementation certification.
Safety and permissions
- Enforce authorization in the tool implementation; never rely on the model description as a security boundary.
- Require explicit confirmation for purchases, messages, deployments, deletion, permission changes, or other consequential mutations.
- Do not expose secret parameters, raw credentials, unrestricted shell commands, or arbitrary URLs and file paths unless the use case and sandbox require them.
- Prefer allowlists, scoped identifiers, dry runs, idempotency keys, and reversible operations.
- Treat tool output as untrusted input before placing it back into model context.
Verification
- Parse and validate the schema with the target provider, not only the bundled structural/heuristic validator or a generic JSON Schema validator.
- Confirm every required field is declared, every enum is reachable, arrays define item shapes, and unknown-field handling matches the implementation.
- Run contrastive prompts that should choose this tool, a neighboring tool, or no tool.
- Verify denied and confirmation-required calls do not perform side effects.
- Compare implementation behavior, returned errors, and documentation for drift.
Failure handling
- If provider schema features differ, reduce to the supported subset and record the lost constraint in runtime validation.
- If tool selection is ambiguous, sharpen names and descriptions or merge indistinguishable tools; do not depend on prompt ordering.
- If malformed calls persist, simplify nesting, remove redundant fields, and add schema bounds plus server-side validation.
- If a mutation times out, query operation status by idempotency key before retrying.
- If backend behavior conflicts with the contract, fail closed on consequential actions and fix the adapter before release.
Example
For “let an assistant reschedule a calendar event,” separate event lookup from mutation; name the mutation reschedule_calendar_event; require an opaque event ID, timezone-aware start and end timestamps, and an idempotency key; keep account identity server-side; reject unknown fields; require confirmation when attendees will be notified; return a preview or updated event plus a stable status; and test missing timezone, end-before-start, stale event, unauthorized calendar, duplicate retry, and nearby “create event” prompts.
版本历史
-
v1.0.0
GitHub ↗
原版更新说明
## Build agents you can evaluate, observe, control, and defend `v1.0.0` is the first stable release of Awesome AI Agent Skills: **103 self-contained Agent Skills across 21 categories**, compatible with Claude Code, OpenAI Codex, Gemini CLI, Cursor, GitHub Copilot, Windsurf, and other Agent Skills-compatible tools. ### Production Agent Stack This release introduces an end-to-end, reproducible release-gate workflow built from six complementary skills: - **Agent Evaluation** — representative cases, explicit graders, baselines, and release gates - **Agent Observability** — privacy-aware traces, metrics, and investigations - **Tool Schema Design** — bounded model-facing tools with explicit side effects - **Human in the Loop** — auditable approval gates and safe state transitions - **Prompt Injection Defense** — trust boundaries for instructions, content, credentials, tools, and output - **Agent Red Teaming** — authorized adversarial campaigns with measurable outcomes ### Try the demo Can a poisoned GitHub issue hijack a deployment agent? The demo replays that scenario entirely offline, first through a fragile boundary and then through the six production controls. ```bash python3 demos/production-agent-stack/run_demo.py --check ``` Expected fixture result: ```text Fragile boundary: 1/5 checks passed Controlled boundary: 5/5 checks passed Evaluation: 20% -> 100% Red-team replay: 5 passed, 0 failed ``` [Read the complete demo walkthrough](https://github.com/seb1n/awesome-ai-agent-skills/tree/v1.0.0/demos/production-agent-stack) ### Install the stack ```bash npx skills add seb1n/awesome-ai-agent-skills \ --skill agent-evaluation \ --skill agent-observability \ --skill tool-schema-design \ --skill human-in-the-loop \ --skill prompt-injection-defense \ --skill agent-red-teaming ``` ### Other new capabilities The expanded catalog also includes: - `mcp-server-building` - `multi-agent-orchestration` - `skill-supply-chain-audit` - `pdf-processing` - `spreadsheet-analysis` - `eu-ai-act-readiness` ### Validation The release is checked with: ```bash python3 scripts/validate_skills.py python3 demos/production-agent-stack/run_demo.py --check --no-color ``` The demo uses inert fixtures, Python's standard library, simulated approval and campaign-authorization records, and local mock effects. It makes no model calls, network requests, shell invocations, or real deployments. Passing validates deterministic outcomes for these committed fixtures and evidence contracts; it is not a security certification, human approval, or live-model evaluation. ### Contribute Try the demo, report unclear behavior, or improve a skill through a pull request. See the [contribution guide](https://github.com/seb1n/awesome-ai-agent-skills/blob/v1.0.0/CONTRIBUTING.md).
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的工具定义设计与验证工作流
- 解决AI工具开发中的实际问题:工具选择错误、参数虚构、副作用不安全
- 适用于函数调用、MCP工具、代理动作等多种场景
亮点
- 触发描述精准完整,覆盖多种变体
- 边界清晰,明确说明适用和不适用场景
亮点
- 结构完整,包含Use when、Inputs、Output contract等必要章节
- 步骤清晰,有出口条件和端到端示例
- frontmatter完整,文档长度合理
待提升项
-
引用文件缺失 原报告严重程度:重大
SKILL.md 引用了 references/schema-patterns.md 文件但未传入
改进建议:请补充 references/schema-patterns.md 文件或移除相关引用
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 19, 43, 49 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。