search_documents
Find documents in Outline wiki by keyword with pagination support to locate specific information across collections.
Instructions
Search documents by keyword. Supports pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| collectionId | No | ||
| limit | No | ||
| offset | No |
Implementation Reference
- src/lib/handlers/search.ts:26-36 (handler)The handler function that executes the search_documents tool logic. It calls the Outline API /documents.search endpoint with the provided query parameters and formats the results using formatSearchResults.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 structure for search_documents: required query string, optional collectionId (UUID), limit (default 10), offset (default 0).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)Tool registration in allTools array: defines the MCP tool with name, description, and references the Zod schema for JSON schema conversion.createTool( 'search_documents', 'Search documents by keyword. Supports pagination.', 'search_documents' ),
- src/lib/handlers/index.ts:21-21 (registration)Handler registration: spreads the search handlers (including search_documents) into the complete ToolHandlers object....createSearchHandlers(ctx),