Chapter 6 Exercises

These exercises will help you design effective prompts and workflows that give users control.

Quiz

Test your understanding of resources, prompts, and workflows:

Exercises

  1. Prompt Design Workshop ⭐⭐ Intermediate (25 min)

    • Design structured analysis prompts
    • Create safe data modification workflows
    • Build context-setting prompts for exploration
  2. Building and Validating Hard Workflows ⭐⭐ Intermediate (30 min)

    • Build a SequentialWorkflow with multiple steps
    • Write validation tests for structural correctness
    • Use cargo pmcp validate workflows for project validation
    • Understand binding names vs step names

Key Concepts to Practice

  • Prompts as User Control: Users explicitly choose workflows by invoking prompts
  • Numbered Steps: AI follows explicit, numbered steps more reliably
  • Guard Rails: Preview, confirm, then execute for dangerous operations
  • Tool References: Name specific tools in prompts so AI knows what to use

Resources vs Tools Quick Reference

Use Resources ForUse Tools For
Schema and structureParameterized queries
ConfigurationWrite operations
Reference dataExternal integrations
DocumentationComputed results

Next Steps

After completing these exercises, you've finished Part II: Thoughtful Design! Continue to: