Skip to main content
Glama

init

Initialize PolyPlan in your project by creating the required .plans and .polyplan directories for structured multi-model AI planning sessions.

Instructions

Initialize PolyPlan in this project — creates .plans/ and .polyplan/ directories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.ts:35-53 (registration)
    Registration of the 'init' MCP tool on the server via server.tool() with name 'init', description, and an inline async handler.
    // ─── init ─────────────────────────────────────────────────────────
    server.tool(
      "init",
      "Initialize PolyPlan in this project — creates .plans/ and .polyplan/ directories",
      {},
      async () => {
        const alreadyInit = await isInitialized(projectRoot);
        if (alreadyInit) {
          return { content: [{ type: "text", text: "PolyPlan is already initialized in this project." }] };
        }
        const config = await initProject(projectRoot);
        return {
          content: [{
            type: "text",
            text: `✅ PolyPlan initialized!\n📁 Project: ${config.projectName}\n📂 Created .plans/ and .polyplan/\n🕐 Session started: ${config.createdAt}`,
          }],
        };
      }
    );
  • Core implementation of initProject(): creates .plans/ and .polyplan/ directories, writes config.json, and updates .gitignore.
    export async function initProject(projectRoot: string): Promise<PolyPlanConfig> {
      // Create directories
      const plansPath = path.join(projectRoot, PLANS_DIR);
      await fs.mkdir(plansPath, { recursive: true });
      await ensurePolyPlanDir(projectRoot);
    
      // Create config
      const projectName = path.basename(projectRoot);
      const config: PolyPlanConfig = {
        projectName,
        createdAt: new Date().toISOString(),
      };
      await writeConfig(projectRoot, config);
    
      // Update .gitignore
      await updateGitignore(projectRoot);
    
      return config;
  • Helper isInitialized() checks whether .polyplan/config.json already exists.
    export async function isInitialized(projectRoot: string): Promise<boolean> {
      const config = await readConfig(projectRoot);
      return config !== null;
    }
  • PolyPlanConfig interface: defines the shape of the config object created by init.
    export interface PolyPlanConfig {
      /** Human-readable project name */
      projectName: string;
      /** When the session was first created */
      createdAt: string;
      /** Current active problem description (set in Round 1) */
      problemDescription?: string;
    }
  • ensurePolyPlanDir() creates the .polyplan/ directory if it doesn't exist.
    export async function ensurePolyPlanDir(projectRoot: string): Promise<string> {
      const polyplanPath = path.join(projectRoot, POLYPLAN_DIR);
      await fs.mkdir(polyplanPath, { recursive: true });
      return polyplanPath;
    }
Behavior3/5

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

No annotations are provided, so the description must fully disclose behavior. It states it creates directories, which is sufficient for a simple tool, but does not mention idempotency, overwriting behavior, or side effects beyond directory creation.

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 conveys the essential information without any wasted words.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema), the description fully covers what the agent needs to know: the tool initializes the project by creating specific directories.

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

Parameters4/5

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

The input schema has zero parameters, so schema coverage is 100%. The description does not need to add parameter information. Baseline for 0 parameters is 4.

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

Purpose5/5

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

The description clearly states the action ('Initialize PolyPlan') and the resources created ('.plans/' and '.polyplan/' directories), using a specific verb and resource. It distinguishes itself from sibling tools, none of which perform initialization.

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

Usage Guidelines3/5

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

The description implies the tool should be used first to set up the project, but does not explicitly state when to use it vs alternatives or any prerequisites. Since no sibling tool serves the same purpose, the guidance is adequate but not explicit.

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/IMAFDI/polyplan-mcp'

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