Skip to main content
Glama

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

Implementation Reference

  • 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, }; },
  • 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(), });
  • 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' ),
  • Mapping of the summarize_document tool name to its schema in the central toolSchemas record used by tool definitions.
    summarize_document: summarizeDocumentSchema,

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