Skip to main content
Glama

create_summary_document

Generate AI-powered summary documents by consolidating multiple DEVONthink records into concise formats like markdown, key points, or tables for efficient information synthesis.

Instructions

Create an AI-generated summary document from multiple DEVONthink documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentUuidsYesUUIDs of the source DEVONthink records to summarize
summaryTypeNoOutput format for the summary document. One of: markdown, rich, sheet, simple. Defaults to markdown
summaryStyleNoStyle of summary to generate. One of: text summary, key points summary, list summary, table summary, custom summary
parentGroupUuidNoUUID of the group where the summary document should be created. If omitted, the summary is placed in the same group as the first source record
customTitleNoTitle for the new summary record. Defaults to 'Summary - <ISO date>' if omitted

Implementation Reference

  • The `run` function implementation that handles the tool logic, including script construction and execution.
      run: async (args, executor) => {
        const { documentUuids, summaryType, summaryStyle, parentGroupUuid, customTitle } = args;
    
        const script = `
          ${JXA_APP}
          var uuids = ${jxaLiteral(documentUuids)};
          var summaryType = ${jxaLiteral(summaryType ?? "markdown")};
          var summaryStyle = ${jxaLiteral(summaryStyle ?? null)};
          var parentGroupUuid = ${jxaLiteral(parentGroupUuid ?? null)};
          var customTitle = ${jxaLiteral(customTitle ?? null)};
    
          // Resolve source records
          var records = [];
          for (var i = 0; i < uuids.length; i++) {
            var rec = app.getRecordWithUuid(uuids[i]);
            if (!rec || !rec.uuid()) {
              throw new Error("Record not found for UUID: " + uuids[i]);
            }
            records.push(rec);
          }
    
          // Resolve destination group
          var parentGroup = null;
          if (parentGroupUuid) {
            parentGroup = app.getRecordWithUuid(parentGroupUuid);
            if (!parentGroup || !parentGroup.uuid()) {
              throw new Error("Parent group not found for UUID: " + parentGroupUuid);
            }
          } else {
            // Default: same group as the first source record
            parentGroup = records[0].parent();
          }
    
          // Build summarization options
          var summarizeOpts = {
            records: records,
            to: summaryType,
            in: parentGroup
          };
          if (summaryStyle) summarizeOpts["as"] = summaryStyle;
    
          // Call DEVONthink's AI summarization
          var summaryRecord = app.summarizeContentsOf(summarizeOpts);
          if (!summaryRecord || !summaryRecord.uuid()) {
            throw new Error("DEVONthink did not return a summary record");
          }
    
          var record = summaryRecord;
          JSON.stringify(${JXA_RECORD_PROPS});
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.stdout);
      },
    });
  • Input schema defined using zod for validating tool arguments.
    schema: z.object({
      documentUuids: z
        .array(z.string())
        .min(1)
        .describe("UUIDs of the source DEVONthink records to summarize"),
      summaryType: z
        .enum(SUMMARY_TYPE_VALUES)
        .optional()
        .describe(
          "Output format for the summary document. " +
          "One of: markdown, rich, sheet, simple. Defaults to markdown"
        ),
      summaryStyle: z
        .enum(SUMMARY_STYLE_VALUES)
        .optional()
        .describe(
          "Style of summary to generate. " +
          "One of: text summary, key points summary, list summary, table summary, custom summary"
        ),
      parentGroupUuid: z
        .string()
        .optional()
        .describe(
          "UUID of the group where the summary document should be created. " +
          "If omitted, the summary is placed in the same group as the first source record"
        ),
      customTitle: z
        .string()
        .optional()
        .describe(
          "Title for the new summary record. Defaults to 'Summary - <ISO date>' if omitted"
        ),
    }),
  • Definition of the tool with name, description, and schema.
    export const createSummaryDocumentTool = defineTool({
      name: "create_summary_document",
Behavior3/5

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

With no annotations provided, the description carries the full burden. It appropriately flags the 'AI-generated' nature (indicating non-deterministic output), but omits critical behavioral details: whether the operation is idempotent, what happens if source documents are missing, storage implications, or whether the created document maintains links to sources.

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

Conciseness4/5

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

The description is a single, efficient sentence with no redundancy. However, it may be overly terse given the tool's complexity (AI generation with 5 parameters) and the absence of annotations or output schema, leaving room for additional context without sacrificing clarity.

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

Completeness3/5

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

The description covers the core function adequately for a simple tool, but given the AI complexity and lack of annotations/output schema, it omits important context: default behaviors (implied by schema but not described), error handling for invalid UUIDs, and whether the summary updates automatically when sources change.

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

Parameters3/5

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

The schema has 100% description coverage, establishing a baseline of 3. The description mentions 'multiple DEVONthink documents' which aligns with 'documentUuids', but adds no additional context about parameter interactions (e.g., how 'summaryStyle' affects output when combined with 'summaryType') or validation constraints beyond the schema.

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

Purpose4/5

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

The description clearly states the specific action ('Create'), the nature of the output ('AI-generated summary document'), and the input source ('multiple DEVONthink documents'). It implicitly distinguishes from sibling 'create_record' by specifying AI-generated content, and from 'ask_ai_about_documents' by focusing on document creation rather than Q&A, though explicit differentiation is absent.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'ask_ai_about_documents' (for interactive Q&A) or 'create_record' (for manual content). It lacks prerequisites (e.g., requiring valid DEVONthink document UUIDs) and exclusion criteria.

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