Skip to main content
Glama

delete_doc

Move a doc to the trash using its unique ID with the Dart MCP Server, allowing for potential recovery while preserving doc details unchanged.

Instructions

Move an existing doc to the trash, where it can be recovered if needed. Nothing else about the doc will be changed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe 12-character alphanumeric ID of the doc

Implementation Reference

  • The handler function for the 'delete_doc' tool. It validates the provided doc ID using getIdValidated, calls DocService.deleteDoc(id) to perform the deletion (moving to trash), and returns the result as JSON.
    case DELETE_DOC_TOOL.name: { const id = getIdValidated(args.id); const doc = await DocService.deleteDoc(id); return { content: [{ type: "text", text: JSON.stringify(doc, null, 2) }], }; }
  • Input schema and metadata definition for the 'delete_doc' tool, specifying the required 'id' parameter with validation pattern.
    export const DELETE_DOC_TOOL: Tool = { name: "delete_doc", description: "Move an existing doc to the trash, where it can be recovered if needed. Nothing else about the doc will be changed.", inputSchema: { type: "object", properties: { id: { type: "string", description: "The 12-character alphanumeric ID of the doc", pattern: "^[a-zA-Z0-9]{12}$", }, }, required: ["id"], }, };
  • index.ts:192-214 (registration)
    Registration of all tools including DELETE_DOC_TOOL (at line 206) in the TOOLS array, used by ListToolsRequestHandler to expose the tool.
    const TOOLS = [ // Config GET_CONFIG_TOOL, // Tasks CREATE_TASK_TOOL, LIST_TASKS_TOOL, GET_TASK_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, // Docs CREATE_DOC_TOOL, LIST_DOCS_TOOL, GET_DOC_TOOL, UPDATE_DOC_TOOL, DELETE_DOC_TOOL, // Comments ADD_TASK_COMMENT_TOOL, LIST_TASK_COMMENTS_TOOL, // Other GET_DARTBOARD_TOOL, GET_FOLDER_TOOL, GET_VIEW_TOOL, ];
  • index.ts:36-52 (registration)
    Import of DELETE_DOC_TOOL (line 39) from tools.ts into index.ts for use in handlers and registration.
    ADD_TASK_COMMENT_TOOL, CREATE_DOC_TOOL, CREATE_TASK_TOOL, DELETE_DOC_TOOL, DELETE_TASK_TOOL, GET_CONFIG_TOOL, GET_DARTBOARD_TOOL, GET_DOC_TOOL, GET_FOLDER_TOOL, GET_TASK_TOOL, GET_VIEW_TOOL, LIST_DOCS_TOOL, LIST_TASK_COMMENTS_TOOL, LIST_TASKS_TOOL, UPDATE_DOC_TOOL, UPDATE_TASK_TOOL, } from "./tools.js";
  • Helper function getIdValidated used in the delete_doc handler to validate the 12-character alphanumeric doc ID.
    const getIdValidated = (strMaybe: any, name: string = "ID"): string => { if (typeof strMaybe !== "string" && !(strMaybe instanceof String)) { throw new Error(`${name} must be a string`); } const id = strMaybe.toString(); if (!ID_REGEX.test(id)) { throw new Error(`${name} must be 12 alphanumeric characters`); } return id; };

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/its-dart/dart-mcp-server'

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