Skip to main content
Glama
huiseo
by huiseo

summarize_document

Generate AI-powered summaries of Outline wiki documents to quickly extract key information and understand content.

Instructions

Generate an AI-powered summary of a document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYes
languageNo

Implementation Reference

  • The core handler function that implements the summarize_document tool logic: checks if brain is enabled, fetches the full document content via Outline API, and generates a summary using 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 schema defining the input parameters for the summarize_document tool: documentId (required) and language (optional).
    export const summarizeDocumentSchema = z.object({
      documentId,
      language: z.string().optional(),
    });
  • Registers the tool definition for MCP, including name, description, and conversion of Zod schema to JSON schema.
    createTool(
      'summarize_document',
      'Generate an AI-powered summary of a document.',
      'summarize_document'
    ),
  • Combines all handlers, including smart handlers (which contain summarize_document), into a single ToolHandlers object for use in MCP.
    export function createAllHandlers(ctx: AppContext): ToolHandlers {
      return {
        ...createSearchHandlers(ctx),
        ...createDocumentHandlers(ctx),
        ...createCollectionHandlers(ctx),
        ...createCommentHandlers(ctx),
        ...createBatchHandlers(ctx),
        ...createSmartHandlers(ctx),
      } as ToolHandlers;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'AI-powered' but doesn't explain what that entails—such as model used, summary length, tone, or potential inaccuracies. It also omits critical details like whether it's a read-only operation, if it modifies the document, rate limits, or error conditions, leaving significant gaps for an AI agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (AI-powered operation with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the summary output looks like (e.g., text length, format), error handling, or behavioral constraints. For a tool that involves AI processing, more context is needed to ensure proper usage by an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'document' but doesn't clarify what 'documentId' refers to (e.g., file path, database ID) or the purpose of the optional 'language' parameter (e.g., output language, document language). This adds minimal value beyond the bare schema, failing to address the coverage gap adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate an AI-powered summary') and resource ('of a document'), making the purpose immediately understandable. It distinguishes itself from siblings like 'get_document' (which retrieves content) or 'export_document' (which exports). However, it doesn't specify the scope or format of the summary, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'get_document' for full content, 'smart_status' for status insights, or 'find_related' for context. There's also no information about prerequisites, such as document accessibility or permissions required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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