restore_document
Recover deleted documents from the Outline wiki trash to restore access and content.
Instructions
Restore a document from trash.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes |
Implementation Reference
- src/lib/handlers/documents.ts:137-143 (handler)The main handler function for the 'restore_document' tool. It performs an access check and calls the Outline API to restore the document from trash by ID, returning formatted result.async restore_document(args: RestoreDocumentInput) { checkAccess(config, 'restore_document'); const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.restore', { id: args.documentId }) ); return docResult(data, MESSAGES.DOCUMENT_RESTORED); },
- src/lib/schemas.ts:67-67 (schema)Zod schema defining the input for restore_document: requires a documentId string.export const restoreDocumentSchema = z.object({ documentId });
- src/lib/tools.ts:107-111 (registration)Registration of the 'restore_document' tool definition, including name, description, and reference to its Zod schema for MCP tool list.createTool( 'restore_document', 'Restore a document from trash.', 'restore_document' ),
- src/lib/handlers/index.ts:19-27 (registration)Handler registration where document handlers (including restore_document) are spread into the complete ToolHandlers object for the MCP server.export function createAllHandlers(ctx: AppContext): ToolHandlers { return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers;