get_document_backlinks
Find documents that link to a specific Outline wiki document to understand content relationships and references.
Instructions
Find other documents linking to this document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes |
Implementation Reference
- src/lib/handlers/comments.ts:69-77 (handler)Core implementation of the get_document_backlinks tool handler. Fetches document details from the Outline API and returns formatted backlinks.async get_document_backlinks(args: GetDocumentBacklinksInput) { const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.info', { id: args.documentId }) ); return { documentId: args.documentId, backlinks: formatBacklinks(data.backlinks || [], baseUrl), }; },
- src/lib/schemas.ts:68-68 (schema)Zod schema definition for the input parameters of the get_document_backlinks tool (requires 'documentId').export const getDocumentBacklinksSchema = z.object({ documentId });
- src/lib/tools.ts:139-143 (registration)Registers the get_document_backlinks tool in the allTools array, providing name, description, and schema for MCP protocol.createTool( 'get_document_backlinks', 'Find other documents linking to this document.', 'get_document_backlinks' ),
- src/lib/handlers/index.ts:20-28 (registration)Combines all handler factories, including createCommentHandlers which provides the get_document_backlinks function, into a single ToolHandlers object.return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers; }
- src/lib/schemas.ts:232-232 (schema)Associates the tool name 'get_document_backlinks' with its Zod schema in the central toolSchemas mapping.get_document_backlinks: getDocumentBacklinksSchema,