Skip to main content
Glama
huiseo

Outline Wiki MCP Server

by huiseo

suggest_tags

Generate AI-suggested tags for Outline wiki documents to improve organization and searchability based on content analysis.

Instructions

Get AI-suggested tags for a document based on its content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYes

Implementation Reference

  • MCP tool handler for suggest_tags: fetches document content via Outline API, calls brain.suggestTags, returns suggested tags.
    async suggest_tags(args: { documentId: 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_ANALYZE };
      }
    
      const tags = await brain.suggestTags(data.text);
    
      return {
        documentId: data.id,
        title: data.title,
        suggestedTags: tags,
      };
    },
  • Zod input schema for suggest_tags tool: requires documentId.
    export const suggestTagsSchema = z.object({
      documentId,
    });
  • Registers the suggest_tags tool in allTools array using schema from schemas.ts and description.
    'suggest_tags',
    'Get AI-suggested tags for a document based on its content.',
    'suggest_tags'
  • Core LLM implementation: prompts OpenAI to suggest 3-5 tags from document text, parses comma-separated output.
      async suggestTags(text: string): Promise<string[]> {
        const prompt = `Analyze the following document and suggest 3-5 relevant tags.
    Output ONLY comma-separated tags without explanation.
    Example: Marketing, Q1 Report, Strategy`;
    
        const result = await this.complete(prompt, text.substring(0, LLM.MAX_TAG_ANALYSIS_CHARS));
    
        return result
          .split(',')
          .map((tag) => tag.trim())
          .filter((tag) => tag.length > 0);
      }
  • Brain facade method: delegates tag suggestion to processor after checking if enabled.
    async suggestTags(text: string): Promise<string[]> {
      this.checkEnabled();
      return this.processor.suggestTags(text);
    }

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