Skip to main content
Glama

yuque_get_docs

Retrieve document lists from Yuque knowledge base repositories using repository ID, with options for pagination and result limits to organize content access.

Instructions

获取文档列表 (List documents in a repository)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoIdYes知识库ID (Repository ID)
limitNo返回数量限制,默认20 (Result limit, default 20)
offsetNo偏移量,默认0 (Offset for pagination, default 0)

Implementation Reference

  • Executes the yuque_get_docs tool by fetching documents from the specified Yuque repository using the client and formatting the response as JSON text.
    async function handleGetDocs( client: YuqueClient, args: { repoId: number; limit?: number; offset?: number } ) { const docs = await client.getDocs(args.repoId, { limit: args.limit, offset: args.offset, }); return { content: [ { type: 'text', text: JSON.stringify(docs, null, 2), }, ], }; }
  • Tool definition including name, description, and input schema validation for yuque_get_docs.
    { name: 'yuque_get_docs', description: '获取文档列表 (List documents in a repository)', inputSchema: { type: 'object', properties: { repoId: { type: 'number', description: '知识库ID (Repository ID)', }, limit: { type: 'number', description: '返回数量限制,默认20 (Result limit, default 20)', minimum: 1, maximum: 100, }, offset: { type: 'number', description: '偏移量,默认0 (Offset for pagination, default 0)', minimum: 0, }, }, required: ['repoId'], }, },
  • Registration of yuque_get_docs in the main tool dispatcher switch statement, routing calls to the handler function.
    case 'yuque_get_docs': return await handleGetDocs( client, args as { repoId: number; limit?: number; offset?: number } );
  • Supporting utility in YuqueClient that makes the HTTP API request to retrieve documents list from Yuque.
    async getDocs(repoId: number, options?: { limit?: number; offset?: number }): Promise<YuqueDoc[]> { const params = new URLSearchParams(); if (options?.limit) params.append('limit', options.limit.toString()); if (options?.offset) params.append('offset', options.offset.toString()); const endpoint = `/repos/${repoId}/docs${params.toString() ? '?' + params.toString() : ''}`; return this.request<YuqueDoc[]>(endpoint); }
  • src/server.ts:46-50 (registration)
    MCP server registration for listing tools, which includes the yuque_get_docs schema via YUQUE_TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: YUQUE_TOOLS, }; });

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