Commit 1799e05
Fix get-documents tool to return JSON instead of Python objects
Fixes #16: The get-documents tool was returning Python object string
representations instead of proper JSON-formatted data.
Changes:
- Fix documents.py to properly serialize DocumentsResults and Document objects
- Add default values for offset (0) and limit (20) to fix None parameter issues
- Improve JSON serializer to handle Meilisearch model objects recursively
- Add comprehensive tests for JSON serialization behavior
- Update existing test to handle async index creation timing
The fix ensures that:
- get-documents returns valid JSON instead of object representations
- Document fields are properly accessible in the response
- Empty indexes return valid JSON structure
- Parameter validation prevents API errors
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 9016948 commit 1799e05
File tree
3 files changed
+507
-6
lines changed- src/meilisearch_mcp
- tests
3 files changed
+507
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
24 | 58 | | |
25 | 59 | | |
26 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
318 | 321 | | |
319 | 322 | | |
320 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
321 | 327 | | |
322 | 328 | | |
323 | | - | |
324 | | - | |
| 329 | + | |
| 330 | + | |
325 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
326 | 335 | | |
327 | | - | |
| 336 | + | |
328 | 337 | | |
329 | 338 | | |
330 | 339 | | |
| |||
0 commit comments