Skip to main content
Glama

yuque_get_repos

List knowledge repositories from Yuque. Optionally filter by user ID to retrieve repositories for a specific user.

Instructions

获取知识库列表 (List knowledge repositories)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNo用户ID,不提供则获取当前用户的知识库 (User ID, defaults to current user)

Implementation Reference

  • The handler function for 'yuque_get_repos' tool. It calls client.getRepos(args.userId) and returns the JSON-stringified list of repos.
    async function handleGetRepos(client: YuqueClient, args: { userId?: string }) {
      const repos = await client.getRepos(args.userId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(repos, null, 2),
          },
        ],
      };
    }
  • Tool definition/schema for 'yuque_get_repos', specifying the name, description, and input schema (optional userId string).
    {
      name: 'yuque_get_repos',
      description: '获取知识库列表 (List knowledge repositories)',
      inputSchema: {
        type: 'object',
        properties: {
          userId: {
            type: 'string',
            description: '用户ID,不提供则获取当前用户的知识库 (User ID, defaults to current user)',
          },
        },
      },
  • The case statement in the switch handler that routes 'yuque_get_repos' calls to handleGetRepos().
    switch (name) {
      case 'yuque_get_user':
        return await handleGetUser(client);
    
      case 'yuque_get_repos':
        return await handleGetRepos(client, args as { userId?: string });
    
      case 'yuque_get_docs':
        return await handleGetDocs(
          client,
          args as { repoId: number; limit?: number; offset?: number }
        );
    
      case 'yuque_get_doc':
        return await handleGetDoc(
          client,
          args as { docId: number; repoId: number }
        );
  • src/server.ts:46-50 (registration)
    Tool registration via ListToolsRequestSchema returning YUQUE_TOOLS array, which includes 'yuque_get_repos'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: YUQUE_TOOLS,
      };
    });
  • The YuqueClient.getRepos() method that fetches repos from the Yuque API via GET /users/{userId}/repos. If no userId is provided, it first fetches the current user.
    async getRepos(userId?: string): Promise<YuqueRepo[]> {
      // Use /users/{userId}/repos as confirmed working endpoint
      if (!userId) {
        const user = await this.getUser();
        userId = user.id.toString();
      }
      return this.request<YuqueRepo[]>(`/users/${userId}/repos`);
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states 'list' without detailing return format, pagination, authentication needs, or error cases. The read-only nature is implied but not explicit.

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

Conciseness4/5

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

The description is one short sentence with a Chinese translation. It is concise and front-loaded, though it could benefit from additional context without sacrificing brevity.

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?

For a simple tool with one optional parameter and no output schema, the description adequately states the purpose. However, it lacks details about the return value (e.g., list of repo objects) and any assumptions, which limits completeness for a new user.

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?

Schema coverage is 100% with one parameter (userId) already described. The description adds no extra meaning beyond the schema's explanation. Baseline 3 is appropriate since the description does not degrade understanding.

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

Purpose5/5

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

The description clearly states the tool lists knowledge repositories (获取知识库列表). It uses a specific verb 'List' and resource 'repositories', effectively distinguishing it from siblings like yuque_create_repo (create) or yuque_get_docs (list docs).

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?

No guidance on when to use this tool vs alternatives. The description does not mention when to list repos for a specific user or default behavior, nor does it exclude any contexts. Sibling tools exist for creating repos or listing docs, but no comparisons are made.

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