Skip to content

Commit ee613ec

Browse files
author
shiraayal-tadata
committed
add best practices file
1 parent 9858092 commit ee613ec

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

BEST-PRACTICES.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Best Practices for API to MCP Tool Conversion
2+
3+
This guide outlines best practices for converting standard APIs into Model Context Protocol (MCP) tools for use with AI agents. Proper tool design helps ensure LLMs can understand and safely use your APIs.
4+
5+
---
6+
7+
## Tool Selection
8+
9+
- **Be selective:**
10+
Avoid exposing every endpoint as a tool. LLM clients perform better with a limited number of well-defined tools, and providers often impose tool limits.
11+
12+
- **Prioritize safety:**
13+
Do **not** expose `PUT` or `DELETE` endpoints unless absolutely necessary. LLMs are non-deterministic and could unintentionally alter or damage systems or databases.
14+
15+
- **Focus on data retrieval:**
16+
Prefer `GET` endpoints that return data safely and predictably.
17+
18+
- **Emphasize meaningful workflows:**
19+
Expose endpoints that reflect clear, goal-oriented tasks. Tools with focused actions are easier for agents to understand and use effectively.
20+
21+
---
22+
23+
## Tool Naming
24+
25+
- **Use short, descriptive names:**
26+
Helps LLMs select and use the right tool. Know that some MCP clients restrict tool name length.
27+
28+
- **Follow naming constraints:**
29+
- Must start with a letter
30+
- Can include only letters, numbers, and underscores
31+
- Avoid hyphens (e.g., AWS Nova does **not** support them)
32+
- Use either `camelCase` or `snake_case` consistently across all tools
33+
34+
- **Ensure uniqueness:**
35+
Each tool name should be unique and clearly indicate its function.
36+
37+
---
38+
39+
## Documentation
40+
41+
- **Describe every tool meaningfully:**
42+
Provide a clear and concise summary of what each tool does.
43+
44+
- **Include usage examples and parameter descriptions:**
45+
These help LLMs understand how to use the tool correctly.
46+
47+
- **Standardize documentation across tools:**
48+
Keep formatting and structure consistent to maintain quality and readability.
49+
50+
---
51+
52+
By following these best practices, you can build safer, more intuitive MCP tools that enhance the capabilities of LLM agents.

0 commit comments

Comments
 (0)