Skip to main content
Glama

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
NameRequiredDescriptionDefault
docIdYes文档ID (Document ID)
repoIdYes知识库ID (Repository ID)

Implementation Reference

  • 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)', }, ], }; }
  • 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'], }, },
  • 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 } );
  • 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) {

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/tanis2010/yuque-mcp-server'

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