Search topics…
Tutorials
Explore
June 6 Offline Event →
Module 3 · Model Context Protocol

Module 3: MCP Primitives - Resources, Prompts & Tools

Explore core MCP objects: register prompts templates, construct read-only resources schemes, and build schemas for execution tools.

⏱ 20 Min Read Author: GenAIWallah Team Updated: May 2026
Day 5

MCP Resources

Why this matters

MCP Resources: Resources let apps inject read-only context the model should see but not invoke.

Resources are read-only context endpoints the application can attach — file URIs, log tails, database snapshots. The model does not invoke them directly; the host decides when to fetch.

MCP Primitives
Resources (Read) Prompts (Guide) Tools (Action)
  • URI scheme identifies data (file://, custom db://).
  • Good for grounding: docs, schemas, ticket details.
  • Not a substitute for tools — resources do not mutate state.

Common mistakes

  • Confusing host with server (the host runs the client; the server is a separate process).
  • Hard-coding API keys inside tool implementations instead of env vars.
  • Using SSE locally when stdio is simpler and more secure.

Interview checkpoints

  • Q: What is mcp resources in MCP? A: One-sentence definition + when it runs in the lifecycle.
  • Q: One production pitfall? A: Name transport, auth, or schema mismatch.

Practice

  1. Basic: Sketch MCP Resources on a whiteboard.
  2. Intermediate: Find it in a real Claude Desktop or Cursor config.
  3. Advanced: Break it on purpose and document the error message.

Recap

  • You can explain mcp resources clearly.
  • You know host vs client vs server roles.
  • You see how this connects to the next part.

Next: Tools and Schemas

Day 6

Tools, Prompts & JSON Schemas

Why this matters

Tools and Schemas: Tools are model-invoked functions; prompts are user-invoked templates — confusing them breaks UX.

Tools are callable functions the model may invoke. Each tool declares a name, description, and JSON Schema for parameters.

{
  "name": "search_repo",
  "description": "Search GitHub issues",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": { "type": "string" }
    },
    "required": ["query"]
  }
}

Prompts are user-invoked templates (slash commands) with parameters — useful for canned workflows, not model-discretion calls.

Common mistakes

  • Confusing host with server (the host runs the client; the server is a separate process).
  • Hard-coding API keys inside tool implementations instead of env vars.
  • Using SSE locally when stdio is simpler and more secure.

Interview checkpoints

  • Q: What is tools and schemas in MCP? A: One-sentence definition + when it runs in the lifecycle.
  • Q: One production pitfall? A: Name transport, auth, or schema mismatch.

Practice

  1. Basic: Sketch Tools and Schemas on a whiteboard.
  2. Intermediate: Find it in a real Claude Desktop or Cursor config.
  3. Advanced: Break it on purpose and document the error message.

Recap

  • You can explain tools and schemas clearly.
  • You know host vs client vs server roles.
  • You see how this connects to the next part.

Next: Handshake

← Module 2: Architecture Module 4: Handshake →