Skip to main content
Glama

yuque_search_docs

Search documents in Yuque knowledge bases using keywords to find relevant information across repositories or within specific ones.

Instructions

搜索文档 (Search documents)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes搜索关键词 (Search keywords)
repoIdNo知识库ID,可选,不提供则全局搜索 (Repository ID, optional, global search if not provided)

Implementation Reference

  • The main handler function for the 'yuque_search_docs' MCP tool. It receives arguments, calls YuqueClient.searchDocs, and returns the results formatted as MCP content (JSON string).
    async function handleSearchDocs(
      client: YuqueClient,
      args: { query: string; repoId?: number }
    ) {
      const docs = await client.searchDocs(args.query, args.repoId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(docs, null, 2),
          },
        ],
      };
  • The tool definition including name, description, and input schema validation for 'yuque_search_docs'.
    {
      name: 'yuque_search_docs',
      description: '搜索文档 (Search documents)',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: '搜索关键词 (Search keywords)',
            minLength: 1,
            maxLength: 100,
          },
          repoId: {
            type: 'number',
            description: '知识库ID,可选,不提供则全局搜索 (Repository ID, optional, global search if not provided)',
          },
        },
        required: ['query'],
      },
    },
  • The core helper method in YuqueClient that performs the actual API search request to Yuque's /search endpoint with query parameters.
    /**
     * Search documents
     */
    async searchDocs(query: string, repoId?: number): Promise<YuqueDoc[]> {
      const params = new URLSearchParams({
        q: query,
        type: 'doc', // Required parameter
      });
      if (repoId) params.append('repo_id', repoId.toString());
    
      return this.request<YuqueDoc[]>(`/search?${params.toString()}`);
    }
  • The dispatch case in the main handleTool switch statement that registers and routes 'yuque_search_docs' calls to the specific handler function.
    case 'yuque_search_docs':
      return await handleSearchDocs(
        client,
        args as { query: string; repoId?: number }
      );
  • src/server.ts:46-50 (registration)
    Registration of the tool list handler, which returns YUQUE_TOOLS array including the schema for 'yuque_search_docs'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: YUQUE_TOOLS,
      };
    });
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 only states the action ('search') without details on permissions, rate limits, pagination, or what the search results include (e.g., titles, snippets, metadata). This is inadequate for a search tool with zero annotation coverage.

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 extremely concise ('搜索文档 (Search documents)'), which is efficient and front-loaded. However, it's arguably too brief, bordering on under-specification, as it omits necessary context for effective use.

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?

Given the complexity of a search operation, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of documents, search relevance scores) or behavioral aspects like error handling, making it insufficient for an agent to use effectively.

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 description coverage is 100%, so the schema fully documents both parameters (query and repoId). The description adds no additional meaning beyond what's in the schema, such as search syntax or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description '搜索文档 (Search documents)' states the basic action (search) and resource (documents), but it's vague about scope and doesn't differentiate from sibling tools like 'yuque_get_docs' or 'yuque_get_doc'. It lacks specificity about what kind of search this performs (full-text, metadata, etc.).

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 is provided on when to use this tool versus alternatives. The description doesn't mention siblings like 'yuque_get_docs' (which might list documents without search) or 'yuque_get_doc' (which retrieves a specific document), leaving the agent to guess based on 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/tanis2010/yuque-mcp-server'

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