Summary audio
Spoken summary — press play to read along: the line being spoken stays near the top.
Study notes
Server Primitives: Tools, Resources, and Prompts
These three primitives define how different parts of an application interact with the AI model and the user.
**1. Tools**
- Control: Model controlled (Cloud is responsible for deciding when to run them).
- Purpose: To provide the model with external capabilities (e. g. , executing JavaScript, performing calculations).
- Implementation: Implement tools within an MCP server or consume them via an MCP client.
- Function: Generally serve the Model.
**2. Resources**
- Control: Application controlled (Code running inside the app decides when to execute them).
- Purpose: To provide data or content to the application, such as fetching data for the UI or augmenting a prompt with context (e. g. , documents from Google Drive).
- Implementation: Use resources to fetch and process data.
- Function: Generally serve the Application.
**3. Prompts**
- Control: User controlled (The user initiates the action).
- Purpose: To implement predefined workflows or specific actions that a user triggers (e. g. , clicking a UI button, using a slash command).
- Implementation: Put predefined workflows into an MCP server.
- Function: Generally serve the User.
Summary of Control Flow
- Tools → Model
- Resources → Application
- Prompts → User
Takeaways
- Tools are model-controlled and provide the AI model with external capabilities, such as executing code or performing calculations.
- Resources are application-controlled and provide data or content to the application, such as fetching UI data or augmenting prompts with context.
- Prompts are user-controlled and implement predefined workflows or specific actions triggered by the user.
- The control flow dictates that Tools serve the Model, Resources serve the Application, and Prompts serve the User.
Flashcards 10 cards
Question
click to reveal · ←/→
Answer
click to flip back
Knowledge check 6 questions