You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`identification.test.ts`**: UUID lookup, referenceURL lookup, email `.eml` import, `lookupRecord` URL handling, search by name
83
+
-**`organization.test.ts`**: Group content listing, record moving, tagging
84
+
-**`transformation.test.ts`**: Record conversion between formats
85
+
-**`network.test.ts`**: URL-based record creation
86
+
-**`ai.test.ts`**: AI-powered tool tests
76
87
-**`src/utils/`**: Utility functions
77
88
-**`escapeString.ts`**: Provides safe string escaping for JXA script interpolation
78
89
-**`jxaHelpers.ts`**: JXA helper functions including version detection
@@ -89,7 +100,7 @@ The MCP server currently provides the following tools:
89
100
5.**`get_record_properties`** - Get detailed metadata and properties for records
90
101
6.**`get_record_by_identifier`** - Get a record using either UUID or ID+Database combination (recommended for specific record lookup)
91
102
7.**`search`** - Perform text-based searches with various comparison options (now returns both ID and UUID)
92
-
8.**`lookup_record`** - Look up records by filename, path, URL, tags, comment, or content hash (exact matches only, no wildcards)
103
+
8.**`lookup_record`** - Look up records by filename, path, URL, tags, comment, or content hash (exact matches only, no wildcards). Supports `x-devonthink-item://` URLs with percent-encoded identifiers (e.g., email message-IDs)
93
104
9.**`create_from_url`** - Create records from web URLs in multiple formats
94
105
10.**`get_open_databases`** - Get a list of all currently open databases
95
106
11.**`current_database`** - Get information about the currently active database
@@ -308,6 +319,14 @@ Refer to `docs/devonthink-javascript-2.md` for comprehensive documentation of av
308
319
309
320
## Recent Improvements
310
321
322
+
### URL Lookup Fix and Integration Tests (2025-09)
323
+
- Fixed `lookup_record` to handle `x-devonthink-item://` URLs with percent-encoded identifiers (e.g., email message-IDs)
324
+
- Previously, these URLs were passed directly to `lookupRecordsWithURL` which searches the `url` property, not `referenceURL` — returning 0 results
325
+
- The fix detects `x-devonthink-item://` prefix, decodes the percent-encoded identifier, and uses `getRecordWithUuid` instead
326
+
- Also decodes percent-encoded regular URLs before passing to `lookupRecordsWithURL`
327
+
- Added comprehensive Vitest integration test suite (`tests/integration/`) covering: connectivity, CRUD, identification, organization, transformation, network, and AI tools
328
+
- Integration tests run against a live DEVONthink instance using a temporary database
329
+
311
330
### AI-Powered Tools (2025-08)
312
331
- Added comprehensive AI integration leveraging DEVONthink's native AI capabilities
313
332
- New `ask_ai_about_documents` tool for AI-powered document analysis and Q&A
error: "Record with ID " + ${id} + " not found in database '" + (${databaseName ? `"${escapeStringForJXA(databaseName)}"` : "null"} || "unknown") + "'"
176
+
error: "Record with ID " + ${formatValueForJXA(id)} + " not found in database '" + (${databaseName ? `"${escapeStringForJXA(databaseName)}"` : "null"} || "unknown") + "'"
'Get a DEVONthink record using its UUIDor ID.\n\nExample (UUID):\n{\n "uuid": "1234-5678-90AB-CDEF"\n}\n\nExample (ID):\n{\n "id": 12345,\n "databaseName": "MyDatabase"\n}',
229
+
'Get a DEVONthink record using its UUID, ID, or x-devonthink-item:// reference URL.\n\nExample (Reference URL):\n{\n "referenceURL": "x-devonthink-item://1234-5678-90AB-CDEF"\n}\n\nExample (Reference URL - email):\n{\n "referenceURL": "x-devonthink-item://message:%3Cfoo@bar.com%3E"\n}\n\nExample (UUID):\n{\n "uuid": "1234-5678-90AB-CDEF"\n}\n\nExample (ID):\n{\n "id": 12345,\n "databaseName": "MyDatabase"\n}',
0 commit comments