CC-201d · Module 1

Resources & Prompt Templates

3 min read

Resources are the read side of MCP. Where tools are actions Claude can take, resources are data Claude can access. A resource might be a database schema, a configuration file, a log stream, or a knowledge base article. The key difference from tools: resources are typically read-only, and Claude can browse them before deciding what to do.

Resource templates use URI patterns. You define a template like "customer://{customer_id}/orders" and Claude can fill in the customer ID to access a specific customer's order history. This is more efficient than a tool call for data retrieval because Claude can discover the resource structure and access it directly without constructing a tool invocation.

Prompt templates are the third and least-used primitive, but they solve a real problem: complex tool invocations that users request frequently. Instead of hoping Claude constructs the right multi-parameter tool call from a vague user request, you define a prompt template that structures the interaction.

For example, a "weekly_report" prompt template might define: "Generate a weekly performance report for {team_name} covering {start_date} to {end_date}. Include: pipeline metrics from the CRM tool, activity counts from the engagement tool, and forecast accuracy from the analytics tool." The template tells Claude exactly which tools to invoke and in what order. Without the template, Claude would have to infer that workflow from the user saying "give me last week's report."

  1. 1. Identify Your Data Access Patterns What data does Claude need to read from your systems? Customer records, config files, log streams, documentation? Each one maps to a resource URI template. Group related data under a common scheme: customer://, config://, logs://.
  2. 2. Define Resource Templates Use URI patterns with placeholders: "customer://{id}/profile", "logs://{service}/{date}". Include a clear description of what each resource returns and when Claude should access it. Keep the response payload focused — return what Claude needs, not everything you have.
  3. 3. Build Prompt Templates for Complex Workflows If a workflow requires invoking 3+ tools in sequence, define a prompt template. Include the tool invocation order, the parameter mappings between steps, and the expected output format. This turns a multi-step orchestration into a single-command experience.
  4. 4. Test with Real Sessions The only way to know if Claude uses your resources and prompts correctly is to test with real prompts. Ask Claude to "show me customer 12345's orders" and verify it uses the resource template, not a tool call. Ask for a "weekly report" and verify it follows the prompt template's sequence.