Skip to main content
Glama

save_plan

Store implementation plans for software development projects to maintain organized documentation and track progress.

Instructions

Save the current implementation plan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planYesThe implementation plan text to save

Implementation Reference

  • The handler function for the 'save_plan' tool. It checks for an active goal, parses the provided plan into todos using formatPlanAsTodos, adds each todo to storage, and returns a success message with the number of todos saved.
    case 'save_plan': {
      if (!this.currentGoal) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          'No active goal. Start a new planning session first.'
        );
      }
    
      const { plan } = request.params.arguments as { plan: string };
      const todos = formatPlanAsTodos(plan);
    
      for (const todo of todos) {
        await storage.addTodo(this.currentGoal.id, todo);
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `Successfully saved ${todos.length} todo items to the implementation plan.`,
          },
        ],
      };
    }
  • The input schema definition for the 'save_plan' tool, specifying a required 'plan' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        plan: {
          type: 'string',
          description: 'The implementation plan text to save',
        },
      },
      required: ['plan'],
    },
  • src/index.ts:127-140 (registration)
    The registration of the 'save_plan' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: 'save_plan',
      description: 'Save the current implementation plan',
      inputSchema: {
        type: 'object',
        properties: {
          plan: {
            type: 'string',
            description: 'The implementation plan text to save',
          },
        },
        required: ['plan'],
      },
    },
  • Helper function used in save_plan to parse the plan text into structured todo objects by splitting sections, extracting title, complexity, code examples, and description.
    export const formatPlanAsTodos = (plan: string): Array<{
      title: string;
      description: string;
      complexity: number;
      codeExample?: string;
    }> => {
      // This is a placeholder implementation
      // In a real system, this would use more sophisticated parsing
      // to extract todos from the plan text
      const todos = plan.split('\n\n')
        .filter(section => section.trim().length > 0)
        .map(section => {
          const lines = section.split('\n');
          const title = lines[0].replace(/^[0-9]+\.\s*/, '').trim();
          const complexity = parseInt(section.match(/Complexity:\s*([0-9]+)/)?.[1] || '5');
          const codeExample = section.match(/\`\`\`[^\`]*\`\`\`/)?.[0];
          const description = section
            .replace(/^[0-9]+\.\s*[^\n]*\n/, '')
            .replace(/Complexity:\s*[0-9]+/, '')
            .replace(/\`\`\`[^\`]*\`\`\`/, '')
            .trim();
    
          return {
            title,
            description,
            complexity,
            codeExample: codeExample?.replace(/^\`\`\`|\`\`\`$/g, ''),
          };
        });
    
      return todos;
    };
  • Storage helper function called in the save_plan loop to add each parsed todo to the persistent plan storage for the current goal.
    async addTodo(
      goalId: string,
      { title, description, complexity, codeExample }: Omit<Todo, 'id' | 'isComplete' | 'createdAt' | 'updatedAt'>
    ): Promise<Todo> {
      const plan = await this.getPlan(goalId);
      if (!plan) {
        throw new Error(`No plan found for goal ${goalId}`);
      }
    
      const todo: Todo = {
        id: Date.now().toString(),
        title,
        description,
        complexity,
        codeExample,
        isComplete: false,
        createdAt: new Date().toISOString(),
        updatedAt: new Date().toISOString(),
      };
    
      plan.todos.push(todo);
      plan.updatedAt = new Date().toISOString();
      await this.save();
      return todo;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only says 'save' without indicating whether it overwrites an existing plan, persists to storage, requires an active planning session, or returns any confirmation. This omission leaves significant ambiguity for a write operation.

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, front-loaded sentence that efficiently communicates the core action. No filler words or redundant information are present.

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?

The tool is simple, but the description omits important context such as prerequisites, side effects, and how it fits into the overall planning workflow. Given the lack of annotations and output schema, the description alone is insufficient for an agent to fully understand usage.

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

Parameters3/5

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

Schema coverage is 100% for the single 'plan' parameter, which already explains 'The implementation plan text to save'. The description adds no additional meaning beyond the schema, so the baseline of 3 is appropriate.

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 ('Save') and the resource ('current implementation plan'), which distinguishes it from siblings like get_plan (retrieve) and add_todo. However, 'current' is somewhat ambiguous and does not explicitly clarify the scope relative to other planning tools.

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, such as after start_planning or for saving a draft versus a finalized plan. No context or exclusions are given.

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