generate_outline
Create hierarchical outlines from manuscript content to organize writing projects and track structure.
Instructions
Create hierarchical outline from content
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "generate_outline"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| scope | No | File scope pattern | |
| depth | No | Outline depth | |
| include_word_counts | No | Include word counts |
Implementation Reference
- src/tools/WriterToolHandlers.ts:145-159 (handler)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 }, }, }, }, - src/tools/WriterToolHandlers.ts:26-27 (registration)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 || {});