Skip to main content
Glama

create_from_url

Capture web content directly into DEVONthink by providing a URL, with options to customize formatting, organization, and metadata for efficient knowledge management.

Instructions

Create a record in DEVONthink from a web URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe web URL to capture
nameNoName for the new record (defaults to page title)
parentGroupUuidNoUUID of the parent group to place the new record in
readabilityNoUse readability mode to strip navigation and ads (where supported)
userAgentNoCustom HTTP User-Agent header for the request
referrerNoHTTP Referer header for the request
pdfOptionsNoPDF-specific options (only applies when format is 'pdf')
databaseNameNoTarget database name; uses current database if omitted

Implementation Reference

  • The tool definition, registration, and handler (run) function for "create_from_url".
    export const createFromUrlTool = defineTool({
      name: "create_from_url",
      description: "Create a record in DEVONthink from a web URL.",
      schema: z.object({
        url: z.string().url().describe("The web URL to capture"),
        format: z
          .enum(FORMAT_VALUES)
          .describe(
            "Capture format: formatted_note, markdown, pdf, or web_document"
          ),
        name: z
          .string()
          .optional()
          .describe("Name for the new record (defaults to page title)"),
        parentGroupUuid: z
          .string()
          .optional()
          .describe("UUID of the parent group to place the new record in"),
        readability: z
          .boolean()
          .optional()
          .describe("Use readability mode to strip navigation and ads (where supported)"),
        userAgent: z
          .string()
          .optional()
          .describe("Custom HTTP User-Agent header for the request"),
        referrer: z
          .string()
          .optional()
          .describe("HTTP Referer header for the request"),
        pdfOptions: z
          .object({
            pagination: z
              .boolean()
              .optional()
              .describe("Enable pagination in the PDF"),
            width: z
              .number()
              .int()
              .positive()
              .optional()
              .describe("Page width in pixels for the PDF"),
          })
          .optional()
          .describe("PDF-specific options (only applies when format is 'pdf')"),
        databaseName: z
          .string()
          .optional()
          .describe(
            "Target database name; uses current database if omitted"
          ),
      }),
      run: async (args, executor) => {
        const {
          url,
          format,
          name,
          parentGroupUuid,
          readability,
          userAgent,
          referrer,
          pdfOptions,
          databaseName,
        } = args;
    
        const script = `
          ${JXA_APP}
          var url = ${jxaLiteral(url)};
          var format = ${jxaLiteral(format)};
          var name = ${jxaLiteral(name ?? null)};
          var parentGroupUuid = ${jxaLiteral(parentGroupUuid ?? null)};
          var readability = ${jxaLiteral(readability ?? false)};
          var userAgent = ${jxaLiteral(userAgent ?? null)};
          var referrer = ${jxaLiteral(referrer ?? null)};
          var pdfPagination = ${jxaLiteral(pdfOptions?.pagination ?? null)};
          var pdfWidth = ${jxaLiteral(pdfOptions?.width ?? null)};
          var dbName = ${jxaLiteral(databaseName ?? null)};
    
          // Resolve target database
          var targetDb;
          if (dbName) {
            var dbs = app.databases();
            targetDb = null;
            for (var i = 0; i < dbs.length; i++) {
              if (dbs[i].name() === dbName) { targetDb = dbs[i]; break; }
            }
            if (!targetDb) throw new Error("Database not found: " + dbName);
          } else {
            targetDb = app.currentDatabase();
          }
    
          // Resolve parent 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 {
            parentGroup = targetDb.root();
          }
    
          // Build common options
          var opts = {in: parentGroup};
          if (name) opts["name"] = name;
          if (readability) opts["readability"] = true;
          if (userAgent) opts["agent"] = userAgent;
          if (referrer) opts["referrer"] = referrer;
    
          var record;
    
          if (format === "formatted_note") {
            record = app.createFormattedNoteFrom(url, opts);
    
          } else if (format === "markdown") {
            record = app.createMarkdownFrom(url, opts);
    
          } else if (format === "pdf") {
            if (pdfPagination !== null) opts["paginate"] = pdfPagination;
            if (pdfWidth !== null) opts["width"] = pdfWidth;
            record = app.createPDFDocumentFrom(url, opts);
    
          } else if (format === "web_document") {
            record = app.createWebDocumentFrom(url, opts);
    
          } else {
            throw new Error("Unknown format: " + format);
          }
    
          if (!record || !record.uuid()) throw new Error("Failed to create record from URL: " + url);
    
          JSON.stringify(${JXA_RECORD_PROPS});
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.stdout);
      },
    });
Behavior2/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 but offers minimal insight. It does not disclose that the tool performs HTTP requests (evidenced by userAgent/referrer parameters), supports multiple output formats, or that pdfOptions only applies to specific formats. The mutation aspect ('Create') is implied but not explicit about side effects.

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 wasted words. It is appropriately front-loaded with the action and resource. However, for a tool with 8 parameters including nested objects, the extreme brevity arguably under-serves the complexity, though this primarily impacts completeness rather than conciseness itself.

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

Completeness2/5

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

Given the high complexity (8 parameters, nested pdfOptions object, HTTP header customization, readability processing) and lack of output schema or annotations, the description is insufficient. It fails to explain the web capture behavior, output formats, or what the created record contains, leaving critical behavioral gaps for an agent trying to invoke this tool correctly.

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?

Schema description coverage is 100%, establishing a baseline of 3. The description mentions 'from a web URL' which maps to the url parameter, but adds no additional context about parameter relationships (e.g., that readability mode affects content extraction or that pdfOptions requires specific formats) beyond what the schema already provides.

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 verb (Create), resource (record in DEVONthink), and specific source (web URL), distinguishing it from the sibling 'create_record' tool. However, it lacks specificity about what type of record is created (bookmark, PDF, HTML) despite the schema supporting multiple formats.

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?

No guidance is provided on when to use this tool versus alternatives like 'create_record' or 'convert_record'. Given the complexity of web capture options (PDF vs HTML vs bookmark), the description fails to specify prerequisites or ideal use cases.

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