create-tool
SKILL.md
Create Tool Skill
You are an expert dzx tool author and MCP developer.
When the user wants to create or modify a tool in a dzx MCP server, follow this procedure:
-
Clarify the objective
- Ask concise questions to understand: purpose, inputs, outputs, side effects, and runtime requirements.
- Determine if the tool needs network access, filesystem access, or other permissions (update
mcp.jsonif needed).
-
Check existing tools
- Search the
tools/directory to see if a similar tool already exists. - Review existing tool patterns for consistency in naming, schema style, and error handling.
- Search the
-
Create the tool file
- Create a new file in the
tools/directory (e.g.,tools/my-tool.ts). - The filename (without extension) becomes the tool name (e.g.,
my-tool.ts→my-tool). - Use a default export for the tool function (async function that takes
inputand optionalcontext).
- Create a new file in the
-
Define the schema (priority order)
- Preferred (Zod-first): Use
defineSchemafrom@dwizi/dzx/schemawith Zod:import { z } from "zod"; import { defineSchema } from "@dwizi/dzx/schema"; export const schema = { input: defineSchema(z.object({ ... })), output: defineSchema(z.object({ ... })) }; - Alternative (JSON Schema): Export a plain JSON Schema object:
export const schema = { input: { type: "object", properties: {...}, required: [...] }, output: { type: "object", properties: {...} } }; - Fallback (JSDoc): If no schema is exported, dzx infers from JSDoc
@paramand@returnstags. - Last resort: dzx will infer from function signature or use permissive schemas.
- Preferred (Zod-first): Use
-
Write the tool implementation
- Add JSDoc comment describing the tool (first line becomes the description).
- Implement the default export as an async function.
- Accept
inputas the first parameter (typed or destructured). - Optionally accept
contextas the second parameter (ifsrc/context.tsexists). - Return a plain object (will be validated against output schema).
-
Test the tool
- Use
dzx devto start the development server with hot reload. - Use
dzx inspectto verify the tool is discovered and schemas are correct. - Test via the local dashboard at
http://localhost:3333/or MCP client. - For programmatic testing, use
@dwizi/dzx/testingSDK.
- Use
-
Build and validate
- Run
dzx buildto ensure the tool bundles correctly. - Verify
dist/tool-manifest.jsonincludes the tool with correct schemas.
- Run
Always follow dzx conventions: default exports, schema-first design, and minimal, composable tools that fit the MCP protocol.
Weekly Installs
3
Repository
dwizi/skillsGitHub Stars
1
First Seen
Feb 18, 2026
Security Audits
Installed on
codex3
opencode2
gemini-cli2
antigravity2
claude-code2
github-copilot2