yuque_delete_doc
Remove documents from the Yuque knowledge base platform by specifying document and repository IDs for content management.
Instructions
删除文档 (Delete document)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | 文档ID (Document ID) | |
| repoId | Yes | 知识库ID (Repository ID) |
Implementation Reference
- src/tools/handlers.ts:212-225 (handler)The main handler function that executes the yuque_delete_doc tool logic by calling the YuqueClient.deleteDoc method and returning a bilingual success message.async function handleDeleteDoc( client: YuqueClient, args: { docId: number; repoId: number } ) { await client.deleteDoc(args.docId, args.repoId); return { content: [ { type: 'text', text: '文档删除成功 (Document deleted successfully)', }, ], }; }
- src/tools/definitions.ts:139-156 (schema)The input schema definition for the yuque_delete_doc tool, requiring docId and repoId as numeric parameters.{ name: 'yuque_delete_doc', description: '删除文档 (Delete document)', inputSchema: { type: 'object', properties: { docId: { type: 'number', description: '文档ID (Document ID)', }, repoId: { type: 'number', description: '知识库ID (Repository ID)', }, }, required: ['docId', 'repoId'], }, },
- src/tools/handlers.ts:65-69 (registration)Switch case in the main handleTool function that registers and routes yuque_delete_doc calls to its handler.case 'yuque_delete_doc': return await handleDeleteDoc( client, args as { docId: number; repoId: number } );
- src/server.ts:46-50 (registration)MCP server registration for listing tools, which includes the yuque_delete_doc tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; });
- src/yuque-client.ts:231-235 (helper)Supporting YuqueClient method that performs the actual Yuque API DELETE request for the document.async deleteDoc(docId: number, repoId: number): Promise<void> { await this.request(`/repos/${repoId}/docs/${docId}`, { method: 'DELETE', }); }