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);
      },
    });
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively warns that the operation is 'permanent' and explains the trash/deletion outcomes. It also documents the return value ('uuid and name of the deleted record') despite no output schema existing. Missing details include error handling for non-existent records and permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences cover purpose, safety warning, parameter usage patterns, and return values. Every sentence earns its place with zero redundancy. The description is front-loaded with the core action and efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 4-parameter schema with no annotations, the description adequately covers the critical aspects: the destructive behavior, the mutually exclusive parameter combinations needed for lookup, and the confirmation return values. It could be improved with error scenario documentation, but it is complete enough for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema description coverage is 100% (baseline 3), the description adds significant value by indicating parameter preference ('uuid preferred') and explaining the logical dependencies between parameters (e.g., that databaseName is required for recordId lookups), which the schema structure alone doesn't convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with the specific verb 'Delete' targeting the resource 'record' within the domain 'DEVONthink'. It clearly distinguishes this from siblings like move_record or replicate_record by emphasizing the permanent/destructive nature of the operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides crucial guidance on parameter combinations ('uuid (preferred)', 'recordId + databaseName', or 'recordPath + databaseName'), which is essential given zero required parameters in the schema. However, it lacks explicit guidance on when to use delete_record versus alternatives like move_record.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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