본문으로 건너뛰기
cccskills
무료GitHub에 공개

tool-schema-design

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md5.8 KB
  • agents/openai.yaml208 B
  • references/schema-patterns.md4.2 KB
  • scripts/validate_tool_schema.py14.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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:

  1. A tool-boundary decision and overlap analysis.
  2. A model-facing name and description with explicit use and non-use conditions.
  3. A valid parameter schema with constraints, examples, and unknown-field policy.
  4. Side-effect, confirmation, authorization, idempotency, timeout, and error contracts.
  5. Positive, boundary, adversarial, and tool-selection tests.
  6. Validation results and any provider-specific limitations.

Workflow

  1. 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.
  2. 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.
  3. 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.
  4. Reject unknown fields when the runtime supports it. Represent conditional shapes with separate tools or explicit schema branches instead of prose-only dependencies.
  5. 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.
  6. Define execution semantics outside the JSON shape: read-only versus mutating, confirmation level, idempotency key, retry safety, timeout, partial success, and compensating action.
  7. 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.
  8. 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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit web interfaces against WCAG 2.1 AA/AAA standards, identify violations, and produce actionable remediation reports with code fixes. Use when the user requests accessibility testing or provides relevant inputs for this workflow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

Design reproducible evaluations for AI agents with representative task sets, explicit rubrics, appropriate graders, baselines, regression gates, and failure analysis. Use when defining agent quality, comparing prompts or models, validating a release, measuring tool-use reliability, investigating regressions, or deciding whether an agent is ready for production.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

Design privacy-aware observability for AI agents using traces, spans, structured events, metrics, cost attribution, dashboards, alerts, and investigation workflows. Use when instrumenting an agent, debugging intermittent tool or model failures, defining service-level objectives, analyzing latency or spend, auditing agent decisions, or preparing production monitoring.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

Plan, execute, document, and retest authorized security assessments of AI agents and multi-agent workflows using safe adversarial cases, synthetic identities, canaries, and evidence-based findings. Use when defining red-team rules of engagement, assessing prompt injection or excessive agency, testing tool and identity boundaries, evaluating memory or cross-agent attacks, scoring a campaign, or verifying remediation in an approved environment.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

Generate comprehensive marketing analytics reports by collecting KPIs, analyzing trends, and delivering actionable insights with attribution modeling and funnel analysis. Use when the user requests analytics reporting or provides relevant inputs for this workflow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

Design RESTful APIs with proper resource modeling, HTTP method semantics, status codes, pagination, versioning, and documentation. Use when the user requests api design or provides relevant inputs for this workflow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

seb1n/awesome-ai-agent-skills2232026년 8월 10일 업데이트

seb1n의 스킬 모두 보기

이 스킬의 문제 신고