Skip to main content
Glama
jordanburke

joplin-mcp-server

list_notebooks

Retrieve the complete notebook hierarchy from Joplin for organized note management and structured data access.

Instructions

Retrieve the complete notebook hierarchy from Joplin

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function: fetches all folders/notebooks from Joplin API, builds a hierarchical structure by parent_id, formats as indented list with IDs, handles errors.
    class ListNotebooks extends BaseTool {
      async call(): Promise<string> {
        try {
          const notebooks = await this.apiClient.getAllItems<JoplinFolder>("/folders", {
            query: { fields: "id,title,parent_id" },
          })
    
          const notebooksByParentId: Record<string, JoplinFolder[]> = {}
    
          notebooks.forEach((notebook) => {
            const parentId = notebook.parent_id || ""
            if (!notebooksByParentId[parentId]) {
              notebooksByParentId[parentId] = []
            }
            notebooksByParentId[parentId].push(notebook)
          })
    
          // Add a header with instructions
          const resultLines = [
            "Joplin Notebooks:\n",
            "NOTE: To read a notebook, use the notebook_id with the read_notebook command\n",
            'Example: read_notebook notebook_id="your-notebook-id"\n\n',
          ]
    
          // Add the notebook hierarchy
          resultLines.push(
            ...this.notebooksLines(notebooksByParentId[""] || [], {
              indent: 0,
              notebooksByParentId,
            }),
          )
    
          return resultLines.join("")
        } catch (error: unknown) {
          return this.formatError(error, "listing notebooks")
        }
      }
  • Recursive helper to build indented hierarchical lines of notebooks.
    private notebooksLines(
      notebooks: JoplinFolder[],
      {
        indent = 0,
        notebooksByParentId,
      }: {
        indent: number
        notebooksByParentId: Record<string, JoplinFolder[]>
      },
    ): string[] {
      const result: string[] = []
      const indentSpaces = " ".repeat(indent)
    
      this.sortNotebooks(notebooks).forEach((notebook) => {
        const id = notebook.id
        result.push(`${indentSpaces}Notebook: "${notebook.title}" (notebook_id: "${id}")\n`)
    
        const childNotebooks = notebooksByParentId[id]
        if (childNotebooks) {
          result.push(
            ...this.notebooksLines(childNotebooks, {
              indent: indent + 2,
              notebooksByParentId,
            }),
          )
        }
      })
    
      return result
    }
  • Helper to sort notebooks, special handling for titles starting with '['.
    private sortNotebooks(notebooks: JoplinFolder[]): JoplinFolder[] {
      // Ensure that notebooks starting with '[0]' are sorted first
      const CHARACTER_BEFORE_A = String.fromCharCode("A".charCodeAt(0) - 1)
      return [...notebooks].sort((a, b) => {
        const titleA = a.title.replace("[", CHARACTER_BEFORE_A)
        const titleB = b.title.replace("[", CHARACTER_BEFORE_A)
        return titleA.localeCompare(titleB)
      })
    }
  • Tool schema definition: no input parameters required.
      name: "list_notebooks",
      description: "Retrieve the complete notebook hierarchy from Joplin",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:225-228 (registration)
    MCP tool call registration: handles 'call_tool' requests for list_notebooks by delegating to manager.
    case "list_notebooks": {
      const listResult = await manager.listNotebooks()
      return { content: [{ type: "text", text: listResult }], isError: false }
    }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states the tool retrieves data, implying a read-only operation, but doesn't cover aspects like permissions, rate limits, response format, or whether it's paginated. This is a significant gap for a tool with zero annotation coverage.

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 that front-loads the key information ('Retrieve the complete notebook hierarchy') without any waste. It's appropriately sized for a simple tool with no parameters.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the retrieved hierarchy looks like (e.g., structure, fields), behavioral traits, or how it differs from sibling tools. For a tool with no structured data support, this leaves significant 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?

The tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, but it does mention the scope ('complete notebook hierarchy'), which provides context beyond the empty schema. Baseline for 0 params is 4.

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 ('Retrieve') and resource ('complete notebook hierarchy from Joplin'), making the tool's purpose understandable. It doesn't explicitly differentiate from siblings like 'read_notebook' or 'search_notes', but the scope ('complete notebook hierarchy') provides some distinction.

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 such as 'read_notebook' or 'search_notes'. The description implies it retrieves a hierarchy, but it doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer usage.

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

Related 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/jordanburke/joplin-mcp-server'

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