# Salesforce RAG MCP - Changelog
## [1.1.0] - 2025-09-02
### 🚀 New Features
#### Pagination Support for Metadata Queries
- Added `limit` and `offset` parameters to `sf_metadata_list` tool
- Maximum limit: 200 items per request
- Includes pagination metadata in response (`total`, `hasMore`, etc.)
- **Fixes**: Token limit exceeded errors when querying large metadata sets
#### Auto-Namespace Detection
- `sf_describe_object` now automatically tries common namespace prefixes
- Supports `aidialer__` and `c__` namespaces out of the box
- **Fixes**: "AI_Dialer_Call__c" now works without requiring "aidialer__AI_Dialer_Call__c"
### 🛠️ Improvements
#### Enhanced SOQL Error Handling
- Intelligent error analysis with contextual suggestions
- Specific guidance for common errors:
- `FIELDS(ALL)` not supported → suggests specific field selection
- Invalid field names → suggests using describe object
- Invalid object names → suggests checking namespace prefixes
- Permission errors → suggests checking user permissions
- **Fixes**: Cryptic SOQL errors now provide actionable solutions
#### Better Error Messages
- All tools now provide clearer error messages
- Suggestions included for common failure scenarios
- More developer-friendly debugging information
## Resolved Issues
### From User Log Analysis:
1. **Query 2 (Token Limit)**: ✅ Fixed with pagination support
2. **Query 5 & 7 (SOQL Failures)**: ✅ Fixed with enhanced error handling
3. **Query 1 (Object Describe)**: ✅ Fixed with auto-namespace detection
### Technical Changes:
- Modified `MetadataListTool.executeInternal()` to support pagination
- Enhanced `RestSoqlTool.executeInternal()` with comprehensive error handling
- Updated `DescribeObjectTool.executeInternal()` with namespace fallback logic
- Improved tool parameter schemas with optional limit/offset parameters
## Usage Examples
### Before (Failed):
```javascript
// This would fail with token limit exceeded
sf_metadata_list({ types: ["CustomObject"] })
// This would fail with "object not found"
sf_describe_object({ objectName: "AI_Dialer_Call__c" })
// This would fail with cryptic error
sf_soql({ query: "SELECT FIELDS(ALL) FROM Account LIMIT 1" })
```
### After (Success):
```javascript
// Paginated metadata query
sf_metadata_list({
types: ["CustomObject"],
limit: 50,
offset: 0
})
// Auto-detects namespace
sf_describe_object({ objectName: "AI_Dialer_Call__c" })
// Returns: { ..., _note: "Object found using namespace prefix: aidialer__" }
// Clear error with suggestion
sf_soql({ query: "SELECT FIELDS(ALL) FROM Account LIMIT 1" })
// Returns: "SOQL query failed: FIELDS(ALL) not supported.
// Suggestion: Try selecting specific fields instead..."
```
## Performance Impact
- **Reduced token usage**: Pagination prevents oversized responses
- **Faster error resolution**: Detailed error messages reduce debugging time
- **Improved UX**: Auto-namespace detection reduces manual trial-and-error
## Breaking Changes
None - all changes are backward compatible with optional parameters.
## Testing
- ✅ Direct Salesforce connection tests pass
- ✅ SOQL error handling validated
- ✅ Namespace detection confirmed working
- ✅ Pagination logic tested
---
## Previous Versions
### [1.0.0] - 2025-09-01
- Initial release with basic MCP tools
- Salesforce Metadata, Tooling, and REST API integration
- Vector RAG capabilities with pgvector
- Intelligent chunking system