apps/e2e/demo-e2e-codecall/src/apps/crm. It demonstrates how to group many CRUD tools behind the CodeCall plugin, feed them with an in-memory data store, and expose them through a single CodeCall entry point.
Source:
apps/e2e/demo-e2e-codecall/src/apps/crm. The apps/e2e/demo-e2e-codecall/src/apps/crm/data/crm.store.ts module seeds sample users and activities so the tools return realistic data without extra services.Architecture overview
- CodeCall plugin –
CodeCallPlugin.init({ topK: 10 })runs incodecall_onlymode so models discover tools via search rather than the global tool list. - Eight dedicated tools – Separate tool classes handle user CRUD plus activity logging and stats.
- Typed data store –
crmStoreexposes helpers for listing users, logging activities, and aggregating stats without external services. - Zod validation – Every tool validates inputs (email, enums, limits) before touching the store and returns structured responses.
App and plugin wiring
Tool catalog
| Tool | Category | What it does |
|---|---|---|
users:list | Users | Filter users by status or role with pagination-friendly limits |
users:get | Users | Fetch a profile by ID or email |
users:create | Users | Create a new user with default role/status enforcement |
users:update | Users | Patch name, role, status, or last login |
users:delete | Users | Remove a user after verifying they exist |
activities:list | Activities | Return recent activities with optional user/type filters |
activities:log | Activities | Append an activity and update lastLoginAt on login events |
activities:stats | Activities | Summarize total activity counts grouped by type |
ToolContext, so the CodeCall plan receives consistent logging, auth info, and error handling.
CrmStore helpers
The in-memory store keeps sample data and exposes ergonomic helpers. Tools resolve it directly instead of re-implementing storage logic.Log activities through CodeCall
Theactivities:log tool validates the user before writing an entry and automatically updates lastLoginAt for login events—perfect for showcasing multi-step plans.
Run it locally
1
Install workspace dependencies
2
Start the demo server
http://localhost:3013). Keep this terminal open.3
Open the MCP Inspector
Run
npx @modelcontextprotocol/inspector, paste the server URL from the previous step, and click Connect.4
Exercise CodeCall
Call
codecall.search, codecall.describe, and codecall.execute from the Inspector to watch the CRM tools run inside the sandbox.
