feat: add create_idea MCP tool for draft task creation#467
Open
simple-agent-manager[bot] wants to merge 2 commits intomainfrom
Open
feat: add create_idea MCP tool for draft task creation#467simple-agent-manager[bot] wants to merge 2 commits intomainfrom
simple-agent-manager[bot] wants to merge 2 commits intomainfrom
Conversation
Adds a new `create_idea` MCP tool that lets agents capture ideas as draft tasks without spinning up a TaskRunner DO or provisioning a workspace. The idea is auto-linked to the current chat session for traceability. - Validates title/description with configurable max lengths - Inserts as 'draft' status task with parent_task_id linkage - Auto-links to current chat session (best-effort) - 7 unit tests covering validation, truncation, linking, and no-DO-spawn Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
create_ideaMCP tool that lets agents capture ideas as draft tasks without spinning up a TaskRunner DO or provisioning a workspaceMCP_IDEA_TITLE_MAX_LENGTHandMCP_IDEA_DESCRIPTION_MAX_LENGTHenv varsValidation
pnpm lintpnpm typecheckpnpm testStaging Verification (REQUIRED for all code changes — merge-blocking)
Deploy Stagingworkflow triggered manually and passed for this branch (run 23308216719)app.sammy.party(staging) using test credentials and actively tested the applicationStaging Verification Evidence
Deployed to staging and verified via Playwright:
app.sammy.party, dashboard renders with project cards{"status":"healthy"}with all bindings presentEnd-to-End Verification (Required for multi-component changes)
Data Flow Trace
create_ideaMCP tool via JSON-RPC→
apps/api/src/routes/mcp.tsroute handler dispatches tohandleCreateIdea()→
handleCreateIdea()→env.DATABASE.prepare("INSERT INTO tasks...")with status='draft'→
resolveSessionId()→projectDataService.linkSessionIdea()Untested Gaps
N/A: full flow covered by automated tests (7 unit tests in mcp.test.ts covering validation, insertion, auto-linking, and no-DO-spawn)
Post-Mortem (Required for bug fix PRs)
N/A: not a bug fix
Exceptions (If any)
Agent Preflight (Required)
Classification
External References
N/A: Internal MCP tool implementation using existing patterns — no external APIs consumed. Followed existing
dispatch_taskandlink_ideatool patterns inapps/api/src/routes/mcp.ts.Codebase Impact Analysis
apps/api/src/index.ts— Added 2 env var declarations (MCP_IDEA_TITLE_MAX_LENGTH,MCP_IDEA_DESCRIPTION_MAX_LENGTH) toEnvinterfaceapps/api/src/routes/mcp.ts— Newcreate_ideatool definition inMCP_TOOLSarray, newhandleCreateIdea()handler function, new case in tool dispatch switchapps/api/tests/unit/routes/mcp.test.ts— 7 new tests for the create_idea toolDocumentation & Specs
N/A: Backend MCP tool addition — no user-facing documentation changes needed. The tool is self-documenting via its MCP tool description visible to agents.
Constitution & Risk Check
MCP_IDEA_TITLE_MAX_LENGTH(default: 200),MCP_IDEA_DESCRIPTION_MAX_LENGTH(default: 32000)sanitizeUserInput()for XSS prevention🤖 Generated with Claude Code