원클릭으로
create-tool
Create a new xmcp tool with schema, metadata, and handler. Use when the user wants to add a new tool to their xmcp project.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create a new xmcp tool with schema, metadata, and handler. Use when the user wants to add a new tool to their xmcp project.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Guide for designing effective MCP servers with agent-friendly tools. Use when creating a new MCP server, designing MCP tools, or improving existing MCP server architecture.
Design MCP prompts to expose reusable prompt templates. Use when creating parameterized prompts in xmcp.
Design MCP resources to expose content for LLM consumption. Use when creating static or dynamic resources in xmcp.
Best practices for designing UI widgets in xmcp. Use when creating interactive widgets for GPT Apps or MCP Apps, choosing between React components and template literals, designing widget layouts, handling state and data fetching, or troubleshooting widget rendering issues.
| name | create-tool |
| description | Create a new xmcp tool with schema, metadata, and handler. Use when the user wants to add a new tool to their xmcp project. |
| metadata | {"argument-hint":"[tool-name]"} |
You are helping the user create a new xmcp tool. Follow this interactive workflow.
Before generating any code, ask the user these questions using AskUserQuestion:
Tool name (if not provided as argument): What should the tool be named? (Use kebab-case)
Handler type: Ask which handler type they need:
Schema fields: What parameters should the tool accept? Ask for:
Annotations: Ask about behavior hints:
Widget support (if Template Literal or React): Ask if they need:
Create the tool file in src/tools/ with the appropriate extension:
.ts for Standard and Template Literal handlers.tsx for React Component handlerssrc/tools/{tool-name}.ts # or .tsx for React
Every xmcp tool has three main exports:
// 1. Schema (optional) - Define parameters with Zod
export const schema = { /* ... */ };
// 2. Metadata (optional) - Tool configuration
export const metadata: ToolMetadata = { /* ... */ };
// 3. Handler (required) - Default export function
export default function handler(params) { /* ... */ }
import { z } from "zod";
import { type InferSchema, type ToolMetadata } from "xmcp";
| Type | Use Case | File Extension |
|---|---|---|
| Standard (string) | Simple queries, calculations | .ts |
| Standard (async) | API calls, database queries | .ts |
| Template Literal | HTML widgets, iframes, scripts | .ts |
| React Component | Interactive stateful UIs | .tsx |
| No Parameters | Tools that don't need input | .ts |
| With Extra Args | Auth/context-dependent tools | .ts |
| Annotation | Use When |
|---|---|
readOnlyHint: true | Tool doesn't modify environment |
destructiveHint: true | Tool may delete/modify data |
idempotentHint: true | Repeated calls have same effect |
openWorldHint: true | Tool interacts with external world |
For complete code templates including:
Read: references/templates.md
src/tools/{tool-name}.ts (or .tsx).describe() for all parametersname and descriptionSuggest running pnpm build to verify the tool compiles correctly.
SOC 직업 분류 기준