Skip to main content
Glama

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

Implementation Reference

  • 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, }; },
  • Zod input schema definition for the tool, validating required 'documentId' and optional 'language' parameters.
    export const summarizeDocumentSchema = z.object({ documentId, language: z.string().optional(), });
  • 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' ),

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-smart-mcp'

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