Skip to main content
Glama

move_record

Relocate records between groups in DEVONthink databases using UUIDs or identifiers to reorganize content and maintain document organization.

Instructions

Move a record to a different group in DEVONthink. Resolve the source record by uuid (preferred), recordId + databaseName, recordName + databaseName, or recordPath + databaseName. Provide destinationGroupUuid to specify where to move the record. Returns the updated record properties after the move.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoUUID of the record to move
recordIdNoNumeric record ID (requires databaseName)
recordNameNoRecord name (requires databaseName, use uuid when possible)
recordPathNoRecord path within the database (requires databaseName)
destinationGroupUuidNoUUID of the destination group
databaseNameNoDatabase name (required for recordId, recordName, recordPath)

Implementation Reference

  • The implementation of the `move_record` tool, defining the input schema and the JXA script executed to move a record in DEVONthink.
    export const moveRecordTool = defineTool({
      name: "move_record",
      description:
        "Move a record to a different group in DEVONthink. " +
        "Resolve the source record by uuid (preferred), recordId + databaseName, " +
        "recordName + databaseName, or recordPath + databaseName. " +
        "Provide destinationGroupUuid to specify where to move the record. " +
        "Returns the updated record properties after the move.",
      schema: z.object({
        uuid: z.string().optional().describe("UUID of the record to move"),
        recordId: z.number().int().nonnegative().optional().describe("Numeric record ID (requires databaseName)"),
        recordName: z.string().optional().describe("Record name (requires databaseName, use uuid when possible)"),
        recordPath: z.string().optional().describe("Record path within the database (requires databaseName)"),
        destinationGroupUuid: z.string().optional().describe("UUID of the destination group"),
        databaseName: z.string().optional().describe("Database name (required for recordId, recordName, recordPath)"),
      }),
      run: async (args, executor) => {
        const { uuid, recordId, recordName, recordPath, destinationGroupUuid, databaseName } = args;
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid ?? null)};
          var recordId = ${jxaLiteral(recordId ?? null)};
          var recordName = ${jxaLiteral(recordName ?? null)};
          var recordPath = ${jxaLiteral(recordPath ?? null)};
          var dbName = ${jxaLiteral(databaseName ?? null)};
          var destinationGroupUuid = ${jxaLiteral(destinationGroupUuid ?? null)};
    
          ${JXA_RESOLVE_DB}
          ${JXA_RESOLVE_RECORD}
    
          var destGroup = null;
          if (destinationGroupUuid) {
            destGroup = app.getRecordWithUuid(destinationGroupUuid);
            if (!destGroup || !destGroup.uuid()) throw new Error("Destination group not found for UUID: " + destinationGroupUuid);
          } else {
            destGroup = db.root();
          }
    
          app.move({record: record, to: destGroup});
          var moved = app.getRecordWithUuid(record.uuid());
          if (!moved || !moved.uuid()) throw new Error("Move operation failed");
    
          var record = moved;
          JSON.stringify(${JXA_RECORD_PROPS});
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.stdout);
      },
    });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mnott/Devon'

If you have feedback or need assistance with the MCP directory API, please join our Discord server