Skip to main content
Glama

get_repo_docs

Retrieve all documents from a Yuque knowledge repository, including titles and update timestamps, to access and organize content efficiently.

Instructions

获取特定知识库中的所有文档列表,包括文档标题、更新时间等信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceYes知识库的命名空间,格式为 user/repo
accessTokenNo用于认证 API 请求的令牌

Implementation Reference

  • MCP tool registration and inline handler function that creates YuqueService, calls getRepoDocs, and returns the documents as JSON text content.
    this.server.tool(
      "get_repo_docs",
      "获取特定知识库中的所有文档列表,包括文档标题、更新时间等信息",
      {
        namespace: z.string().describe("知识库的命名空间,格式为 user/repo"),
        accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
      },
      async ({ namespace, accessToken }) => {
        try {
          Logger.log(`Fetching documents for repository: ${namespace}`);
          const yuqueService = this.createYuqueService(accessToken);
          const docs = await yuqueService.getRepoDocs(namespace);
    
          Logger.log(`Successfully fetched ${docs.length} documents`);
          return {
            content: [{ type: "text", text: JSON.stringify(docs, null, 2) }],
          };
        } catch (error) {
          Logger.error(`Error fetching docs for repo ${namespace}:`, error);
          return {
            content: [{ type: "text", text: `Error fetching docs: ${error}` }],
          };
        }
      }
    );
  • Zod input schema defining parameters for the get_repo_docs tool: required namespace (user/repo format) and optional accessToken.
    {
      namespace: z.string().describe("知识库的命名空间,格式为 user/repo"),
      accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
    },
  • YuqueService helper method that performs the actual API request to retrieve documents from a repository.
    async getRepoDocs(namespace: string, offset?: number, limit?: number, optional_properties?: string): Promise<YuqueDoc[]> {
      const params: any = {};
      if (offset !== undefined) params.offset = offset;
      if (limit !== undefined) params.limit = limit;
      if (optional_properties !== undefined) params.optional_properties = optional_properties;
      
      const response = await this.client.get(`/repos/${namespace}/docs`, { params });
      return response.data.data;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions returning '文档标题、更新时间等信息' (document titles, update times, and other information), which hints at a read-only list operation, but doesn't specify whether this is paginated, rate-limited, requires authentication (though the schema shows an optional accessToken), or what 'other information' includes. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence that front-loads the core purpose ('获取特定知识库中的所有文档列表' - get all documents in a specific knowledge base) and adds useful detail ('包括文档标题、更新时间等信息' - including document titles, update times, and other information). Every word earns its place with zero redundancy or waste.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and return data types but lacks details on authentication behavior, error handling, pagination, or sibling differentiation. Without annotations or output schema, the description should do more to compensate, but it meets the bare minimum for a read-only list tool.

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%, with both parameters ('namespace' and 'accessToken') fully described in the schema. The description adds no additional parameter semantics beyond implying the tool operates on a '特定知识库' (specific knowledge base), which aligns with the 'namespace' parameter. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't detract either.

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 verb ('获取' - get/retrieve) and resource ('特定知识库中的所有文档列表' - all documents in a specific knowledge base), making the purpose unambiguous. It distinguishes from siblings like 'get_doc' (single document) and 'get_user_docs' (user-specific documents) by specifying 'all documents in a specific knowledge base'. However, it doesn't explicitly contrast with 'get_user_repos' or 'search', which slightly limits differentiation.

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. It doesn't mention when to choose 'get_repo_docs' over 'get_user_docs' (for user-specific docs) or 'search' (for filtered queries), nor does it indicate prerequisites like authentication needs. The lack of usage context leaves the agent to infer from tool names alone.

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/HenryHaoson/Yuque-MCP-Server'

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