Skip to main content
Glama

list_smart_groups

Retrieve DEVONthink smart groups with names, UUIDs, and sync data for querying contents. Smart groups are only accessible through this method, not via standard AppleScript API.

Instructions

List all DEVONthink smart groups by parsing SmartGroups.plist. Returns name, UUID (from sync.UUID), sync date, and UseUUIDKey flag for each smart group. Smart groups are NOT accessible via the standard AppleScript API — this is the only way to enumerate them. Use the returned uuid with the search tool (groupUuid parameter) to query the contents of a smart group.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual logic for listing and parsing DEVONthink smart groups from the SmartGroups.plist file.
    const listSmartGroups = async (): Promise<SmartGroupsResult> => {
      if (!existsSync(PLIST_PATH)) {
        return {
          success: false,
          error: `SmartGroups.plist not found at: ${PLIST_PATH}. Ensure DEVONthink has been run at least once.`,
        };
      }
    
      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 SmartGroups.plist: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      let smartGroups: SmartGroupEntry[];
      try {
        smartGroups = parsePlistXmlToSmartGroups(xml);
      } catch (err) {
        return {
          success: false,
          error: `Failed to parse XML output from plutil: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      smartGroups.sort((a, b) => a.name.localeCompare(b.name));
    
      return { success: true, smartGroups, totalCount: smartGroups.length };
    };
  • The MCP tool definition for `list_smart_groups`, associating it with the `listSmartGroups` handler.
    export const listSmartGroupsTool: McpTool = {
      name: "list_smart_groups",
      description:
        "List all DEVONthink smart groups by parsing SmartGroups.plist. " +
        "Returns name, UUID (from sync.UUID), sync date, and UseUUIDKey flag for each smart group. " +
        "Smart groups are NOT accessible via the standard AppleScript API — this is the only way to enumerate them. " +
        "Use the returned uuid with the search tool (groupUuid parameter) to query the contents of a smart group.",
      inputSchema: {
        type: "object" as const,
        properties: {},
        additionalProperties: false,
      },
      run: listSmartGroups,
    };
Behavior4/5

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

With no annotations provided, description carries full burden. Discloses return values (name, UUID, sync date, UseUUIDKey), data source (SmartGroups.plist), and API limitation. Lacks explicit safety declarations (read-only status) or error handling details, but effectively explains the parsing behavior and output structure.

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: 1) Action and returns, 2) Critical limitation/distinction, 3) Integration with sibling tool. Information is front-loaded and every sentence earns its place.

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

Completeness5/5

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

No output schema exists, so description comprehensively documents return values. Adequately explains domain-specific concept (smart groups vs regular groups) and relationships to other tools in the absence of annotations or structured output schema.

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?

Zero parameters present with 100% schema coverage (trivially). Description correctly focuses on behavior rather than parameters, meeting the baseline 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?

States specific verb 'List' with resource 'DEVONthink smart groups' and implementation method 'parsing SmartGroups.plist'. Explicitly distinguishes from siblings by noting smart groups are 'NOT accessible via the standard AppleScript API' and references the 'search' tool for subsequent operations.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance ('this is the only way to enumerate them') and clear next-step instructions ('Use the returned uuid with the search tool'). Names the specific sibling tool and parameter ('search tool (groupUuid parameter)') for querying contents.

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