rename_record
Rename records in DEVONthink by providing the UUID and new name. Returns confirmation with the UUID, old name, and new name for verification.
Instructions
Renames a specific record in DEVONthink. UUID is required. Provide the new name as newName. Returns renamed: true with uuid, oldName, and newName for confirmation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the record to rename | |
| newName | Yes | New name for the record | |
| databaseName | No | Database name (optional, for disambiguation) |
Implementation Reference
- src/tools/records/rename-record.ts:13-44 (handler)The rename_record tool definition, including its schema and JXA script handler.
export const renameRecordTool = defineTool({ name: "rename_record", description: "Renames a specific record in DEVONthink. " + "UUID is required. Provide the new name as newName. " + "Returns renamed: true with uuid, oldName, and newName for confirmation.", schema: z.object({ uuid: z.string().describe("UUID of the record to rename"), newName: z.string().describe("New name for the record"), databaseName: z.string().optional().describe("Database name (optional, for disambiguation)"), }), run: async (args, executor) => { const { uuid, newName } = args; const script = ` ${JXA_APP} var uuid = ${jxaLiteral(uuid)}; var newName = ${jxaLiteral(newName)}; var record = app.getRecordWithUuid(uuid); if (!record || !record.uuid()) throw new Error("Record not found for UUID: " + uuid); var oldName = record.name(); record.name = newName; JSON.stringify({ renamed: true, uuid: record.uuid(), oldName: oldName, newName: record.name() }); `; const result = executor.run(script); return JSON.parse(result.stdout); }, });