Loading...
Loading...
Design MCP prompts to expose reusable prompt templates. Use when creating parameterized prompts in xmcp.
npx skill4agent add xmcp-dev/skills prompt-designsrc/prompts/src/prompts/{prompt-name}.ts// 1. Schema (optional) - Define parameters with Zod
export const schema = { /* ... */ };
// 2. Metadata (optional) - Prompt configuration
export const metadata: PromptMetadata = { /* ... */ };
// 3. Handler (required) - Default export function
export default function handler(params?) { /* ... */ }import { type PromptMetadata } from "xmcp";
// For parameterized prompts
import { z } from "zod";
import { type InferSchema, type PromptMetadata } from "xmcp";| Field | Type | Required | Description |
|---|---|---|---|
| string | No* | Unique prompt identifier |
| string | No | Human-readable title |
| string | No | What this prompt does |
| string | No | "user" or "assistant" (default: user) |
| Return Type | Use Case |
|---|---|
| Simple text prompt |
| Explicit text content |
| Image content |
| Multiple content blocks |
references/patterns.mdsrc/prompts/{prompt-name}.tsnametitledescription.describe()pnpm build