brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
mcp-tool-docstringWrite MCP tool docstrings in the standard format so they map correctly to agent skill descriptions and body content when synced via mcp-to-skills. Use when adding or updating a system MCP tool docstring.
Independent GitHub snapshot · Automated classification · Original documentation governs
This skill guides writing Python docstrings for system MCP tools (@mcp.tool()) in the format that the mcp-to-skills sync pipeline recognizes. When synced, the first line becomes the skill description field and the remaining content is placed at the top of the skill body.
@mcp.tool() function to a system MCP serverAs an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Follow this structure exactly:
@mcp.tool()
def tool_name(param1: str, param2: int = 10) -> str:
"""One-line tool description under 1024 characters with no line breaks.
Use this tool when you need to <describe the primary use case>.
Best for <specific scenarios or input patterns>.
Args:
param1: Description of param1. Constraints or format notes.
param2: Description of param2. Must be between X and Y.
Returns:
Description of what is returned. Include key fields if returning a dict or list.
- field_name: what it contains
Do not use this tool:
- to <alternative action that has a better tool>
- when <condition where another tool is preferred>
Notes:
- Any important behavioral details, ordering, edge cases.
- If no matches found, returns an empty list.
"""
The first line of the docstring (immediately after the opening """) must:
This line becomes the description: field in the generated SKILL.md frontmatter.
After a blank line following the first line, include these sections as applicable:
| Section | Required | Purpose |
|---|---|---|
| Use this tool when | Recommended | Describes when to invoke this tool |
| Args | Required if params exist | One entry per parameter with type hints |
| Returns | Required | Describes the return value and structure |
| Do not use this tool | Recommended | Lists cases where another tool is better |
| Notes | Optional | Edge cases, ordering, limits, caveats |
The remaining content (everything after the first line) is placed at the top of the skill body in the generated SKILL.md, before the ## Usage section.
The mcp-to-skills sync pipeline (core/engine/mcp_servers/mcp_to_skills/sync.py) processes system tool docstrings as follows:
description:)## Usage## Arguments SchemaNon-system MCP tools are unaffected — they use build_short_description on the full description as before.
After updating the tool docstring, restart or reload the engine and re-sync:
core/bin/tool-cli engine-reload
Or run the sync script directly:
core/bin/tool-cli mcp-sync <server-id>
Verify the generated SKILL.md in core/skills/system/ has the correct description and body.
\n in the first docstring lineIssue: First line is blank (docstring starts with a newline)
""" or on the first non-blank line. After normalize_description, the first non-blank line is used.Issue: Description too long
Issue: Sync still shows old description
Issue: Skill body is empty (no extra content)