get_doc
Retrieve detailed document information by its unique ID, including title, text content, and folder, using the API on the Dart MCP Server.
Instructions
Retrieve an existing doc by its ID. Returns the doc's information including title, text content, folder, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The 12-character alphanumeric ID of the doc |
Implementation Reference
- index.ts:451-457 (handler)Handler for the 'get_doc' tool: validates the document ID using getIdValidated and retrieves the document via DocService.getDoc(id), returning it as JSON.case GET_DOC_TOOL.name: { const id = getIdValidated(args.id); const doc = await DocService.getDoc(id); return { content: [{ type: "text", text: JSON.stringify(doc, null, 2) }], }; }
- tools.ts:517-532 (schema)Schema definition for the 'get_doc' tool, specifying the name, description, and input schema that requires a single 'id' property matching the 12-character alphanumeric pattern.export const GET_DOC_TOOL: Tool = { name: "get_doc", description: "Retrieve an existing doc by its ID. Returns the doc's information including title, text content, folder, and more.", 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 the 'get_doc' tool by including GET_DOC_TOOL in the TOOLS array, which is returned by the ListToolsRequestSchema handler.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:372-373 (registration)The server handler for listing tools, which exposes the TOOLS array containing 'get_doc'.tools: TOOLS, }));
- index.ts:67-76 (helper)Helper function getIdValidated used in the get_doc handler to validate the input ID against the 12-character alphanumeric pattern.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; };