← Back to Dashboard
1. Prompt Templates2. Dynamic Arguments3. Context Assembly

Dynamic Arguments

📚 Prompts8 min90 XP

Parametrizing Context

Prompts achieve their power through arguments. Just like tools, you can use Zod to define what inputs a prompt requires.

server.prompt(
  "generate_report",
  { 
    department: z.string().describe("e.g. Sales, Marketing"),
    quarter: z.string().describe("e.g. Q1-2026")
  },
  ({ department, quarter }) => ({
    // Build context tailored to the department and quarter...
  })
);

When the user selects "Generate Report" in Claude Desktop, the UI will prompt them to type in the Department and Quarter before creating the message block.

🧪 Knowledge Check
Press 1-4 to select1 of 3
How do you enforce strongly-typed arguments for a Prompt?
By using Zod schema definitions.
By using TypeScript interfaces.
It is not possible; Prompts only take raw text.
By throwing errors at runtime.
Watch: 139x Rust Speedup
Dynamic Arguments | Prompts — MCP Academy