Skip to main content

The Art of Building Great MCPs

Building good MCPs is an art. You want to minimize wrong tool calls and maximize AI success.

Core Principles

1. Less is More

Don’t expose every API endpoint as an MCP tool. Pick the most important ones. ❌ Bad: 50 similar tools confuse AI
✅ Good: One clear tool per action

2. Crystal Clear Descriptions

AI depends on your descriptions to understand when to use tools. ❌ Bad: Vague description
✅ Good: Specific description

3. Simple Schemas

Complex input schemas lead to AI errors. ❌ Bad: Nested complexity
✅ Good: Flat and simple

Tool Design Patterns

Action-Oriented Naming

Use verbs that clearly indicate what happens:

Consistent Naming Conventions

Pick a pattern and stick to it:

Error-Resistant Parameters

Design parameters that are hard to mess up: ❌ Error-prone: Free text that needs parsing
✅ Error-resistant: Structured input

Resource Best Practices

Meaningful URIs

Use URIs that make sense to AI: ✅ Good URIs:
❌ Bad URIs:

Clear Resource Descriptions

Explain what data the resource contains: ❌ Vague:
✅ Specific:

Prompt Templates

Use Variables Wisely

Make templates flexible but not complex: ✅ Good template:
❌ Complex template:

Testing Your Designs

Test with Realistic Prompts

Don’t just test if tools work - test if AI chooses the right tools:

Watch for Confusion Patterns

Common signs AI is confused:
  • Wrong tool selection: AI picks similar but wrong tool
  • Missing parameters: AI doesn’t provide required fields
  • Repeated failures: AI keeps trying the same broken approach
  • No tool usage: AI gives up and doesn’t use any tools

Common Mistakes

Mistake #1: Too Many Similar Tools

Mistake #2: Boolean Parameters for Actions

Mistake #3: Generic Error Messages

Performance Tips

Optimize for Common Use Cases

Design tools around what users actually ask for: Common request: “Schedule a meeting with John tomorrow at 2pm” ❌ Poor design: Separate tools for each step
✅ Good design: One tool for the complete workflow

Minimize Tool Chains

Long chains of tool calls often fail: ❌ Fragile: 5-step process where any step can fail ✅ Robust: 2-step process with error handling

Quality Checklist

Before deploying your MCP:
  • Tool names clearly indicate actions
  • Descriptions are specific and helpful
  • Parameters use simple types when possible
  • Similar tools have distinct purposes
  • Error messages guide AI toward correct usage
  • Resources have meaningful URIs
  • Prompts use clear variable names
  • Test results show AI picks correct tools
  • Success rate is above 80% in testing

Next Steps

Testing Guide

Learn how to test your MCPs effectively

API Reference

Explore LeanMCP API features