# LLM-Friendly MCP Tool Improvements
This document summarizes the improvements made to make the SAP Docs MCP server more LLM-friendly, based on Claude's feedback and analysis.
## π― **Key Issues Addressed**
### **Original Problem**
Claude was confused about function names, using incorrect patterns like:
- β `search: query "..."` (FAILED - wrong syntax)
- β `SAP Docs MCP:search` (FAILED - incorrect namespace)
- β
Should be: `search(query="...")` or `mcp_sap-docs-remote_search(query="...")`
## π§ **Improvements Implemented**
### **1. Simplified Visual Formatting**
**Before:**
```
**FUNCTION NAME: Use exactly 'search' or 'mcp_sap-docs-remote_search' depending on your MCP client**
Unified search across all SAP documentation sources...
**EXAMPLE USAGE:**
```
search(query="CAP binary data LargeBinary MediaType")
```
```
**After:**
```
SEARCH SAP DOCS: search(query="search terms")
FUNCTION NAME: search
COVERS: ABAP (all versions), UI5, CAP, wdi5, OpenUI5 APIs, Cloud SDK
AUTO-DETECTS: ABAP versions from query (e.g. "LOOP 7.57", defaults to 7.58)
```
### **2. Structured Examples in JSON Schema**
**Before:** Examples mixed into description text
**After:** Clean `examples` array in JSON schema:
```javascript
{
"examples": [
"CAP binary data LargeBinary MediaType",
"UI5 button properties",
"wdi5 testing locators",
"ABAP SELECT statements 7.58",
"415 error CAP action parameter"
]
}
```
### **3. Added Workflow Patterns**
**New sections added:**
```
TYPICAL WORKFLOW:
1. search(query="your search terms")
2. fetch(id="result_id_from_step_1")
COMMON PATTERNS:
β’ Broad exploration: id="/cap/binary"
β’ Specific API: id="/openui5-api/sap/m/Button"
β’ Community posts: id="community-12345"
```
### **4. Improved Error Messages**
**Before:**
```
No results found for "query". Try searching for UI5 controls like 'button', 'table', 'wizard', testing topics like 'wdi5', 'testing', 'e2e', or concepts like 'routing', 'annotation', 'authentication', 'fiori elements', 'rap'. For detailed ABAP language syntax, use abap_search instead.
```
**After:**
```
No results for "query".
TRY INSTEAD:
β’ UI5 controls: "button", "table", "wizard"
β’ CAP topics: "actions", "authentication", "media", "binary"
β’ Testing: "wdi5", "locators", "e2e"
β’ ABAP: Use version numbers like "SELECT 7.58"
β’ Errors: Include error codes like "415 error CAP action"
```
### **5. Query Optimization Hints**
**Added to each tool:**
```
QUERY TIPS:
β’ Be specific: "CAP action binary parameter" not just "CAP"
β’ Include error codes: "415 error CAP action"
β’ Use technical terms: "LargeBinary MediaType XMLHttpRequest"
β’ For ABAP: Include version like "7.58" or "latest"
```
### **6. Header Documentation for Developers**
```javascript
/**
* IMPORTANT FOR LLMs/AI ASSISTANTS:
* =================================
* The function names in this MCP server may appear with different prefixes depending on your MCP client:
* - Simple names: search, fetch, sap_community_search, sap_help_search, sap_help_get
* - Prefixed names: mcp_sap-docs-remote_search, mcp_sap-docs-remote_fetch, etc.
*
* Try the simple names first, then the prefixed versions if they don't work.
*/
```
## π **Impact on LLM Usage**
### **Function Name Clarity**
- β
Explicit guidance on both naming patterns
- β
Clear fallback strategy (try simple names first)
- β
Reduced confusion about MCP client variations
### **Query Construction**
- β
Concrete examples for each tool type
- β
Technical terminology guidance
- β
Error code inclusion strategies
- β
ABAP version detection hints
### **Workflow Understanding**
- β
Clear search β get patterns
- β
Common usage scenarios
- β
Library ID vs document ID guidance
### **Error Recovery**
- β
Actionable next steps instead of long descriptions
- β
Alternative tool suggestions
- β
Specific retry strategies
## π **Tools Updated**
1. **search** - Main documentation search
2. **fetch** - Retrieve specific documentation
3. **sap_community_search** - Community posts and discussions
4. **sap_help_search** - Official SAP Help Portal
5. **sap_help_get** - Get specific Help Portal pages
## π **Best Practices for LLMs**
### **Search Strategy**
1. Start with `search` for technical documentation
2. Use `sap_community_search` for troubleshooting and error codes
3. Always follow up search results with `fetch` or `sap_help_get`
### **Query Construction**
- Include product names: "CAP", "UI5", "ABAP", "wdi5"
- Add technical terms: "LargeBinary", "MediaType", "XMLHttpRequest"
- Include error codes: "415", "500", "404"
- Specify ABAP versions: "7.58", "latest"
### **Common Workflows**
```
Problem-solving pattern:
1. search(query="technical problem + error code")
2. sap_community_search(query="same problem for community solutions")
3. fetch(id="most_relevant_result")
```
## β
**Validation**
The improvements address the specific issues Claude encountered:
- β
Function naming confusion resolved
- β
Parameter format clarity improved
- β
Search strategy guidance provided
- β
Error messages made actionable
- β
Examples based on real usage patterns
---
*These improvements make the SAP Docs MCP server significantly more accessible to LLMs like Claude, reducing confusion and improving successful tool call rates.*