Concept: P-T-R Model
Prime Style MCP's architecture is built from three elements: Prompts, Tools, and Resources. We call this the P-T-R Model.
Understanding how these three elements work together is essential for grasping how MCP operates and getting the most out of its features.
A formal diagram will be added here.
As shown above, user requests are first interpreted by a Prompt, processed with the help of Tools and Resources, and then a final response is generated.
1. Prompts — The Command Center of Thinking
Role: Define and execute workflows
Prompts are the command center of the P-T-R Model. They interpret the request (goal) from the user and define the thinking process (workflow) to achieve that goal.
A prompt is a set of instructions to the LLM — detailing what steps to take, what to consider, and what format to produce.
Example: The refactoring_strategy prompt
- Receives "codebase overview" and "problems" from the user.
- Instructs the LLM to "consider design patterns such as the Strangler pattern and create a staged migration plan."
- Requests output in the form of "a prioritized list of improvement items."
Prompts can also call other tools and resources.
2. Tools — The Execution Engine for Concrete Tasks
Role: Automate supplementary tasks
Tools are components that execute concrete processing to assist the thinking process of prompts. They automate repetitive tasks that would be tedious or error-prone for humans.
Tools can be called by prompts, or used directly by users.
Examples:
code_analyzertool: Calculates Cyclomatic Complexity of source code. Called internally by thequality_reviewprompt to objectively evaluate code complexity.linter_config_generatortool: Generates linter config files for a specified language. Used in theproject_setupworkflow.
Tools take on the concrete "work" so prompts can focus on abstract "thinking."
3. Resources — The Referenced Knowledge Base
Role: Provide expert knowledge and data
Resources are static knowledge bases that prompts and tools reference. They store best practices, design pattern catalogs, checklists, team rules, and other specialized information.
Resources are used to improve the quality and consistency of prompt responses.
Examples:
design_patternsresource: A catalog of GoF design patterns with explanations. Referenced by thearchitecture_designprompt to suggest appropriate patterns.security_checklistresource: Security check items based on the OWASP Top 10. Referenced by thequality_reviewprompt for security-focused reviews.
Keeping resources separate allows knowledge updates (e.g., adding new design patterns) to happen independently from prompt logic.
P-T-R Model Interaction Flow
A typical interaction flow:
- User sends a request to MCP. (e.g., "Review this PR")
- Prompt (
quality_review) receives the request and starts the workflow. - The prompt calls a Tool (
code_analyzer) to perform a technical evaluation of the code. - The prompt then references a Resource (
security_checklist) to retrieve security check items. - The prompt integrates results from steps 3 and 4, generates a final review comment draft, and returns it to the User.
In this way, the P-T-R Model clearly separates thinking (Prompts), work (Tools), and knowledge (Resources) — connecting them to build a flexible and powerful expert system.