Skip to main content
Glama

yuque_get_docs

Retrieve document lists from a Yuque knowledge base repository using repository ID, with pagination controls for managing results.

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

  • The handler function that executes the yuque_get_docs tool logic: extracts repoId, limit, offset from arguments, calls yuqueClient.getDocs API, and returns the result as JSON-formatted text content.
    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),
          },
        ],
      };
    }
  • Input schema and metadata definition for the yuque_get_docs tool.
    {
      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'],
      },
    },
  • src/server.ts:46-50 (registration)
    Server registration for listing tools, which includes the yuque_get_docs schema from YUQUE_TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: YUQUE_TOOLS,
      };
    });
  • src/server.ts:53-67 (registration)
    Server registration for tool calls, which dispatches to handleTool (containing switch for yuque_get_docs).
    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}`
        );
      }
    });
  • Supporting utility in YuqueClient that performs the actual HTTP request to Yuque API /repos/{repoId}/docs endpoint with optional pagination parameters.
    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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List documents' implies a read operation, it doesn't address important aspects like authentication requirements, rate limits, error conditions, or pagination behavior beyond what the schema indicates. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single bilingual sentence that states the core purpose without any wasted words. It's front-loaded with the essential information and doesn't contain unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (document format, fields included), error conditions, authentication needs, or how it differs from similar tools. The minimal description leaves significant gaps in understanding the tool's behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already fully documents all three parameters. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it doesn't explain repository context, result format, or usage patterns for the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List documents') and target ('in a repository'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this from sibling tools like 'yuque_search_docs' or 'yuque_get_doc', which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when to choose 'yuque_get_docs' over 'yuque_search_docs' or 'yuque_get_doc', nor any context about prerequisites or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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