claude-mpm 4.15.6__py3-none-any.whl → 4.21.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-mpm might be problematic. Click here for more details.

Files changed (209) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +272 -23
  4. claude_mpm/agents/PM_INSTRUCTIONS.md +49 -0
  5. claude_mpm/agents/agent_loader.py +4 -4
  6. claude_mpm/agents/templates/engineer.json +5 -1
  7. claude_mpm/agents/templates/php-engineer.json +10 -4
  8. claude_mpm/agents/templates/python_engineer.json +8 -3
  9. claude_mpm/agents/templates/rust_engineer.json +12 -7
  10. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  11. claude_mpm/cli/commands/__init__.py +2 -0
  12. claude_mpm/cli/commands/mpm_init/__init__.py +73 -0
  13. claude_mpm/cli/commands/mpm_init/core.py +525 -0
  14. claude_mpm/cli/commands/mpm_init/display.py +341 -0
  15. claude_mpm/cli/commands/mpm_init/git_activity.py +427 -0
  16. claude_mpm/cli/commands/mpm_init/modes.py +397 -0
  17. claude_mpm/cli/commands/mpm_init/prompts.py +442 -0
  18. claude_mpm/cli/commands/mpm_init_cli.py +396 -0
  19. claude_mpm/cli/commands/mpm_init_handler.py +67 -1
  20. claude_mpm/cli/commands/skills.py +488 -0
  21. claude_mpm/cli/executor.py +2 -0
  22. claude_mpm/cli/parsers/base_parser.py +7 -0
  23. claude_mpm/cli/parsers/mpm_init_parser.py +42 -0
  24. claude_mpm/cli/parsers/skills_parser.py +137 -0
  25. claude_mpm/cli/startup.py +57 -0
  26. claude_mpm/commands/mpm-auto-configure.md +52 -0
  27. claude_mpm/commands/mpm-help.md +6 -0
  28. claude_mpm/commands/mpm-init.md +112 -6
  29. claude_mpm/commands/mpm-resume.md +372 -0
  30. claude_mpm/commands/mpm-version.md +113 -0
  31. claude_mpm/commands/mpm.md +2 -0
  32. claude_mpm/config/agent_config.py +2 -2
  33. claude_mpm/constants.py +12 -0
  34. claude_mpm/core/config.py +42 -0
  35. claude_mpm/core/factories.py +1 -1
  36. claude_mpm/core/interfaces.py +56 -1
  37. claude_mpm/core/optimized_agent_loader.py +3 -3
  38. claude_mpm/hooks/__init__.py +8 -0
  39. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  40. claude_mpm/hooks/session_resume_hook.py +121 -0
  41. claude_mpm/models/resume_log.py +340 -0
  42. claude_mpm/services/agents/auto_config_manager.py +1 -1
  43. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  44. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  45. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  46. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  47. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  48. claude_mpm/services/agents/local_template_manager.py +1 -1
  49. claude_mpm/services/agents/recommender.py +47 -0
  50. claude_mpm/services/cli/resume_service.py +617 -0
  51. claude_mpm/services/cli/session_manager.py +87 -0
  52. claude_mpm/services/cli/session_pause_manager.py +504 -0
  53. claude_mpm/services/cli/session_resume_helper.py +372 -0
  54. claude_mpm/services/core/base.py +26 -11
  55. claude_mpm/services/core/interfaces.py +56 -1
  56. claude_mpm/services/core/models/agent_config.py +3 -0
  57. claude_mpm/services/core/models/process.py +4 -0
  58. claude_mpm/services/core/path_resolver.py +1 -1
  59. claude_mpm/services/diagnostics/models.py +21 -0
  60. claude_mpm/services/event_bus/relay.py +23 -7
  61. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  62. claude_mpm/services/local_ops/__init__.py +2 -0
  63. claude_mpm/services/mcp_config_manager.py +7 -131
  64. claude_mpm/services/mcp_gateway/auto_configure.py +31 -25
  65. claude_mpm/services/mcp_gateway/core/process_pool.py +19 -10
  66. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +26 -21
  67. claude_mpm/services/memory/failure_tracker.py +19 -4
  68. claude_mpm/services/session_manager.py +205 -1
  69. claude_mpm/services/unified/deployment_strategies/local.py +1 -1
  70. claude_mpm/services/version_service.py +104 -1
  71. claude_mpm/skills/__init__.py +21 -0
  72. claude_mpm/skills/agent_skills_injector.py +324 -0
  73. claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
  74. claude_mpm/skills/bundled/api-documentation.md +393 -0
  75. claude_mpm/skills/bundled/async-testing.md +571 -0
  76. claude_mpm/skills/bundled/code-review.md +143 -0
  77. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
  78. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
  79. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
  80. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
  81. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
  82. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
  83. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
  84. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
  85. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
  86. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
  87. claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
  88. claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
  89. claude_mpm/skills/bundled/database-migration.md +199 -0
  90. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
  91. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
  92. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
  93. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
  94. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
  95. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
  96. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
  97. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
  98. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
  99. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
  100. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
  101. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
  102. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
  103. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
  104. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
  105. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
  106. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
  107. claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
  108. claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
  109. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
  110. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  111. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  112. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  113. claude_mpm/skills/bundled/git-workflow.md +414 -0
  114. claude_mpm/skills/bundled/imagemagick.md +204 -0
  115. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  116. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
  117. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
  118. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
  119. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
  120. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
  121. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
  122. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
  123. claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
  124. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
  125. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
  126. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
  127. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
  128. claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
  129. claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +157 -0
  130. claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +425 -0
  131. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
  132. claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
  133. claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
  134. claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
  135. claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
  136. claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
  137. claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +303 -0
  138. claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +113 -0
  139. claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +72 -0
  140. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  141. claude_mpm/skills/bundled/pdf.md +141 -0
  142. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  143. claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
  144. claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
  145. claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
  146. claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
  147. claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
  148. claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
  149. claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
  150. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  151. claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
  152. claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
  153. claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
  154. claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
  155. claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
  156. claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
  157. claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
  158. claude_mpm/skills/bundled/security-scanning.md +327 -0
  159. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  160. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  161. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
  162. claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
  163. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
  164. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
  165. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
  166. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
  167. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
  168. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
  169. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
  170. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
  171. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
  172. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
  173. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
  174. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
  175. claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
  176. claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
  177. claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +44 -0
  178. claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
  179. claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
  180. claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
  181. claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +129 -0
  182. claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
  183. claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
  184. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  185. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  186. claude_mpm/skills/bundled/xlsx.md +157 -0
  187. claude_mpm/skills/registry.py +97 -9
  188. claude_mpm/skills/skills_registry.py +348 -0
  189. claude_mpm/skills/skills_service.py +739 -0
  190. claude_mpm/tools/code_tree_analyzer/__init__.py +45 -0
  191. claude_mpm/tools/code_tree_analyzer/analysis.py +299 -0
  192. claude_mpm/tools/code_tree_analyzer/cache.py +131 -0
  193. claude_mpm/tools/code_tree_analyzer/core.py +380 -0
  194. claude_mpm/tools/code_tree_analyzer/discovery.py +403 -0
  195. claude_mpm/tools/code_tree_analyzer/events.py +168 -0
  196. claude_mpm/tools/code_tree_analyzer/gitignore.py +308 -0
  197. claude_mpm/tools/code_tree_analyzer/models.py +39 -0
  198. claude_mpm/tools/code_tree_analyzer/multilang_analyzer.py +224 -0
  199. claude_mpm/tools/code_tree_analyzer/python_analyzer.py +284 -0
  200. claude_mpm/utils/agent_dependency_loader.py +2 -2
  201. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/METADATA +211 -33
  202. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/RECORD +206 -64
  203. claude_mpm/agents/INSTRUCTIONS_OLD_DEPRECATED.md +0 -602
  204. claude_mpm/cli/commands/mpm_init.py +0 -2008
  205. claude_mpm/tools/code_tree_analyzer.py +0 -1825
  206. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/WHEEL +0 -0
  207. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/entry_points.txt +0 -0
  208. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/licenses/LICENSE +0 -0
  209. {claude_mpm-4.15.6.dist-info → claude_mpm-4.21.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,412 @@
1
+ # Agent-Centric Design Principles for MCP Servers
2
+
3
+ ## Overview
4
+
5
+ Before implementing any MCP server, understand how to design tools for AI agents. Agents are fundamentally different users than humans - they have limited context, no visual UI, and think in terms of workflows rather than API calls.
6
+
7
+ **Core Philosophy:** Build thoughtful, high-impact workflow tools, not API endpoint wrappers.
8
+
9
+ ---
10
+
11
+ ## Why Agent-Centric Design Matters
12
+
13
+ MCP servers expose tools that AI agents use to accomplish tasks. The quality of your server is measured by how effectively agents complete realistic workflows, not by API coverage.
14
+
15
+ **Key Differences from Human-Oriented Design:**
16
+
17
+ | Human Users | AI Agents |
18
+ |-------------|-----------|
19
+ | Visual UI navigation | No visual interface |
20
+ | Unlimited attention | Limited context window |
21
+ | Can ask clarifying questions | Must work with available information |
22
+ | Tolerate verbose responses | Need concise, high-signal data |
23
+ | Learn from documentation | Learn from tool descriptions and errors |
24
+
25
+ ---
26
+
27
+ ## The Five Design Principles
28
+
29
+ ### 1. Build for Workflows, Not Just API Endpoints
30
+
31
+ **The Problem:**
32
+ Directly wrapping API endpoints creates tools that are too granular for agents to use effectively. Agents must make many calls to accomplish simple tasks.
33
+
34
+ **The Solution:**
35
+ Consolidate related operations into workflow-oriented tools that accomplish complete tasks.
36
+
37
+ **Examples:**
38
+
39
+ ❌ **Poor Design (API Wrapper):**
40
+ ```
41
+ check_calendar_availability(date, time)
42
+ create_calendar_event(date, time, title, description)
43
+ send_notification(user_id, message)
44
+ ```
45
+ Agent must: Check availability → Create event → Send notification (3 separate calls)
46
+
47
+ ✅ **Good Design (Workflow-Oriented):**
48
+ ```
49
+ schedule_event(date, time, title, description, attendees)
50
+ - Checks availability automatically
51
+ - Creates event if slot is free
52
+ - Notifies attendees
53
+ - Returns single consolidated result
54
+ ```
55
+ Agent makes 1 call to complete the workflow.
56
+
57
+ **Guidelines:**
58
+ - Identify common multi-step workflows users perform
59
+ - Combine related operations that always happen together
60
+ - Provide atomic operations for complex use cases
61
+ - Let tools handle internal coordination and error recovery
62
+
63
+ ### 2. Optimize for Limited Context
64
+
65
+ **The Problem:**
66
+ Agents have constrained context windows. Verbose responses waste precious tokens and reduce what agents can accomplish.
67
+
68
+ **The Solution:**
69
+ Return high-signal information by default. Provide options for detail levels.
70
+
71
+ **Examples:**
72
+
73
+ ❌ **Poor Design (Information Dump):**
74
+ ```json
75
+ {
76
+ "user": {
77
+ "id": "U123456",
78
+ "name": "John Doe",
79
+ "email": "john@example.com",
80
+ "profile": {
81
+ "avatar_urls": {
82
+ "small": "https://...",
83
+ "medium": "https://...",
84
+ "large": "https://...",
85
+ "xlarge": "https://..."
86
+ },
87
+ "bio": "Lorem ipsum...",
88
+ "location": "San Francisco",
89
+ "timezone": "America/Los_Angeles",
90
+ "created_at": 1609459200,
91
+ "updated_at": 1609459200,
92
+ "preferences": {...},
93
+ "settings": {...}
94
+ }
95
+ }
96
+ }
97
+ ```
98
+ 15+ fields returned when agent only needs name and email.
99
+
100
+ ✅ **Good Design (High-Signal Default):**
101
+ ```json
102
+ {
103
+ "user": {
104
+ "id": "U123456",
105
+ "name": "John Doe",
106
+ "email": "john@example.com"
107
+ }
108
+ }
109
+ ```
110
+ Concise by default. Add `detail_level="full"` parameter for complete data when needed.
111
+
112
+ **Guidelines:**
113
+ - Default to concise responses with essential information
114
+ - Provide `response_format` parameter: "concise" vs "detailed"
115
+ - Use human-readable identifiers (names) over technical codes (IDs) when possible
116
+ - Support Markdown for human readability, JSON for programmatic processing
117
+ - Implement character limits (typically 25,000) with truncation guidance
118
+ - Respect pagination limits strictly - never load all results
119
+
120
+ ### 3. Design Actionable Error Messages
121
+
122
+ **The Problem:**
123
+ Generic error messages tell agents what failed but not how to fix it. Agents get stuck or waste attempts guessing.
124
+
125
+ **The Solution:**
126
+ Every error should guide agents toward correct usage with specific next steps.
127
+
128
+ **Examples:**
129
+
130
+ ❌ **Poor Design (Diagnostic Only):**
131
+ ```
132
+ "Error: Invalid parameters"
133
+ "Error: Request failed"
134
+ "Error: Too many results"
135
+ ```
136
+ Tells what failed, not how to fix it.
137
+
138
+ ✅ **Good Design (Actionable Guidance):**
139
+ ```
140
+ "Error: Query too broad - returned 1,247 results. Try adding filters:
141
+ use 'team:marketing' to filter by team, or 'status:active'
142
+ to filter by status. Or use limit=50 with offset for pagination."
143
+
144
+ "Error: Date format invalid. Expected YYYY-MM-DD (e.g., '2024-01-15'),
145
+ received '01/15/2024'. Please use ISO format."
146
+
147
+ "Error: Missing required field 'project_id'. To find project IDs,
148
+ use list_projects(team='your-team') first."
149
+ ```
150
+ Each error teaches correct usage patterns.
151
+
152
+ **Guidelines:**
153
+ - Explain what's wrong and why
154
+ - Suggest specific fixes or alternative parameters
155
+ - Reference other tools when needed ("use X tool to find Y first")
156
+ - Include examples of correct usage in error messages
157
+ - Guide agents through multi-step corrections
158
+ - Make errors educational, not just diagnostic
159
+
160
+ ### 4. Follow Natural Task Subdivisions
161
+
162
+ **The Problem:**
163
+ Tool organization that mirrors API structure doesn't match how agents think about tasks.
164
+
165
+ **The Solution:**
166
+ Organize and name tools around natural task categories that align with agent reasoning.
167
+
168
+ **Examples:**
169
+
170
+ ❌ **Poor Design (API Structure):**
171
+ ```
172
+ api_users_get(id)
173
+ api_users_list(filters)
174
+ api_users_create(data)
175
+ api_projects_get(id)
176
+ api_projects_list(filters)
177
+ ```
178
+ Tool names reflect internal API, not user tasks.
179
+
180
+ ✅ **Good Design (Task-Oriented):**
181
+ ```
182
+ search_users(query, team, status)
183
+ get_user_details(user_id)
184
+ create_user_account(name, email, team)
185
+
186
+ find_projects(name, status, team)
187
+ get_project_info(project_id)
188
+ create_project(name, team, deadline)
189
+ ```
190
+ Tool names reflect what agents want to accomplish.
191
+
192
+ **Guidelines:**
193
+ - Use action verbs that describe tasks: search, find, create, update, analyze
194
+ - Group related tools with consistent prefixes for discoverability
195
+ - Include service prefix to prevent conflicts: `slack_send_message` not `send_message`
196
+ - Name tools how humans would describe the task
197
+ - Use consistent naming patterns within your server
198
+
199
+ ### 5. Use Evaluation-Driven Development
200
+
201
+ **The Problem:**
202
+ Building without testing against realistic agent use cases leads to tools that seem correct but fail in practice.
203
+
204
+ **The Solution:**
205
+ Create evaluation scenarios early and iterate based on actual agent performance.
206
+
207
+ **Examples:**
208
+
209
+ **Evaluation-First Workflow:**
210
+ 1. **Before Implementation**: Define 10 realistic questions agents should answer
211
+ 2. **Prototype Quickly**: Build minimal tool set to attempt evaluations
212
+ 3. **Run Evaluations**: See where agents struggle
213
+ 4. **Iterate**: Improve tools based on agent feedback
214
+ 5. **Repeat**: Until agents successfully complete 80%+ of evaluations
215
+
216
+ **Common Discoveries from Evaluations:**
217
+ - Agents couldn't find information → Add search/filter tools
218
+ - Agents made too many calls → Consolidate into workflow tools
219
+ - Agents got confused → Improve tool descriptions and error messages
220
+ - Agents ran out of context → Reduce response verbosity
221
+ - Agents used tools incorrectly → Add actionable error guidance
222
+
223
+ **Guidelines:**
224
+ - Write evaluations before implementing all tools
225
+ - Use realistic, complex questions requiring multiple tool calls
226
+ - Let agent failures drive tool design decisions
227
+ - Iterate based on evaluation results, not assumptions
228
+ - Aim for 80%+ agent success rate on evaluations
229
+
230
+ ---
231
+
232
+ ## Applying These Principles: A Case Study
233
+
234
+ **Scenario:** Building an MCP server for a project management API.
235
+
236
+ ### ❌ API Wrapper Approach (Poor)
237
+
238
+ ```python
239
+ @mcp.tool()
240
+ async def get_task(task_id: str):
241
+ """Get a task by ID."""
242
+ return api.tasks.get(task_id)
243
+
244
+ @mcp.tool()
245
+ async def list_tasks(project_id: str):
246
+ """List all tasks in a project."""
247
+ return api.tasks.list(project_id)
248
+
249
+ @mcp.tool()
250
+ async def get_user(user_id: str):
251
+ """Get user by ID."""
252
+ return api.users.get(user_id)
253
+
254
+ @mcp.tool()
255
+ async def update_task_status(task_id: str, status: str):
256
+ """Update task status."""
257
+ return api.tasks.update(task_id, {"status": status})
258
+ ```
259
+
260
+ **Problems:**
261
+ - Too granular - agent needs many calls for simple workflows
262
+ - Returns all fields - wastes context on unnecessary data
263
+ - No guidance on valid statuses or error handling
264
+ - Agent must know IDs before making calls
265
+ - Mirrors API structure, not task structure
266
+
267
+ ### ✅ Agent-Centric Approach (Good)
268
+
269
+ ```python
270
+ @mcp.tool()
271
+ async def search_tasks(
272
+ query: str,
273
+ project: Optional[str] = None,
274
+ status: Optional[str] = None,
275
+ assignee: Optional[str] = None,
276
+ limit: int = 20,
277
+ response_format: str = "markdown"
278
+ ) -> str:
279
+ """Search for tasks across projects with flexible filtering.
280
+
281
+ Finds tasks by name, description, or tags. Returns concise results
282
+ by default - use response_format='json' for full data.
283
+
284
+ Common workflows:
285
+ - Find all bugs: search_tasks(query="bug", status="open")
286
+ - Find your tasks: search_tasks(assignee="your-name")
287
+ - Find by project: search_tasks(project="website-redesign")
288
+
289
+ Error guidance:
290
+ - If too many results: Add more filters or use limit parameter
291
+ - If no results: Try broader query or check project name spelling
292
+ - To find project names: Use list_projects() first
293
+ """
294
+ # Implementation with:
295
+ # - Concise markdown by default
296
+ # - Full JSON if requested
297
+ # - Actionable errors with examples
298
+ # - Character limit enforcement
299
+
300
+ @mcp.tool()
301
+ async def complete_task(
302
+ task_id: str,
303
+ completion_note: Optional[str] = None,
304
+ notify_team: bool = True
305
+ ) -> str:
306
+ """Mark a task complete and optionally notify the team.
307
+
308
+ This is a workflow tool that:
309
+ 1. Validates task can be completed (not blocked, has assignee)
310
+ 2. Updates task status to 'completed'
311
+ 3. Adds completion note to task history
312
+ 4. Sends notifications to team members (if notify_team=True)
313
+ 5. Updates project progress metrics
314
+
315
+ Returns: Success message with task name and updated project status
316
+
317
+ Error guidance:
318
+ - "Task is blocked": Lists blocking tasks with IDs
319
+ - "Task has no assignee": Suggests using assign_task(task_id, user)
320
+ - "Invalid task_id": Suggests using search_tasks() to find task
321
+ """
322
+ # Implementation handles entire workflow
323
+
324
+ @mcp.tool()
325
+ async def get_project_status(
326
+ project_name: str,
327
+ include_tasks: bool = False
328
+ ) -> str:
329
+ """Get project overview with completion metrics.
330
+
331
+ Returns concise summary by default:
332
+ - Total tasks, completed, in-progress, blocked
333
+ - Recent activity
334
+ - Team members
335
+ - Due date and status
336
+
337
+ Use include_tasks=True to also list all tasks (uses more context).
338
+
339
+ Error guidance:
340
+ - "Project not found": Lists similar project names
341
+ - "Access denied": Explains permission requirements
342
+ """
343
+ # Returns high-signal summary
344
+ ```
345
+
346
+ **Improvements:**
347
+ - **Workflow-oriented**: `complete_task` handles entire workflow, not just status update
348
+ - **Context-efficient**: Concise by default, detailed on request
349
+ - **Actionable errors**: Guides agents to correct usage
350
+ - **Natural naming**: Search, complete, get_status (task-oriented, not API-oriented)
351
+ - **Flexible search**: One tool handles multiple search scenarios
352
+ - **Human-readable**: Uses project names, not just IDs
353
+
354
+ ---
355
+
356
+ ## Pre-Implementation Checklist
357
+
358
+ Before writing any code, ensure you understand:
359
+
360
+ - [ ] What workflows will agents actually need to accomplish?
361
+ - [ ] What's the minimum information needed for each workflow?
362
+ - [ ] What errors will agents encounter and how can I guide them?
363
+ - [ ] How can I consolidate related operations into single tools?
364
+ - [ ] What evaluation scenarios will test if this works?
365
+ - [ ] Are tool names task-oriented or API-oriented?
366
+ - [ ] Do tools default to concise responses?
367
+ - [ ] Do errors teach correct usage?
368
+
369
+ ---
370
+
371
+ ## Common Anti-Patterns to Avoid
372
+
373
+ ### Anti-Pattern 1: CRUD Over Everything
374
+ Creating separate create/read/update/delete tools for every resource.
375
+
376
+ **Instead:** Create workflow tools that combine operations intelligently.
377
+
378
+ ### Anti-Pattern 2: The Everything Tool
379
+ One tool that takes 15+ parameters and tries to do everything.
380
+
381
+ **Instead:** Multiple focused tools, each solving one clear workflow.
382
+
383
+ ### Anti-Pattern 3: ID-Only Interfaces
384
+ Requiring agents to have IDs before calling any tools.
385
+
386
+ **Instead:** Search/find tools that work with human-readable names.
387
+
388
+ ### Anti-Pattern 4: Silent Truncation
389
+ Cutting off results without telling the agent.
390
+
391
+ **Instead:** Clear truncation messages with guidance on filtering.
392
+
393
+ ### Anti-Pattern 5: Error Code Responses
394
+ Returning `ERR_401`, `ERR_404` without explanation.
395
+
396
+ **Instead:** Actionable error messages with specific next steps.
397
+
398
+ ---
399
+
400
+ ## Next Steps
401
+
402
+ After understanding these principles:
403
+
404
+ 1. **Review Real Examples**: Look at well-designed MCP servers in the wild
405
+ 2. **Start Planning**: Create your implementation plan with these principles in mind
406
+ 3. **Load Workflow Guide**: See [workflow.md](./workflow.md) for step-by-step implementation
407
+ 4. **Reference Best Practices**: Use [mcp_best_practices.md](./mcp_best_practices.md) for technical details
408
+ 5. **Create Evaluations Early**: Don't wait until implementation is complete
409
+
410
+ ---
411
+
412
+ **Remember:** Agents are your users. Design for their constraints, optimize for their workflows, and guide them to success through every interaction.