summarize_document
Generate AI-powered summaries of Outline wiki documents to quickly understand content without reading entire files.
Instructions
Generate an AI-powered summary of a document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | ||
| language | No |
Implementation Reference
- src/lib/handlers/smart.ts:107-128 (handler)The main execution handler for the 'summarize_document' tool. Fetches the full document content via Outline API, checks for content, and delegates summarization to the brain module.async summarize_document(args: { documentId: string; language?: string }) { if (!brain.isEnabled()) { return { error: ERROR_MESSAGES.SMART_FEATURES_DISABLED }; } // Fetch document const { data } = await apiCall(() => apiClient.post<OutlineDocument>('/documents.info', { id: args.documentId }) ); if (!data.text) { return { error: ERROR_MESSAGES.NO_CONTENT_TO_SUMMARIZE }; } const summary = await brain.summarize(data.text, args.language); return { documentId: data.id, title: data.title, summary, }; },
- src/lib/schemas.ts:150-153 (schema)Zod input schema definition for the tool, validating required 'documentId' and optional 'language' parameters.export const summarizeDocumentSchema = z.object({ documentId, language: z.string().optional(), });
- src/lib/tools.ts:210-214 (registration)Registration of the 'summarize_document' tool in the allTools array, converting the Zod schema to JSON Schema for MCP tool definition.createTool( 'summarize_document', 'Generate an AI-powered summary of a document.', 'summarize_document' ),