search_documents
Search Outline wiki documents by keyword to find relevant information quickly, with support for pagination to browse results efficiently.
Instructions
Search documents by keyword. Supports pagination.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| collectionId | No | ||
| limit | No | ||
| offset | No |
Implementation Reference
- src/lib/handlers/search.ts:26-36 (handler)The core handler function for the 'search_documents' tool. It calls the Outline API's '/documents.search' endpoint with the provided query parameters and formats the returned search results.
async search_documents(args: SearchDocumentsInput) { const { data } = await apiCall(() => apiClient.post<SearchResult[]>('/documents.search', { query: args.query, collectionId: args.collectionId, limit: args.limit, offset: args.offset, }) ); return formatSearchResults(data || [], baseUrl); }, - src/lib/schemas.ts:21-26 (schema)Zod schema defining the input parameters for the 'search_documents' tool: query (required string), optional collectionId, limit, and offset.
export const searchDocumentsSchema = z.object({ query: z.string().min(1, 'Query is required'), collectionId: collectionId.optional(), limit: limit.default(10), offset, }); - src/lib/tools.ts:36-40 (registration)Registers the 'search_documents' tool in the allTools array by calling createTool with its name, description, and schema key.
createTool( 'search_documents', 'Search documents by keyword. Supports pagination.', 'search_documents' ), - src/lib/schemas.ts:213-213 (schema)Maps the tool name 'search_documents' to its Zod schema in the toolSchemas lookup object.
search_documents: searchDocumentsSchema,