Skip to main content
Glama

delete_record

Remove records from DEVONthink databases permanently or move them to Trash using UUID, record ID, or file path identifiers.

Instructions

Delete a record from DEVONthink. This operation is permanent — the record is moved to Trash or permanently deleted. Provide uuid (preferred), recordId + databaseName, or recordPath + databaseName. Returns the uuid and name of the deleted record for confirmation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoUUID of the record to delete
recordIdNoNumeric record ID (requires databaseName)
recordPathNoRecord path within the database (requires databaseName)
databaseNameNoDatabase name (required for recordId or recordPath lookups)

Implementation Reference

  • The full definition and handler for the 'delete_record' tool.
    export const deleteRecordTool = defineTool({
      name: "delete_record",
      description:
        "Delete a record from DEVONthink. " +
        "This operation is permanent — the record is moved to Trash or permanently deleted. " +
        "Provide uuid (preferred), recordId + databaseName, or recordPath + databaseName. " +
        "Returns the uuid and name of the deleted record for confirmation.",
      schema: z.object({
        uuid: z.string().optional().describe("UUID of the record to delete"),
        recordId: z.number().int().nonnegative().optional().describe("Numeric record ID (requires databaseName)"),
        recordPath: z.string().optional().describe("Record path within the database (requires databaseName)"),
        databaseName: z.string().optional().describe("Database name (required for recordId or recordPath lookups)"),
      }),
      run: async (args, executor) => {
        const { uuid, recordId, recordPath, databaseName } = args;
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid ?? null)};
          var recordId = ${jxaLiteral(recordId ?? null)};
          var recordPath = ${jxaLiteral(recordPath ?? null)};
          var recordName = null;
          var dbName = ${jxaLiteral(databaseName ?? null)};
    
          ${JXA_RESOLVE_DB}
          ${JXA_RESOLVE_RECORD}
    
          var deletedUuid = record.uuid();
          var deletedName = record.name();
    
          try { app.deleteRecord(record); }
          catch(e) { app.delete({record: record}); }
    
          JSON.stringify({ deleted: true, uuid: deletedUuid, name: deletedName });
        `;
    
        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