ADR-003: Use MCP primitives according to interaction intent
MCP tools handle explicit lookups, resources provide stable data URIs, and prompts package reusable task instructions.
1. Context & Problem
AI applications interact with domain knowledge in three distinct ways: running an explicit lookup with search parameters, reading a well-known piece of reference context, and following reusable task guidance. Treating every capability as a single generic action mixes on-demand queries, reference data, and instructions into one confusing contract.
BookWorm needed a clear convention for structuring its shared AI integration capabilities so that each type of interaction matches how AI clients actually consume it.
2. Business Value
- Clearer contracts for AI teams: Separating lookups, reference data, and reusable instructions makes integrations easier to understand, govern, and evolve.
- Consistent guidance without code duplication: Sharing reusable task instructions centrally ensures multiple AI agents follow consistent analysis patterns without duplicating prompt text across every client release.
- Targeted compatibility management: Teams can version and review data lookups, reference identifiers, and prompt templates independently based on how clients use them.
- Cleaner separation from business workflows: Keeps AI integration capabilities clearly distinct from core domain events and transactional commands.
3. How It Works
The shared integration server organizes its capabilities into three distinct categories based on what the consumer intends to do:
- Lookups (Tools): Used when a client needs to run an explicit request with parameters—such as looking up a specific book or retrieving reviews with filters.
- Reference data (Resources): Used when a client wants to read a stable, directly addressed item of context—such as a book record or a book’s review collection—identified by a consistent address.
- Reusable guidance (Prompts): Used when a client wants structured instructions for a common task—such as recommending books, summarizing ratings, or analyzing book quality.
Even when a lookup, a reference item, and a task template refer to the same book or review topic, they remain separate capabilities: retrieving reference data does not run a search, and fetching a prompt template provides guidance without executing any lookup or enforcing application policy on its own.
4. Trade-offs & Lessons Learned
- Three distinct surfaces vs. one uniform mechanism: Separating lookups, reference data, and task templates adds structural discipline and avoids awkward workarounds, though teams must actively review compatibility across all three contract types before making changes.
- Guidance is not enforcement: Shared task instructions help structure how an AI model reasons, but they cannot perform operations or replace application-level validation, classification, and governance checks.
- Reference consistency without transactions: Both lookups and reference reads expose data from the owning domain APIs at request time; they do not make the integration server authoritative or provide cross-domain transactions.
Alternatives Evaluated
- Represent every capability as a tool: Rejected because it turns simple reference reads and reusable instructions into artificial action calls, blurring data retrieval with task guidance.
- Represent all domain data as resources: Rejected because static addresses do not replace parameterized searches driven by user criteria.
- Embed task instructions inside every client: Rejected because it duplicates guidance across applications and forces a new client deployment whenever instructions need refinement.
5. Technical Reference
- Decision status: Accepted (
2026-11-04) - Affected systems & services:
mcp-tools, MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs - MCP Primitive Mapping in MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only
Catalog lookup tools and reusable AI prompts.
PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs:
- Tools (explicit, parameterized read requests):
get_book,get_book_reviews - Resources (stable URI-addressed JSON context):
bookworm://catalog/books/{id},bookworm://ratings/{bookId}/reviews - Prompts (reusable task instructions):
recommend_books,summarize_rating,analyze_book_quality
- Tools (explicit, parameterized read requests):
- Contract governance: Tool schemas, resource URIs, and prompt names/arguments are distinct compatibility surfaces and remain separate from domain events and commands. Prompts structure model tasks but do not execute operations or replace application-side policy checks.