Skip to main content
Glama

list_smart_rules

Enumerate DEVONthink smart rules by parsing SmartRules.plist to retrieve names, UUIDs, enabled states, and execution timestamps when standard APIs are unavailable.

Instructions

List all DEVONthink smart rules by parsing SmartRules.plist. Returns name, UUID (from sync.UUID), enabled state, indexOffset, lastExecution timestamp, and sync date for each rule. Smart rules are NOT accessible via the standard AppleScript API — this is the only way to enumerate them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'listSmartRules' that parses the DEVONthink SmartRules.plist file and returns the list of smart rules.
    const listSmartRules = async (): Promise<SmartRulesResult> => {
      if (!existsSync(PLIST_PATH)) {
        return {
          success: false,
          error: `SmartRules.plist not found at: ${PLIST_PATH}. Ensure DEVONthink has been run at least once and smart rules have been created.`,
        };
      }
    
      let xml: string;
      try {
        xml = execSync(`plutil -convert xml1 -o - "${PLIST_PATH}"`, {
          encoding: "utf-8",
          timeout: 10000,
        });
      } catch (err) {
        return {
          success: false,
          error: `Failed to parse SmartRules.plist: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      let smartRules: SmartRuleEntry[];
      try {
        smartRules = parsePlistXmlToSmartRules(xml);
      } catch (err) {
        return {
          success: false,
          error: `Failed to parse XML output from plutil: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      smartRules.sort((a, b) => a.name.localeCompare(b.name));
    
      return { success: true, smartRules, totalCount: smartRules.length };
    };
  • The MCP tool object 'listSmartRulesTool' which registers the 'list_smart_rules' name and associates it with the 'listSmartRules' handler.
    export const listSmartRulesTool: McpTool = {
      name: "list_smart_rules",
      description:
        "List all DEVONthink smart rules by parsing SmartRules.plist. " +
        "Returns name, UUID (from sync.UUID), enabled state, indexOffset, lastExecution timestamp, " +
        "and sync date for each rule. " +
        "Smart rules are NOT accessible via the standard AppleScript API — this is the only way to enumerate them.",
      inputSchema: {
        type: "object" as const,
        properties: {},
        additionalProperties: false,
      },
      run: listSmartRules,
    };
Behavior4/5

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

No annotations provided, but description carries burden well by disclosing data source (SmartRules.plist), read-only nature (implied by 'List' and 'parsing'), and detailed return structure (compensating for missing output schema). Could explicitly state 'safe/read-only' given no annotations.

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?

Three sentences with zero waste: action+method, return values, and unique usage context. Front-loaded with essential information; every sentence earns its place.

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?

Excellent coverage given no output schema and no annotations. Lists all return fields (name, UUID, enabled state, etc.) and explains the unique value proposition (AppleScript limitation). Minor gap: doesn't mention performance characteristics of plist parsing.

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?

Input schema has 0 parameters. Description appropriately mentions no parameters, meeting the baseline of 4 for zero-parameter tools.

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?

Specific verb 'List' + resource 'DEVONthink smart rules' + implementation detail 'parsing SmartRules.plist'. Clearly distinguishes from sibling 'list_smart_groups' by specifying 'smart rules' and noting these are inaccessible via AppleScript API.

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

Usage Guidelines4/5

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

Provides explicit context that this is 'the only way to enumerate them' due to AppleScript API limitations. Implies when to use (when you need smart rules specifically), though could explicitly contrast with 'list_smart_groups' for clarity.

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