Skip to main content
Glama

get_notebook

Retrieve detailed information about a specific notebook by ID to access its content and metadata for querying and analysis.

Instructions

Get detailed information about a specific notebook by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe notebook ID

Implementation Reference

  • The primary handler function that implements the core logic of the 'get_notebook' tool. It retrieves the notebook by ID from the library, handles errors if not found, and returns the notebook data or an error.
    async handleGetNotebook(args: { id: string }): Promise<ToolResult<{ notebook: any }>> {
      log.info(`🔧 [TOOL] get_notebook called`);
      log.info(`  ID: ${args.id}`);
    
      try {
        const notebook = this.library.getNotebook(args.id);
        if (!notebook) {
          log.warning(`⚠️  [TOOL] Notebook not found: ${args.id}`);
          return {
            success: false,
            error: `Notebook not found: ${args.id}`,
          };
        }
    
        log.success(`✅ [TOOL] get_notebook completed: ${notebook.name}`);
        return {
          success: true,
          data: { notebook },
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] get_notebook failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • The tool schema definition for 'get_notebook', specifying the input schema (requires 'id' string) and description used by the MCP protocol.
    {
      name: "get_notebook",
      description: "Get detailed information about a specific notebook by ID",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "The notebook ID",
          },
        },
        required: ["id"],
      },
    },
  • src/index.ts:189-193 (registration)
    The registration/dispatch logic in the main MCP server that maps incoming 'get_notebook' tool calls to the corresponding handler method.
    case "get_notebook":
      result = await this.toolHandlers.handleGetNotebook(
        args as { id: string }
      );
      break;
  • The underlying helper method in NotebookLibrary that performs the actual notebook lookup by ID, used by the tool handler.
    getNotebook(id: string): NotebookEntry | null {
      return this.library.notebooks.find((n) => n.id === id) || null;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. 'Get detailed information' clearly signals a read-only operation, but it does not specify what 'detailed' includes, how errors are handled (e.g., invalid ID), or any response format expectations. Adequate but shallow.

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?

A single sentence that is direct and front-loaded, with no filler. Every word contributes meaning.

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

Completeness4/5

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

For a simple one-parameter read tool, the description is sufficient to invoke correctly: provide an ID and receive detailed notebook info. The lack of an output schema makes 'detailed information' somewhat vague, but this is a minor gap given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the id parameter is already well documented in the schema. The description's 'by ID' merely restates the parameter's purpose without adding format, source, or usage details. Baseline 3 applies.

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?

The description uses a specific verb ('Get') + resource ('notebook') + scope ('specific notebook by ID'), making it easy to distinguish from sibling tools like list_notebooks or search_notebooks. The intent is unambiguous.

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 'by ID' implies usage when a notebook ID is available, but there is no explicit guidance on when to prefer this over list_notebooks, search_notebooks, or select_notebook. Alternatives are not named or excluded, so the usage context remains implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.