We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gunnit/bitrix24-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
LEADS_SOLUTION_SUMMARY.md•3.09 kB
# Bitrix24 Leads Issue - RESOLVED ✅
## Problem
You were experiencing HTTP 400 errors when trying to retrieve leads from your Bitrix24 CRM using the API functions:
- `bitrix24_get_latest_leads`
- `bitrix24_list_leads`
- `bitrix24_get_leads_from_date_range`
## Root Cause
The issue was with the **order parameter format** in the Bitrix24 API. The error message was:
```
Parameter 'order' must be array
```
Bitrix24 was expecting the order parameter in a different format than what was being sent.
## Solution Applied
1. **Fixed the `getLatestLeads` method** to avoid the problematic order parameter
2. **Implemented client-side sorting** using JavaScript instead of relying on Bitrix24's order parameter
3. **Updated the `getLeadsFromDateRange` method** with the same fix
## Current Status: ✅ WORKING
### Test Results
- **Webhook Connection**: ✅ Valid
- **Lead Fields Access**: ✅ Working
- **Basic Leads List**: ✅ Found 50 leads
- **Latest Leads Method**: ✅ Successfully retrieves and sorts leads
### Your Latest 10 Leads (Most Recent First)
1. **Completa modulo CRM "Prenota la tua consulenza telefonica gratuita e compila i campi sottostanti"** (ID: 199) - 2020-07-11T10:56:00+03:00
2. **Nicholas Guidi** (ID: 197) - 2020-07-11T10:18:32+03:00
3. **Fabio** (ID: 195) - 2020-07-11T10:17:23+03:00
4. **Felice Della Torre** (ID: 193) - 2020-07-09T18:03:01+03:00
5. **Francesco Forte** (ID: 191) - 2020-07-09T13:36:24+03:00
6. **Andrea Bellavia** (ID: 189) - 2020-07-09T11:54:37+03:00
7. **Daniele Palmenti** (ID: 187) - 2020-07-09T11:52:42+03:00
8. **Completa modulo CRM "Prenota la tua consulenza telefonica gratuita e compila i campi sottostanti"** (ID: 185) - 2020-07-06T02:53:24+03:00
9. **Luca Anastasi** (ID: 183) - 2020-07-05T23:50:34+03:00
10. **Jonathan Carlesi** (ID: 181) - 2020-07-01T15:44:59+03:00
## Available Lead Tools
Your MCP server now includes these working lead management tools:
### Lead Retrieval
- `bitrix24_get_latest_leads` - Get most recent leads (✅ Fixed)
- `bitrix24_list_leads` - List leads with filtering
- `bitrix24_get_leads_from_date_range` - Get leads from date range (✅ Fixed)
- `bitrix24_get_lead` - Get specific lead by ID
### Lead Management
- `bitrix24_create_lead` - Create new leads
- `bitrix24_update_lead` - Update existing leads
### Diagnostic Tools
- `bitrix24_test_leads_api` - Test leads API functionality
- `bitrix24_diagnose_permissions` - Check API permissions
- `bitrix24_validate_webhook` - Validate webhook connection
## Next Steps
1. **Restart Claude Desktop** to load the updated MCP server
2. **Test the lead tools** using natural language commands like:
- "Get the latest 10 leads from Bitrix24"
- "Show me leads created this week"
- "Create a new lead for John Smith"
## Technical Details
- **Issue**: Bitrix24 order parameter format incompatibility
- **Fix**: Client-side sorting using JavaScript Date objects
- **Performance**: Minimal impact - sorting happens after API call
- **Reliability**: ✅ Tested and confirmed working
The Bitrix24 leads functionality is now fully operational! 🚀