Skip to main content
Glama

yuque_get_doc

Retrieve document details from Yuque knowledge base using document ID and repository ID to access content and metadata.

Instructions

获取文档详情 (Get document details)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYes文档ID (Document ID)
repoIdYes知识库ID (Repository ID)

Implementation Reference

  • The handler function that executes the yuque_get_doc tool by fetching the document from YuqueClient and returning it 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), }, ], }; }
  • The tool schema definition specifying the input parameters docId and repoId as required numbers.
    { 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/server.ts:46-50 (registration)
    Registers the tool list handler which exposes the yuque_get_doc tool schema via YUQUE_TOOLS.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; });
  • src/server.ts:53-67 (registration)
    Registers the general tool execution handler which dispatches yuque_get_doc calls to the specific handler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { try { return await handleTool(request, { client: yuqueClient }); } catch (error) { if (error instanceof McpError) { throw error; } const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError( ErrorCode.InternalError, `Error executing tool: ${errorMessage}` ); } });
  • Switch case in handleTool that routes yuque_get_doc requests to the handleGetDoc function.
    case 'yuque_get_doc': return await handleGetDoc( client, args as { docId: number; repoId: number } );

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