Skip to main content
Glama

get_column_layout

Retrieve column layout settings for DEVONthink smart groups or rules by name or UUID, returning visible columns, table view columns, and column widths.

Instructions

Read the column layout for a DEVONthink smart group or smart rule from preferences. Returns the ordered visible columns, all table view columns, and column widths. Looks up by name (or UUID). Supports partial name matching. Input: { "name": "Archivieren - Jobs" } or { "name": "Jobs", "uuid": "4A469368-..." }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the smart group or smart rule whose column layout to read
uuidNoOptional UUID of the smart group (fallback if name not found). DEVONthink sometimes stores layouts under the UUID rather than the display name.

Implementation Reference

  • Handler function that implements the logic for get_column_layout, including exact and fuzzy matching, and fallback to UUID if provided.
    const getColumnLayout = async (args: Record<string, unknown>): Promise<unknown> => {
      const name = args.name as string | undefined;
      const uuid = args.uuid as string | undefined;
    
      if (!name || typeof name !== "string") {
        return { success: false, error: "name parameter is required" };
      }
    
      const exactResult = readLayoutForName(name);
      if (exactResult) {
        return { success: true, ...exactResult };
      }
    
      if (uuid && typeof uuid === "string") {
        const uuidResult = readLayoutForName(uuid);
        if (uuidResult) {
          return { success: true, ...uuidResult, name };
        }
      }
    
      const fuzzyMatches = findMatchingNames(name);
    
      if (fuzzyMatches.length === 1) {
        const fuzzyResult = readLayoutForName(fuzzyMatches[0]);
        if (fuzzyResult) {
          return {
            success: true,
            ...fuzzyResult,
            nameSearched: name,
            note: `Exact name not found; matched "${fuzzyMatches[0]}" via partial search`,
          };
        }
      }
    
      const examples = getExistingNames(15);
    
      if (fuzzyMatches.length > 1) {
        return {
          success: false,
          name,
          error: `No exact match for "${name}". Multiple partial matches found — be more specific.`,
          partialMatches: fuzzyMatches,
        };
      }
    
      return {
        success: false,
        name,
        error:
          `No column layout found for "${name}". ` +
          "This smart group may not have a custom layout yet (it will use defaults). " +
          "Use copy_column_layout to copy an existing layout to it.",
        exampleNames: examples,
      };
    };
  • Tool registration and input schema definition for get_column_layout.
    export const getColumnLayoutTool: McpTool = {
      name: "get_column_layout",
      description:
        "Read the column layout for a DEVONthink smart group or smart rule from preferences. " +
        "Returns the ordered visible columns, all table view columns, and column widths. " +
        "Looks up by name (or UUID). Supports partial name matching. " +
        'Input: { "name": "Archivieren - Jobs" } or { "name": "Jobs", "uuid": "4A469368-..." }',
      inputSchema: {
        type: "object" as const,
        properties: {
          name: {
            type: "string",
            description: "Name of the smart group or smart rule whose column layout to read",
          },
          uuid: {
            type: "string",
            description:
              "Optional UUID of the smart group (fallback if name not found). " +
              "DEVONthink sometimes stores layouts under the UUID rather than the display name.",
          },
        },
        required: ["name"],
        additionalProperties: false,
      },
      run: getColumnLayout,
    };

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