Skip to main content
Glama

delete_note

Delete a markdown note by providing an exact path and confirmation path. This action is irreversible and requires both paths to match.

Instructions

Deletes a note. Pass { path, confirmPath } where both must match exactly. Returns { root, path, success }. This is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler for delete_note. Parses input with DeleteNoteSchema, calls services.file.deleteNote(), and returns success/error response.
    function makeDeleteNoteTool(container: ServiceContainer): ToolHandler {
      return {
        name: "delete_note",
        description: "Deletes a note. Pass `{ path, confirmPath }` where both must match exactly. Returns `{ root, path, success }`. This is irreversible.",
        inputSchema: DeleteNoteSchema,
        async handler(args): Promise<ToolResponse> {
          const services = requireServices(container);
          const { path, confirmPath } = DeleteNoteSchema.parse(args);
          log.info({ path }, "delete_note called");
          try {
            await services.file.deleteNote(path, confirmPath);
            log.info({ path }, "delete_note complete");
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({ root: getRoot(container), path, success: true }),
                },
              ],
            };
          } catch (err) {
            log.error({ err, path }, "delete_note failed");
            return {
              content: [{ type: "text", text: JSON.stringify({
                root: getRoot(container),
                error: err instanceof Error ? err.message : String(err),
                possibleSolutions: ["Verify the path exists with read_note", "Ensure confirmPath exactly matches path"],
              }) }],
              isError: true,
            };
          }
        },
      };
    }
  • Input validation schema requiring path and confirmPath (both non-empty strings).
    const DeleteNoteSchema = z.object({
      path: z.string().min(1, "path is required"),
      confirmPath: z.string().min(1, "confirmPath is required"),
    });
  • Registers delete_note tool (via makeDeleteNoteTool) into the global tool registry.
    export function registerNoteTools(
      registry: Map<string, ToolHandler>,
      container: ServiceContainer,
    ): void {
      const tools = [
        makeReadNoteTool(container),
        makeWriteNoteTool(container),
        makePatchNoteTool(container),
        makeDeleteNoteTool(container),
        makeMoveNoteTool(container),
        makeReadMultipleNotesTool(container),
      ];
    
      for (const tool of tools) {
        registry.set(tool.name, tool);
      }
  • The underlying file service implementation. Validates confirmPath matches path, resolves to full path, then performs fs.unlink to delete.
    async deleteNote(relativePath: string, confirmPath: string): Promise<void> {
      log.info({ path: relativePath }, "deleteNote");
    
      if (relativePath !== confirmPath) {
        throw new Error(
          `deleteNote: confirmPath "${confirmPath}" does not match path "${relativePath}"`,
        );
      }
    
      const fullPath = this.resolvePath(relativePath);
      await fs.unlink(fullPath);
    }
  • TypeScript interface declaration for the deleteNote method in FileService.
    deleteNote(path: string, confirmPath: string): Promise<void>;
Behavior4/5

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

With no annotations, the description fully covers behavior: deletion, irreversibility, return structure, and the confirmation requirement. It does not mention potential side effects, permissions, or error handling, but covers the core behavioral traits.

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?

Three sentences with no wasted words. The first sentence immediately states the primary action, followed by usage constraint and return/irreversibility note. Efficient and well-structured.

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?

Given the tool's simplicity, the description covers input, constraints, return, and irreversibility. It lacks details on error conditions or permissions, but for a delete operation with confirmation, it is nearly complete.

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?

Schema coverage is 100%, so baseline is 3. The description adds meaning by stating that both paths must match exactly (confirmation) and describing the return object, going beyond the schema's field definitions.

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 'Deletes a note,' specifying the verb and resource. It adds important constraints (matching confirmPath, irreversible) but does not explicitly differentiate from sibling tools like patch_note or move_note, though the action is unique.

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?

The description implies use for deletion but provides no guidance on when not to use or alternatives. It includes a usage instruction (pass matching path and confirmPath) but lacks context for choosing this over other note operations.

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/Erodenn/markscribe'

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