get_document_backlinks
Find documents linking 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)The main execution logic for the get_document_backlinks tool. Fetches document details from Outline API using /documents.info endpoint and formats the backlinks using formatBacklinks helper.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 defining the input for the tool: requires a documentId string.export const getDocumentBacklinksSchema = z.object({ documentId });
- src/lib/tools.ts:139-143 (registration)Registers the tool in the allTools array for MCP with name, description, and schema reference.createTool( 'get_document_backlinks', 'Find other documents linking to this document.', 'get_document_backlinks' ),
- src/lib/schemas.ts:232-232 (registration)Maps the tool name to its Zod schema in the central toolSchemas object used by tool definitions.get_document_backlinks: getDocumentBacklinksSchema,
- src/lib/handlers/index.ts:24-24 (registration)Includes the comment handlers (containing get_document_backlinks) in the combined createAllHandlers for tool handler registration....createCommentHandlers(ctx),