tool-schema-design
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "tool-schema-design" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-238a25d72896b895c489dc199487f4af721f8fd6a4539d16cd53cbd737f854b3. Verify the upstream source and version against https://github.com/seb1n/awesome-ai-agent-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Design and validate model-facing tools with: clearly defined names, action-oriented descriptions, bounded JSON Schema parameters, explicit statement of side effects, secure defaults, idempotency requirements, error handling strategies, and real-world testing. Applicable to building function-call tools, MCP tools, agent actions, or structured tool inputs, and for safeguards when models choose wrong tools, fabricate parameters, or produce unsafe side effects.
Introduction source: third_party · seb1n · 0.0.1 Reference
SkillPi interpretation
- Tasks
- 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.
- Audience
- 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 and outputs
- 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.
- Testing
- Not tested
Browse files
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.
Version history
-
v1.0.0
GitHub ↗
Original release notes
## 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).
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的工具定义设计与验证工作流
- 解决AI工具开发中的实际问题:工具选择错误、参数虚构、副作用不安全
- 适用于函数调用、MCP工具、代理动作等多种场景
Highlights
- 触发描述精准完整,覆盖多种变体
- 边界清晰,明确说明适用和不适用场景
Highlights
- 结构完整,包含Use when、Inputs、Output contract等必要章节
- 步骤清晰,有出口条件和端到端示例
- frontmatter完整,文档长度合理
Areas to improve
-
引用文件缺失 Reported severity: Major
SKILL.md 引用了 references/schema-patterns.md 文件但未传入
Recommendation: 请补充 references/schema-patterns.md 文件或移除相关引用
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 19, 43, 49
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.