yuque_get_doc
Retrieve detailed document content from Yuque knowledge bases using document and repository IDs for API integration and data access.
Instructions
获取文档详情 (Get document details)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | 文档ID (Document ID) | |
| repoId | Yes | 知识库ID (Repository ID) |
Implementation Reference
- src/tools/handlers.ts:145-158 (handler)The main handler function for the 'yuque_get_doc' tool. It extracts docId and repoId from arguments, calls YuqueClient.getDoc to fetch the document details, and returns the result as formatted JSON text content.async function handleGetDoc( client: YuqueClient, args: { docId: number; repoId: number } ) { const doc = await client.getDoc(args.docId, args.repoId); return { content: [ { type: 'text', text: JSON.stringify(doc, null, 2), }, ], }; }
- src/tools/definitions.ts:58-75 (schema)The tool definition and input schema for 'yuque_get_doc', specifying required numeric parameters docId and repoId.{ name: 'yuque_get_doc', description: '获取文档详情 (Get document details)', 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:36-40 (registration)Registration of the 'yuque_get_doc' handler within the central tool dispatch switch statement in handleTool.case 'yuque_get_doc': return await handleGetDoc( client, args as { docId: number; repoId: number } );
- src/server.ts:46-50 (registration)Registration for listing all tools, including 'yuque_get_doc', by returning the YUQUE_TOOLS array containing its definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; });