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 core AI model and the user interface.
**1. Tools**
- Control: Model controlled.
- Function: The AI model (Cloud) is responsible for deciding when to execute a tool.
- Purpose: Used to add external capabilities to the Cloud/Model (e. g. , executing JavaScript code).
- Implementation: Implement tools within an MCP server or consume them via an MCP client.
**2. Resources**
- Control: Application controlled.
- Function: The application's code decides when it needs data from a resource and executes it.
- Purpose: Used to fetch data and provide content for the UI (e. g. , fetching documents from Google Drive to show autocomplete options).
- Implementation: Implement resources within an MCP server.
**3. Prompts**
- Control: User controlled.
- Function: The user decides when a prompt workflow should run (e. g. , clicking a UI button or using a slash command).
- Purpose: Used to implement predefined workflows.
- Implementation: Implement prompts within an MCP server.
Summary of Roles
- Tools: Serve the Model.
- Resources: Serve the Application.
- Prompts: Serve the User.
Takeaways
- Tools are model-controlled and provide external capabilities to the AI.
- Resources are application-controlled and fetch data to support the user interface.
- Prompts are user-controlled and implement predefined workflows triggered by the user.
- The three primitives (Tools, Resources, Prompts) define how different parts of an application interact with the core AI model.
Flashcards 10 cards
Question
click to reveal · ←/→
Answer
click to flip back
Knowledge check 6 questions