Skip to main content
Glama
huiseo
by huiseo

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
NameRequiredDescriptionDefault
documentIdYes

Implementation Reference

  • 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);
    },
  • Zod schema defining the input for restore_document: requires a documentId string.
    export const restoreDocumentSchema = z.object({ documentId });
  • 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'
    ),
  • 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;

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/huiseo/outline-wiki-mcp'

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