Skip to main content
Glama

update_record_content

Modify existing record content in DEVONthink by providing UUID and new text or source material for text, HTML, or Markdown documents.

Instructions

Updates the content of an existing record in DEVONthink. For text records, sets plain text. For HTML/Markdown records, sets the source. UUID is required. Returns updated: true with uuid and name on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesUUID of the record to update
contentYesNew content to write to the record

Implementation Reference

  • The complete tool definition, including schema validation and the handler (run function) which uses JXA to update a DEVONthink record.
    export const updateRecordContentTool = defineTool({
      name: "update_record_content",
      description:
        "Updates the content of an existing record in DEVONthink. " +
        "For text records, sets plain text. For HTML/Markdown records, sets the source. " +
        "UUID is required. Returns updated: true with uuid and name on success.",
      schema: z.object({
        uuid: z.string().describe("UUID of the record to update"),
        content: z.string().describe("New content to write to the record"),
      }),
      run: async (args, executor) => {
        const { uuid, content } = args;
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid)};
          var content = ${jxaLiteral(content)};
    
          var record = app.getRecordWithUuid(uuid);
          if (!record || !record.uuid()) throw new Error("Record not found for UUID: " + uuid);
    
          var recordType = record.type();
          if (recordType === "html" || recordType === "markdown" || recordType === "feed") {
            record.source = content;
          } else {
            record.plainText = content;
          }
    
          JSON.stringify({ updated: true, uuid: record.uuid(), name: record.name() });
        `;
    
        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