yuque_delete_doc
Remove documents from Yuque knowledge bases using document ID and repository ID to manage content and maintain organized repositories.
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 for yuque_delete_doc tool. Calls YuqueClient.deleteDoc with provided docId and repoId, then returns a 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:140-156 (schema)Tool definition including name, description, and input schema requiring docId (number) and repoId (number).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 handleTool function that registers and dispatches yuque_delete_doc calls to the handleDeleteDoc function.case 'yuque_delete_doc': return await handleDeleteDoc( client, args as { docId: number; repoId: number } );
- src/yuque-client.ts:228-235 (helper)YuqueClient method that performs the actual API DELETE request to delete the document./** * Delete a document */ async deleteDoc(docId: number, repoId: number): Promise<void> { await this.request(`/repos/${repoId}/docs/${docId}`, { method: 'DELETE', }); }
- src/server.ts:53-56 (registration)MCP server registration of the general tool call handler which routes to specific tool handlers via handleTool.server.setRequestHandler(CallToolRequestSchema, async (request) => { try { return await handleTool(request, { client: yuqueClient }); } catch (error) {