Skip to main content
Glama

add_initiative

Saves a summarized product idea from conversations or notes into a local initiative file for scoring and spec generation.

Instructions

Write a new markdown_local initiative into PLAN_PROJECT_ROOT/initiatives/.md. Use this to capture an idea you (the AI client) already gathered via WebFetch / chat summary / customer-call notes — plan-master deliberately does NOT crawl URLs; you summarize, this tool persists. Only works when PLAN_SOURCE=markdown_local; for Linear / JIRA / Notion, create the issue in that platform instead. If id is omitted, auto-generates IDEA-NNN. Returns {id, written_to, source, overwritten, next_step_hint}. Typical chain: add_initiative -> score_initiative -> generate_spec_draft -> mk-spec-master.parse_spec.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
bodyNo
idNo
statusNotriage
labelsNo
reachNo
impactNo
confidenceNo
effortNo
okrNo
out_of_scopeNo
source_urlNo
overwriteNo

Implementation Reference

  • The main handler function for the add_initiative tool. It validates that the active source is 'markdown_local', requires a 'title', auto-generates or accepts an ID, builds YAML frontmatter from optional fields (labels, reach, impact, confidence, effort, okr, out_of_scope, source_url), and writes a .md file to PLAN_PROJECT_ROOT/initiatives/. Supports overwrite. Returns {id, written_to, source, overwritten, next_step_hint}.
    def add_initiative_tool(arguments: dict) -> dict[str, Any]:
        if SOURCE_NAME != "markdown_local":
            return _error(
                f"add_initiative only supports markdown_local (active: {SOURCE_NAME})",
                retryable=False,
                hint=(
                    "For linear / jira / notion, create the issue in that platform's "
                    "UI (or its own MCP), then list_initiatives picks it up. "
                    "add_initiative is for capturing chat / web-research ideas locally."
                ),
            )
    
        title = arguments.get("title")
        if not title:
            return _error(
                "title is required",
                retryable=False,
                hint="Pass a short human-readable title. Body + scoring inputs are optional.",
            )
    
        body = (arguments.get("body") or "").rstrip()
        initiative_id = str(arguments.get("id") or _next_auto_id())
        overwrite = bool(arguments.get("overwrite", False))
    
        _cfg.INITIATIVES_DIR.mkdir(parents=True, exist_ok=True)
        target = _cfg.INITIATIVES_DIR / f"{initiative_id}.md"
        already_existed = target.exists()
        if already_existed and not overwrite:
            return _error(
                f"initiative_id={initiative_id!r} already exists at {target}",
                retryable=False,
                hint="Pass overwrite=true to replace, or choose a different id.",
            )
    
        frontmatter: dict[str, Any] = {
            "id": initiative_id,
            "title": title,
            "status": arguments.get("status") or "triage",
            "created_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
        }
        for key in (
            "labels",
            "reach",
            "impact",
            "confidence",
            "effort",
            "okr",
            "out_of_scope",
            "source_url",
        ):
            if arguments.get(key) is not None:
                frontmatter[key] = arguments[key]
    
        ordered_keys = [
            "id",
            "title",
            "status",
            "labels",
            "reach",
            "impact",
            "confidence",
            "effort",
            "okr",
            "out_of_scope",
            "source_url",
            "created_at",
        ]
        lines = ["---"]
        for key in ordered_keys:
            if key in frontmatter:
                lines.append(f"{key}: {_format_frontmatter_value(frontmatter[key])}")
        lines.append("---")
        lines.append("")
        lines.append(body)
        lines.append("")
        target.write_text("\n".join(lines), encoding="utf-8")
    
        return {
            "id": initiative_id,
            "written_to": str(target),
            "source": SOURCE_NAME,
            "overwritten": already_existed and overwrite,
            "next_step_hint": (
                f"Run score_initiative(initiative_id='{initiative_id}') or "
                f"list_initiatives to confirm pickup."
            ),
        }
  • Schema (inputSchema) and tool description registered for the 'add_initiative' MCP tool. Defines all accepted properties: title (required), body, id, status, labels, reach, impact, confidence, effort, okr, out_of_scope, source_url, overwrite.
    Tool(
        name="add_initiative",
        description=(
            "Write a new markdown_local initiative into "
            "PLAN_PROJECT_ROOT/initiatives/<id>.md. Use this to capture an "
            "idea you (the AI client) already gathered via WebFetch / chat "
            "summary / customer-call notes — plan-master deliberately does "
            "NOT crawl URLs; you summarize, this tool persists. Only works "
            "when PLAN_SOURCE=markdown_local; for Linear / JIRA / Notion, "
            "create the issue in that platform instead. If id is omitted, "
            "auto-generates IDEA-NNN. Returns {id, written_to, source, "
            "overwritten, next_step_hint}. Typical chain: add_initiative "
            "-> score_initiative -> generate_spec_draft -> "
            "mk-spec-master.parse_spec."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "title": {"type": "string"},
                "body": {"type": "string"},
                "id": {"type": "string"},
                "status": {"type": "string", "default": "triage"},
                "labels": {"type": "array", "items": {"type": "string"}},
                "reach": {"type": "number"},
                "impact": {"type": "number"},
                "confidence": {"type": "number"},
                "effort": {"type": "number"},
                "okr": {"type": "string"},
                "out_of_scope": {"type": "array", "items": {"type": "string"}},
                "source_url": {"type": "string"},
                "overwrite": {"type": "boolean", "default": False},
            },
            "required": ["title"],
        },
  • Registration of add_initiative in the _DISPATCH dictionary, mapping the string 'add_initiative' to the handler function initiatives_tools.add_initiative_tool.
    _DISPATCH: dict[str, Callable[[dict], dict]] = {
        "get_plan_source_info": initiatives_tools.get_plan_source_info_tool,
        "list_initiatives": initiatives_tools.list_initiatives_tool,
        "fetch_initiative": initiatives_tools.fetch_initiative_tool,
        "add_initiative": initiatives_tools.add_initiative_tool,
  • Helper function _next_auto_id() which scans existing IDEA-NNN.md files in the initiatives directory to compute the next available ID (e.g., IDEA-001, IDEA-002).
    def _next_auto_id() -> str:
        if not _cfg.INITIATIVES_DIR.exists():
            return "IDEA-001"
        max_n = 0
        for path in _cfg.INITIATIVES_DIR.glob("IDEA-*.md"):
            m = _AUTO_ID_PATTERN.match(path.name)
            if m:
                max_n = max(max_n, int(m.group(1)))
        return f"IDEA-{max_n + 1:03d}"
  • Helper function _format_frontmatter_value() which formats values for YAML frontmatter: lists as inline arrays, booleans as true/false, scalars as strings.
    def _format_frontmatter_value(value: Any) -> str:
        """Inline-list + scalar formatter compatible with markdown_local._coerce."""
        if isinstance(value, list):
            if not value:
                return "[]"
            return "[" + ", ".join(str(x) for x in value) + "]"
        if isinstance(value, bool):
            return "true" if value else "false"
        return str(value)
Behavior4/5

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

Discloses writing location, ID auto-generation, return fields, and overwrite capability (though overwrite behavior could be more explicit). Without annotations, this is good but not exhaustive; e.g., no mention of idempotency or what happens on duplicate ID.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph that front-loads the core action, then adds context, restrictions, return, and chain. It is efficient with no fluff, though it could use bullet points for better readability.

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

Completeness3/5

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

Given 13 parameters and no output schema, the description covers the high-level workflow and constraints well but lacks detail on many parameters (score fields, labels, okr, etc.). The return object is mentioned but not fully specified. The typical chain provides some context for downstream use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description should compensate. However, it only explains the 'id' parameter's auto-generation and mentions 'overwrite' in return. Most parameters (reach, impact, confidence, etc.) are not explained, leaving the agent to guess their meaning from names.

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 tool writes a new markdown_local initiative to a specific file path. It distinguishes itself from siblings by specifying the use case (capturing already-gathered ideas) and the source type (markdown_local only). The verb 'write' and resource 'initiative' are explicit.

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

Usage Guidelines5/5

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

Provides explicit when-to-use: 'capture an idea you already gathered via WebFetch / chat summary / customer-call notes'. Also includes when-not-to-use: 'plan-master deliberately does NOT crawl URLs; you summarize, this tool persists.' Offers alternatives: for other platforms, create the issue there. Additionally, provides a typical chain of tool usage.

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/kao273183/mk-plan-master'

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