summarize_document
Generate AI-powered summaries of Outline wiki documents to extract key information quickly.
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 core handler function for the 'summarize_document' tool. Fetches the full document content using the Outline API and generates a summary using the AI 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 schema defining the input parameters for the summarize_document tool: documentId (required) and optional language.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 MCP tools array, converting the Zod schema to JSON schema for the protocol.createTool( 'summarize_document', 'Generate an AI-powered summary of a document.', 'summarize_document' ),
- src/lib/schemas.ts:246-246 (schema)Mapping of the summarize_document tool name to its schema in the central toolSchemas record used by tool definitions.summarize_document: summarizeDocumentSchema,