Skip to main content
Glama

selected_records

Retrieve details about records currently highlighted in DEVONthink to access document information without manual searching.

Instructions

Get information about currently selected records in DEVONthink.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'selected_records' tool. It executes a JXA script to fetch records currently selected in the DEVONthink application and returns their summaries.
    export const selectedRecordsTool = defineTool({
      name: "selected_records",
      description:
        "Get information about currently selected records in DEVONthink.",
      schema: z.object({}),
      run: async (_args, executor) => {
        const script = `
    ${JXA_APP}
    var records = app.selectedRecords();
    var result = [];
    for (var i = 0; i < records.length; i++) {
      var record = records[i];
      result.push(${JXA_RECORD_SUMMARY});
    }
    JSON.stringify(result);
    `.trim();
    
        const { stdout } = executor.run(script);
        return JSON.parse(stdout) as Array<{
          uuid: string;
          name: string;
          type: string;
          location: string;
          database: string;
          tags: string[];
          score: number;
          flagged: boolean;
          label: number;
          modificationDate: string | null;
        }>;
      },
    });
  • The registration of the 'selectedRecordsTool' in the 'allTools' array.
    selectedRecordsTool,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It fails to disclose what 'information' comprises, behavior when nothing is selected, whether this requires specific permissions, or the return structure. 'Get' implies read-only, but this is weak inference without confirmation.

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?

Single sentence of eight words. Every word earns its place: action ('Get'), target ('information'), subject ('currently selected records'), and scope ('in DEVONthink'). No redundancy or filler.

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?

For a zero-parameter state-retrieval tool, the description identifies the core concept (current selection). However, lacking an output schema, it should ideally clarify what gets returned (IDs, properties, or content). It meets minimum viability but leaves functional gaps.

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 zero parameters. Per calibration rules, 0 params = baseline 4. The description correctly implies no filtering or identifiers are needed (operating on implicit UI state), which aligns with the empty 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?

States a clear verb ('Get') and resource ('information about currently selected records') with scope ('in DEVONthink'). However, 'information' is vague given siblings like get_record_properties and get_record_content exist, leaving ambiguity about whether this returns identifiers, metadata, or full content.

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

Usage Guidelines3/5

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

The phrase 'currently selected' implies UI-contextual usage (retrieving whatever the user has highlighted) versus direct lookup tools like get_record_by_identifier or search. However, it provides no explicit when-to-use guidance, prerequisites (e.g., DEVONthink running), or named alternatives.

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