Skip to main content
Glama
xiaolai
by xiaolai

generate_outline

Create hierarchical outlines from manuscript content to organize writing projects and track structure.

Instructions

Create hierarchical outline from content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNoPath to manuscript directory (defaults to current directory)
scopeNoFile scope pattern
depthNoOutline depth
include_word_countsNoInclude word counts

Implementation Reference

  • The core handler function that executes the generate_outline tool. It fetches project statistics using writersAid.getStats and returns a flat outline of files with optional word counts.
    private async generateOutline(args: Record<string, unknown>) {
      const scope = args.scope as string | undefined;
      const includeWordCounts = (args.include_word_counts as boolean) || false;
    
      // Get all files and generate outline
      const stats = await this.writersAid.getStats({ scope });
    
      return {
        outline: stats.files.map((f) => ({
          file: f.path,
          words: includeWordCounts ? f.words : undefined,
        })),
        totalWords: stats.totalWords,
      };
    }
  • Defines the tool schema including name, description, and inputSchema for validation in MCP.
    {
      name: "generate_outline",
      description: "Create hierarchical outline from content",
      inputSchema: {
        type: "object",
        properties: {
          project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" },
          scope: { type: "string", description: "File scope pattern" },
          depth: { type: "number", description: "Outline depth", default: 3 },
          include_word_counts: { type: "boolean", description: "Include word counts", default: false },
        },
      },
    },
  • Registers the generate_outline handler in the main tool dispatch switch statement within handleTool method.
    case "generate_outline":
      return this.generateOutline(args);
  • src/index.ts:73-75 (registration)
    Registers the list of all tools, including generate_outline, for MCP ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: writerToolDefinitions,
    }));
  • src/index.ts:87-90 (registration)
    Instantiates WriterToolHandlers and calls handleTool for tool execution in MCP CallToolRequest handler.
    const handlers = new WriterToolHandlers(writersAid);
    
    // Call the tool
    const result = await handlers.handleTool(name, args || {});

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/xiaolai/claude-writers-aid-mcp'

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