Skip to main content
Glama

list_notes

Retrieve all notes stored in the macOS Notes app to view your complete collection of saved information and documents.

Instructions

Get a list of all notes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_notes' tool. It constructs and executes an AppleScript via runAppleScript to list up to the first 20 notes from the Apple Notes app, formats the result, and returns it as text content.
    case 'list_notes': {
      const script = `
        tell application "Notes"
          set noteList to {}
          set noteCount to count of notes
          if noteCount > 0 then
            repeat with i from 1 to noteCount
              if i > 20 then exit repeat
              try
                set aNote to note i
                set noteTitle to name of aNote
                set end of noteList to noteTitle
              on error
                set end of noteList to "Note " & i & " (error reading)"
              end try
            end repeat
          end if
          
          if length of noteList = 0 then
            return "No notes found"
          else
            set AppleScript's text item delimiters to "\\n"
            set noteString to noteList as string
            set AppleScript's text item delimiters to ""
            return "Found " & (length of noteList) & " notes:\\n" & noteString
          end if
        end tell
      `;
      
      const result = await runAppleScript(script);
      return {
        content: [
          {
            type: 'text',
            text: `Notes:\\n${result}`,
          },
        ],
      };
    }
  • Registers the 'list_notes' tool in the MCP server's tool list, including its name, description, and empty input schema.
      name: 'list_notes',
      description: 'Get a list of all notes',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Helper function used by the list_notes handler (and others) to execute AppleScript code safely by writing to a temp file and running via osascript.
    async function runAppleScript(script: string): Promise<string> {
      try {
        // Write script to temporary file to avoid shell escaping issues
        const tempFile = join(tmpdir(), `applescript-${Date.now()}.scpt`);
        writeFileSync(tempFile, script, 'utf8');
        
        try {
          const { stdout } = await execAsync(`osascript "${tempFile}"`);
          return stdout.trim();
        } finally {
          unlinkSync(tempFile);
        }
      } catch (error: any) {
        throw new McpError(ErrorCode.InternalError, `AppleScript error: ${error.message}`);
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, pagination, or what the return format looks like. This leaves significant gaps for an agent.

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

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 tool's simplicity (0 parameters) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'list' entails (e.g., format, ordering, limits) or behavioral aspects, leaving the agent with insufficient context for reliable use.

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?

There are 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, but that's acceptable here, resulting in a baseline score above minimum viable due to the lack of parameters.

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 action ('Get a list') and resource ('all notes'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'search_notes' or 'list_folders', which would require mentioning scope or filtering capabilities.

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 'search_notes' (for filtered searches) or 'get_note' (for single notes). The description lacks context about use cases or exclusions.

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/tdisawas0github/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server