Server PrimitivesLesson 10 of 21

Choosing the Right Primitive

Three Primitives, Three Controllers

Now that you've seen tools, resources, and prompts individually, the key insight that ties them together is control: each primitive is operated by a different part of the stack. Internalize this one table and you can place almost any feature correctly.

PrimitiveControlled byUse it to…Real Claude UI example
ToolsModelGive Claude new abilities it can invoke autonomouslyClaude running code / calling an API
ResourcesApplicationPull data into your app for UI or context'Add from Google Drive' attaching a doc
PromptsUserOffer predefined workflows users trigger on demandThe workflow buttons under the chat input

Tools serve the model, resources serve your app, prompts serve your users.

A Decision Guide

When you're deciding how to expose a piece of functionality, ask one question: who should be in control of triggering it?

  • 1.Need to give Claude a new capability it can decide to use mid-task? → Use a TOOL.
  • 2.Need to get data into your application for UI or to add as context? → Use a RESOURCE.
  • 3.Want to offer a polished, repeatable workflow the user starts on demand? → Use a PROMPT.
Who shouldtrigger it?TOOLmodel decidesRESOURCEapp decidesPROMPTuser decides

The decision collapses to a single question — who controls the trigger: the model, the app, or the user.

They Work Together

These aren't competing choices — most real servers use all three, and the best experiences combine them. Consider a multi-server travel planner: the user triggers a 'plan-vacation' PROMPT; the app loads calendar and preferences as RESOURCES for context; then Claude calls TOOLS to search flights, check weather, and book a hotel. One workflow, all three primitives, each played by the right controller.

In our document server, the same pattern appears in miniature: tools (read_doc, edit_document) let Claude act; resources (docs://documents, docs://documents/{id}) feed the autocomplete and context; and a prompt (/format) packages a tested reformatting workflow the user triggers.

⚠️

Common mistake

Don't force everything into tools. If you find yourself writing a tool whose only job is to 'fetch some data for the UI', that's a resource. If you're hard-coding a long instruction your users keep retyping, that's a prompt. Matching the primitive to the controller keeps your server clean and predictable.

Quick Reference

If you want to…UseMethods
Let Claude perform an actionTooltools/list, tools/call
Supply read-only data to the appResourceresources/list, resources/templates/list, resources/read
Offer a user-triggered workflowPromptprompts/list, prompts/get

A pocket reference for the three primitives and their protocol methods.

Section complete — time to build

You now understand the full conceptual model of MCP. The next section is hands-on: we assemble the complete document server with the Python SDK, test it in the Inspector, then build a client that drives it with Claude.

Key Takeaways

  • The unifying insight: each primitive is controlled by a different part of the stack — tools (model), resources (application), prompts (user).
  • Decision rule: ask 'who should trigger this?' — model → tool, app → resource, user → prompt.
  • Tools serve the model (new abilities), resources serve the app (data for UI/context), prompts serve users (on-demand workflows).
  • Real servers use all three together — e.g. a user-triggered prompt that loads resources for context and calls tools to act.
  • Avoid the anti-pattern of forcing everything into tools: data-for-UI is a resource; a long reused instruction is a prompt.
  • Pocket reference — Tool: tools/list+tools/call · Resource: resources/list(+templates/list)+resources/read · Prompt: prompts/list+prompts/get.

Check Your Understanding

Test what you learned in this lesson.

Q1.What is the single best question to decide between a tool, resource, or prompt?

Q2.You want to add data to the conversation's context to power an autocomplete menu, with no model decision involved. Which primitive?

Q3.Which statement about combining primitives is correct?

Q4.Which is an anti-pattern when designing an MCP server?

Practice This Lesson