yuque_search_docs
Search documents across Yuque knowledge bases using keywords to find relevant content, with optional repository filtering for targeted results.
Instructions
搜索文档 (Search documents)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 搜索关键词 (Search keywords) | |
| repoId | No | 知识库ID,可选,不提供则全局搜索 (Repository ID, optional, global search if not provided) |
Implementation Reference
- src/tools/handlers.ts:227-240 (handler)The core handler function for 'yuque_search_docs' tool. It invokes YuqueClient.searchDocs with the provided query and optional repoId, then returns the results as a JSON-formatted text content block.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), }, ], }; }
- src/tools/definitions.ts:157-176 (schema)Input schema definition and metadata for the 'yuque_search_docs' tool, including parameters query (required string) and optional repoId (number).{ 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'], }, },
- src/tools/handlers.ts:71-75 (registration)Dispatches calls to 'yuque_search_docs' tool to the corresponding handler function within the main tool dispatcher.case 'yuque_search_docs': return await handleSearchDocs( client, args as { query: string; repoId?: number } );