{"openapi":"3.1.0","info":{"title":"Universal AI Memory MCP Server","version":"2.1.0-enterprise","description":"Enterprise Model Context Protocol Server with AES-256-GCM encrypted R2 vault, D1 hybrid vector search, and multi-agent coordination.","contact":{"name":"Arif Mahmud","email":"mail@arifmahmud.com"}},"servers":[{"url":"https://universal-ai-memory-server.mail-cde.workers.dev","description":"Active Edge Server"}],"paths":{"/mcp":{"post":{"summary":"Execute MCP JSON-RPC 2.0 Command","description":"Standard MCP endpoint supporting initialize, tools/list, tools/call, prompts/list, resources/list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"MCP JSON-RPC Response"}}}},"/sse":{"get":{"summary":"MCP Server-Sent Events (SSE) Stream","description":"Real-time streaming transport for multi-agent notifications and progress reporting.","responses":{"200":{"description":"Text event-stream"}}}},"/api/tools/sample_echo":{"post":{"tags":["MCP Tools"],"summary":"sample_echo","description":"Sample demonstration MCP tool that echoes inputs and reports server health.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Text message to echo back."}},"required":["message"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/sequential_thinking":{"post":{"tags":["MCP Tools"],"summary":"sequential_thinking","description":"Facilitates a detailed, step-by-step, dynamic and reflective thinking process for complex problem-solving, architectural planning, debugging, and solution hypothesis verification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"thought":{"type":"string","description":"The current thinking step content"},"nextThoughtNeeded":{"type":"boolean","description":"Whether another thought step is needed"},"thoughtNumber":{"type":"number","description":"Current thought number"},"totalThoughts":{"type":"number","description":"Estimated total thoughts needed"},"isRevision":{"type":"boolean","description":"Whether this step revises previous thinking"},"revisesThought":{"type":"number","description":"Which thought number is being reconsidered"},"branchFromThought":{"type":"number","description":"Branching point thought number"},"branchId":{"type":"string","description":"Branch identifier (e.g. 'approach-A', 'hypothesis-2')"},"needsMoreThoughts":{"type":"boolean","description":"If more thoughts are needed beyond estimated total"},"resetHistory":{"type":"boolean","description":"Resets the sequential thinking session state"}},"required":["thought","nextThoughtNeeded","thoughtNumber","totalThoughts"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/create_autonomous_build_plan":{"post":{"tags":["MCP Tools"],"summary":"create_autonomous_build_plan","description":"Creates a structured, phased long-running task plan (e.g. 1-hour rapid cycle, 4-hour sprint plan, 24-hour roadmap) with milestones and verification criteria for autonomous project execution.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"goal_description":{"type":"string","description":"Clear description of the build or improvement goal"},"time_horizon":{"type":"string","enum":["1_hour","4_hours","24_hours","hourly_continuous","sprint_milestone"],"description":"Target time horizon for the plan (default: '4_hours')"},"custom_phases":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"estimated_duration_minutes":{"type":"number"},"deliverables":{"type":"array","items":{"type":"string"}},"verification_checks":{"type":"array","items":{"type":"string"}}},"required":["title","description"]},"description":"Optional custom phased steps. If omitted, standard phased sprint steps are generated."}},"required":["project_name","goal_description"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/progress_build_task_phase":{"post":{"tags":["MCP Tools"],"summary":"progress_build_task_phase","description":"Progresses a specific step in an autonomous build plan (IN_PROGRESS, VERIFIED, FAILED, SKIPPED), logging intermediate reasoning, updating progress %, and advancing to next phase.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"plan_id":{"type":"string","description":"The plan ID (e.g. 'plan_myproject_1740000000')"},"step_number":{"type":"number","description":"Step number to update (1-indexed)"},"status":{"type":"string","enum":["IN_PROGRESS","VERIFIED","FAILED","SKIPPED"],"description":"New status for this step"},"execution_notes":{"type":"string","description":"Detailed log of what was built or verified in this phase"}},"required":["project_name","plan_id","step_number","status"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/analyze_remaining_project_work":{"post":{"tags":["MCP Tools"],"summary":"analyze_remaining_project_work","description":"Analyzes project history, open checkpoints, roadmap milestones, and blockers to generate a prioritized 4-hour sprint plan and remaining work breakdown.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name to analyze"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/schedule_autonomous_build_event":{"post":{"tags":["MCP Tools"],"summary":"schedule_autonomous_build_event","description":"Schedules recurring or interval-based autonomous build and improvement events (every 1 hour, every 4 hours, daily) with auto-trigger payloads.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"cadence":{"type":"string","enum":["every_1_hour","every_4_hours","daily","on_commit","manual_trigger"],"description":"Schedule interval / cadence for the autonomous builder"},"target_action":{"type":"string","description":"Target action/goal (e.g. 'hourly_code_quality_and_build_improvement')"},"plan_id":{"type":"string","description":"Optional linked build plan ID"},"notification_channel":{"type":"string","description":"Notification target (default: 'mcp_event_bus')"}},"required":["project_name","cadence","target_action"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_autonomous_build_status":{"post":{"tags":["MCP Tools"],"summary":"get_autonomous_build_status","description":"Retrieves the status, timeline, progress %, and active phases of autonomous build plans and scheduled events for a project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"plan_id":{"type":"string","description":"Optional specific plan ID to query"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_cross_project_solution":{"post":{"tags":["MCP Tools"],"summary":"synthesize_cross_project_solution","description":"Synthesizes architecture blueprints, code patterns, and memory insights across multiple saved projects to produce a consolidated best-practice solution.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_names":{"type":"array","items":{"type":"string"},"description":"List of project names to compare and synthesize (e.g. ['48_otnarp', 'ampshop'])"},"feature_goal":{"type":"string","description":"Target feature or architectural goal to synthesize (e.g. 'Authentication & RBAC')"}},"required":["project_names","feature_goal"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/auto_heal_error_patch":{"post":{"tags":["MCP Tools"],"summary":"auto_heal_error_patch","description":"Analyzes error signatures and logs, queries the cross-project error solutions knowledgebase, and generates an automated self-healing fix patch.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"error_message":{"type":"string","description":"The runtime or compilation error stack trace / message"},"code_context":{"type":"string","description":"Optional surrounding code block where the error occurred"}},"required":["project_name","error_message"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/run_ai_agent_benchmark":{"post":{"tags":["MCP Tools"],"summary":"run_ai_agent_benchmark","description":"Runs automated synthetic AI regression tests, benchmarks memory retrieval latency, compression ratios, and security compliance scores.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name to benchmark"},"iterations":{"type":"number","description":"Number of synthetic test iterations (default: 5)"},"check_security":{"type":"boolean","description":"Whether to run cryptographic timing attack checks"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/sync_project_snapshots_d1":{"post":{"tags":["MCP Tools"],"summary":"sync_project_snapshots_d1","description":"Synchronizes R2 memory snapshots into Cloudflare D1 relational database for indexed sub-millisecond queries.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"max_snapshots":{"type":"number","description":"Maximum number of snapshots to sync"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/rollback_build_task_phase":{"post":{"tags":["MCP Tools"],"summary":"rollback_build_task_phase","description":"Reverts a failed or corrupted build phase step to the previous stable checkpoint with state recovery.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"plan_id":{"type":"string","description":"Active plan ID"},"step_number":{"type":"number","description":"Step number to revert (1-indexed)"},"reason":{"type":"string","description":"Reason for rollback"}},"required":["project_name","plan_id","step_number"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/run_deep_cognitive_analysis":{"post":{"tags":["MCP Tools"],"summary":"run_deep_cognitive_analysis","description":"Performs 200-IQ superhuman cognitive reasoning, pre-mortem failure simulation, counterfactual scenarios, and mathematical trade-off analysis before executing complex architecture decisions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"architecture_context":{"type":"string","description":"Current system architecture or code context"},"proposed_action":{"type":"string","description":"The proposed engineering or architectural change to analyze"}},"required":["project_name","architecture_context","proposed_action"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/orchestrate_agent_swarm":{"post":{"tags":["MCP Tools"],"summary":"orchestrate_agent_swarm","description":"Dispatches a specialized 4-agent cognitive swarm (Architect, Security Auditor, DevOps Engineer, Code Reviewer) to parallelly analyze, audit, and synthesize production-grade engineering plans.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"goal":{"type":"string","description":"Engineering goal or feature milestone for the swarm"}},"required":["project_name","goal"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/apply_ast_semantic_patch":{"post":{"tags":["MCP Tools"],"summary":"apply_ast_semantic_patch","description":"Generates and validates AST-level semantic code patches, vulnerability mitigations, and clean type guards with zero runtime regression guarantees.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"target_file":{"type":"string","description":"Target file path or identifier"},"patch_intent":{"type":"string","description":"Purpose of the AST transformation"},"code_diff":{"type":"string","description":"AST-safe semantic code replacement"}},"required":["project_name","target_file","patch_intent","code_diff"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/predictive_devops_optimizer":{"post":{"tags":["MCP Tools"],"summary":"predictive_devops_optimizer","description":"Predictively optimizes Cloudflare Worker microsecond execution, D1 query indices, R2 storage egress, and caching hierarchies for maximum performance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"target_metrics":{"type":"object","properties":{"target_latency_ms":{"type":"number"},"target_egress_budget_pct":{"type":"number"}}}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_autonomous_microservice":{"post":{"tags":["MCP Tools"],"summary":"synthesize_autonomous_microservice","description":"Synthesizes an entire production-grade full-stack microservice (API endpoints, D1 SQL schema, unit test suite, and container manifests) from natural language.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"service_name":{"type":"string","description":"Name of the microservice to generate"},"service_description":{"type":"string","description":"Detailed functionality and requirements of the service"}},"required":["project_name","service_name","service_description"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/conduct_autonomous_chaos_drill":{"post":{"tags":["MCP Tools"],"summary":"conduct_autonomous_chaos_drill","description":"Performs automated chaos engineering resilience testing, simulating latency spikes, D1 starvation, cipher corruption, and auth floods to guarantee zero-data-loss self-healing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"simulate_heavy_load":{"type":"boolean","description":"Whether to simulate 50k req/min traffic load"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_living_architecture_diagram":{"post":{"tags":["MCP Tools"],"summary":"generate_living_architecture_diagram","description":"Generates interactive, live-updating Mermaid diagrams and Cytoscape network topologies of all connected databases, workers, storages, and AI models.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/distill_multi_turn_reasoning_graph":{"post":{"tags":["MCP Tools"],"summary":"distill_multi_turn_reasoning_graph","description":"Compresses multi-hour complex AI reasoning history into an optimal Directed Acyclic Graph (DAG) with zero context loss for instant cross-session resumption.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"session_milestones":{"type":"array","items":{"type":"string"},"description":"List of completed task milestones or decisions in this session"}},"required":["project_name","session_milestones"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_autonomous_api_gateway":{"post":{"tags":["MCP Tools"],"summary":"synthesize_autonomous_api_gateway","description":"Synthesizes a production-grade Zero-Trust API Gateway with CORS policies, distributed rate limiting, and RBAC endpoint routing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"gateway_name":{"type":"string","description":"Name of the API gateway"},"upstream_endpoints":{"type":"array","items":{"type":"string"},"description":"List of upstream paths to protect"}},"required":["project_name","gateway_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/run_automated_security_pentest":{"post":{"tags":["MCP Tools"],"summary":"run_automated_security_pentest","description":"Conducts automated penetration testing drills simulating SQL injection, XSS, JWT forgery, timing attacks, and DoS floods to verify SOC2/ISO27001 compliance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/distill_semantic_codebase_digest":{"post":{"tags":["MCP Tools"],"summary":"distill_semantic_codebase_digest","description":"Distills the entire project codebase into a high-density Markdown architecture digest for instant sub-second AI onboarding.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"summary":{"type":"string"}},"required":["path","summary"]},"description":"List of files and their architectural summaries"}},"required":["project_name","files"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_memory":{"post":{"tags":["MCP Tools"],"summary":"save_memory","description":"Saves context, build commands, architecture notes, or chat insights into Cloudflare R2 for a specific project. Enforces structured categorization, strict 3-tier tagging hierarchy, and automated privacy classification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain scope partition ('office' for Interstoff/work, 'personal' for personal projects, 'others' for utilities)."},"project_name":{"type":"string","description":"Name of the target project (e.g. '48_otnarp', 'ampshop', 'arifmahmud.com')."},"key":{"type":"string","description":"Identifier for the memory (e.g. 'architecture', 'auth_flow', 'user_preference')."},"content":{"type":"string","description":"Markdown or text content to remember."},"tags":{"type":"array","items":{"type":"string"},"description":"Optional list of tags for categorizing and searching."},"category":{"type":"string","enum":["chat_history","architecture","decision","credential","context","error","user_preference","general"],"description":"Logical category of the memory for fast indexed retrieval."},"privacy_level":{"type":"string","enum":["public","internal","confidential","restricted"],"description":"Privacy classification. 'confidential' and 'restricted' trigger automated secret shielding and DLP protection."},"importance":{"type":"string","enum":["low","medium","high","critical"],"description":"Importance weight for retention and priority ranking."},"session_id":{"type":"string","description":"Optional session ID to link this memory to a specific conversation or build sprint."},"is_permanent":{"type":"boolean","description":"If true, saves permanently and protects this record from deletion/cleanup."},"auto_tag":{"type":"boolean","description":"If true, automatically formats strict hierarchical tags: [project] -> [category] -> [context]."}},"required":["project_name","key","content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_memory":{"post":{"tags":["MCP Tools"],"summary":"get_memory","description":"Retrieves specific project memory from Cloudflare R2 by project_name and key. Automatically applies AI Security & Privacy shielding and domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain scope filter ('office', 'personal', 'others')."},"project_name":{"type":"string","description":"Name of the project."},"key":{"type":"string","description":"Identifier of the memory to fetch."},"agent_id":{"type":"string","description":"Optional AI agent ID for RBAC privacy role resolution."}},"required":["project_name","key"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_memory":{"post":{"tags":["MCP Tools"],"summary":"search_memory","description":"Searches stored project memories across content, keys, and tags with automated privacy shielding and domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain scope filter ('office', 'personal', 'others')."},"query":{"type":"string","description":"Search keyword or text query."},"project_name":{"type":"string","description":"Optional filter to restrict search to a single project."},"agent_id":{"type":"string","description":"Optional AI agent ID for RBAC privacy role resolution."}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_memory_vector":{"post":{"tags":["MCP Tools"],"summary":"search_memory_vector","description":"Performs high-speed local Cosine Vector similarity search over project memories. Automatically applies token bucket budget truncation, privacy shielding, and domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain scope filter ('office', 'personal', 'others')."},"query_text":{"type":"string","description":"Search query text or task context"},"project_name":{"type":"string","description":"Optional project scope filter"},"max_tokens":{"type":"number","description":"Maximum token budget for context payload (default 4000 tokens)"},"top_k":{"type":"number","description":"Maximum number of memory results to return (default 10)"},"agent_id":{"type":"string","description":"Optional AI agent ID for RBAC privacy role resolution."}},"required":["query_text"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_chat_memory":{"post":{"tags":["MCP Tools"],"summary":"save_chat_memory","description":"Saves rich structured conversation history, user prompts, AI responses, intent, key decisions, and action items so AI models can maintain deep multi-turn chat comprehension across sessions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office' for work/Interstoff, 'personal' for personal, 'others' for utilities)."},"project_name":{"type":"string","description":"Target project name (e.g. '48_otnarp', 'ampshop')."},"session_id":{"type":"string","description":"Conversation or task session identifier (e.g. 'chat_20261004_task_auth')."},"user_prompt":{"type":"string","description":"The user's query, message, or directive."},"ai_response":{"type":"string","description":"The AI model's summary, response, or plan provided to the user."},"turn_index":{"type":"number","description":"Optional dialogue turn number (auto-increments if omitted)."},"intent":{"type":"string","description":"Understood user intent (e.g. 'feature_implementation', 'bug_fix', 'architecture_query')."},"key_decisions":{"type":"array","items":{"type":"string"},"description":"Decisions made during this chat turn."},"action_items":{"type":"array","items":{"type":"string"},"description":"Follow-up tasks or next action items identified."},"tags":{"type":"array","items":{"type":"string"},"description":"Hierarchical tags for indexing."},"privacy_level":{"type":"string","enum":["public","internal","confidential","restricted"],"description":"Privacy classification (default 'internal')."},"importance":{"type":"string","enum":["low","medium","high","critical"],"description":"Priority of this conversation turn."}},"required":["project_name","session_id","user_prompt","ai_response"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_chat_context":{"post":{"tags":["MCP Tools"],"summary":"get_chat_context","description":"Fetches past conversation context, decisions, and action items formatted for prompt injection so the AI model understands previous chats accurately without context bloat.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"project_name":{"type":"string","description":"Target project name."},"session_id":{"type":"string","description":"Optional session filter to retrieve a specific conversation thread."},"limit_turns":{"type":"number","description":"Maximum recent chat turns to retrieve (default 10)."},"max_tokens":{"type":"number","description":"Maximum token budget for chat context (default 3000 tokens)."},"include_decisions_only":{"type":"boolean","description":"If true, extracts only key decisions and action items instead of full dialogue."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/append_memory":{"post":{"tags":["MCP Tools"],"summary":"append_memory","description":"Appends new content or log entries to an existing memory key without overwriting prior content.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name."},"key":{"type":"string","description":"Memory key to append to."},"content_to_append":{"type":"string","description":"Content/log text to append."},"tag_to_add":{"type":"string","description":"Optional new tag to attach."}},"required":["project_name","key","content_to_append"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/delete_memory":{"post":{"tags":["MCP Tools"],"summary":"delete_memory","description":"Deletes a specific memory record from Cloudflare R2 storage. Rejects deletion if record is marked PERMANENT unless force=true.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name."},"key":{"type":"string","description":"Memory key to delete."},"force":{"type":"boolean","description":"Set true to override protection for permanent memories."}},"required":["project_name","key"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/pin_memory":{"post":{"tags":["MCP Tools"],"summary":"pin_memory","description":"Pins or unpins a memory record as PERMANENT/important to protect it from deletion or automated cleanup.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name."},"key":{"type":"string","description":"Memory key to pin/unpin."},"is_permanent":{"type":"boolean","description":"Set true to lock/save permanently, false to unpin."}},"required":["project_name","key","is_permanent"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/cleanup_outdated_memories":{"post":{"tags":["MCP Tools"],"summary":"cleanup_outdated_memories","description":"Deletes outdated memories older than specified days, preserving all PERMANENT/important memories.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Optional filter by project name."},"older_than_days":{"type":"number","description":"Age threshold in days (default 30)."},"dry_run":{"type":"boolean","description":"If true, returns list of candidate records without deleting them."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/set_ai_security_policy":{"post":{"tags":["MCP Tools"],"summary":"set_ai_security_policy","description":"Configures AI model roles, automated secret/PII redaction, and outbound network DLP (Data Loss Prevention) transfer policies to prevent unauthorized data exfiltration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_role":{"type":"string","enum":["admin_agent","developer_agent","standard_ai","restricted_sandbox"],"description":"Default security role assigned to unauthenticated or general AI callers."},"privacy_shield_enabled":{"type":"boolean","description":"Enable or disable automatic secret and confidential data shielding."},"auto_redact_secrets":{"type":"boolean","description":"If true, automatically scrubs API keys, private tokens, passwords, and JWTs from memories before presenting to AI."},"auto_redact_pii":{"type":"boolean","description":"If true, masks personal phone numbers, emails, and credit card numbers."},"outbound_transfer_control":{"type":"string","enum":["allow_all","whitelist_only","block_all"],"description":"Controls whether AI models are allowed to transmit project data to external servers/webhooks."},"whitelisted_domains":{"type":"array","items":{"type":"string"},"description":"List of authorized external domains AI models can send data to (when outbound_transfer_control is 'whitelist_only')."},"bangladesh_ip_gate_enabled":{"type":"boolean","description":"When enabled, restricts all incoming MCP connections to IP addresses originating from Bangladesh (BD)."},"allowed_countries":{"type":"array","items":{"type":"string"},"description":"List of allowed country ISO codes (defaults to ['BD'])."},"allow_localhost_in_geo_gate":{"type":"boolean","description":"If true, allows localhost (127.0.0.1, ::1) and private LAN IPs even when Geo-gate is active."},"custom_allowed_ips":{"type":"array","items":{"type":"string"},"description":"Optional list of explicit external IP addresses exempted from the Geo-gate."},"agent_role_override":{"type":"object","properties":{"agent_id":{"type":"string","description":"Agent ID or Device ID to assign specific role to."},"role":{"type":"string","enum":["admin_agent","developer_agent","standard_ai","restricted_sandbox"],"description":"Security role to assign."}},"required":["agent_id","role"]}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_ai_security_policy":{"post":{"tags":["MCP Tools"],"summary":"get_ai_security_policy","description":"Retrieves the active AI model security roles, privacy shield settings, and DLP transfer rules.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/sanitize_private_content":{"post":{"tags":["MCP Tools"],"summary":"sanitize_private_content","description":"Scrubs API keys, passwords, bearer tokens, private keys, and sensitive PII from text content to prevent sensitive data from leaking into AI model prompts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Raw text or code content to sanitize."},"mask_secrets":{"type":"boolean","description":"Whether to mask API tokens, private keys, and secrets (default true)."},"mask_pii":{"type":"boolean","description":"Whether to mask emails, phone numbers, and credit cards (default true)."}},"required":["content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/validate_data_transfer":{"post":{"tags":["MCP Tools"],"summary":"validate_data_transfer","description":"DLP Pre-Flight Inspection: Validates whether an AI model is authorized to send a payload to an external destination server. Checks domain whitelist and scans for confidential data leaks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_url":{"type":"string","description":"Destination endpoint URL (e.g. 'https://api.external.com/webhook')."},"payload":{"type":"string","description":"Data payload string intended for external transmission."},"project_name":{"type":"string","description":"Source project name."},"agent_id":{"type":"string","description":"Identifier of the AI agent attempting the transfer."}},"required":["target_url","payload"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_projects":{"post":{"tags":["MCP Tools"],"summary":"list_projects","description":"Lists all distinct project names stored in Cloudflare R2 memory server with optional domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"limit":{"type":"number","description":"Optional limit of projects to return (default 50)."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_memories":{"post":{"tags":["MCP Tools"],"summary":"list_memories","description":"Lists all memory keys and records with optional project, domain, or tag filtering.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"project_name":{"type":"string","description":"Filter memories by project name."},"tag":{"type":"string","description":"Filter memories by specific tag."},"limit":{"type":"number","description":"Optional limit of memories (default 100)."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_build_commands":{"post":{"tags":["MCP Tools"],"summary":"get_build_commands","description":"Retrieves stored build, test, and deployment commands for a specified project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Name of the project."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_credential_placeholder":{"post":{"tags":["MCP Tools"],"summary":"save_credential_placeholder","description":"Saves a safe symbolic credential placeholder (e.g., API keys, auth tokens) into R2 memory.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"service_name":{"type":"string","description":"Name of the third-party service (e.g. OpenAI, Firebase)."},"env_var_name":{"type":"string","description":"Environment variable name (e.g. OPENAI_API_KEY)."}},"required":["service_name","env_var_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_project_digest":{"post":{"tags":["MCP Tools"],"summary":"get_project_digest","description":"Generates a single Markdown digest containing all architecture notes, project info, build commands, and active task checkpoints for a project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_project_info":{"post":{"tags":["MCP Tools"],"summary":"save_project_info","description":"Saves comprehensive project metadata (git repo URL, vercel/cloudflare URLs, connected systems, build commands, tech stack, key features, infrastructure details) with domain segregation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office' for work/Interstoff, 'personal' for personal, 'others' for utilities)."},"project_name":{"type":"string","description":"Target project name."},"git_repo_url":{"type":"string","description":"Git repository URL."},"vercel_url":{"type":"string","description":"Vercel deployment URL."},"cloudflare_url":{"type":"string","description":"Cloudflare Workers/Hosting URL."},"connected_systems":{"type":"array","items":{"type":"string"},"description":"Connected databases, APIs, or Cloud services."},"build_commands":{"type":"object","description":"Key-value object of build commands."},"infrastructure_details":{"type":"string","description":"Infrastructure details and server specs."},"key_features":{"type":"array","items":{"type":"string"},"description":"List of key features."},"tech_stack":{"type":"array","items":{"type":"string"},"description":"List of frameworks & technologies used."},"environment_variables":{"type":"array","items":{"type":"string"},"description":"List of required environment variables."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_project_info":{"post":{"tags":["MCP Tools"],"summary":"get_project_info","description":"Retrieves comprehensive stored project information (git repo, vercel/cloudflare URLs, connected systems, build commands, infrastructure) with domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"project_name":{"type":"string","description":"Target project name."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/inspect_local_workspace":{"post":{"tags":["MCP Tools"],"summary":"inspect_local_workspace","description":"Auto-inspects local developer workspace directories. Inspects package.json, directory structure, git config, and environment files for instant local project onboarding.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_path":{"type":"string","description":"Absolute or relative local workspace path to inspect (defaults to process.cwd())."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_task_checkpoint":{"post":{"tags":["MCP Tools"],"summary":"save_task_checkpoint","description":"Persists multi-agent task checkpoints (IN_PROGRESS, BLOCKED, COMPLETED) with domain segregation to enable stateful cross-session AI workflow execution.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office' for work/Interstoff, 'personal' for personal, 'others' for utilities)."},"project_name":{"type":"string","description":"Target project name."},"task_id":{"type":"string","description":"Unique task identifier (e.g. 'task-build-auth-flow')."},"title":{"type":"string","description":"Human-readable task title."},"status":{"type":"string","enum":["IN_PROGRESS","BLOCKED","COMPLETED"],"description":"Current task status."},"summary":{"type":"string","description":"Detailed description of task state and progress."},"completed_steps":{"type":"array","items":{"type":"string"},"description":"List of completed task milestones."},"next_steps":{"type":"array","items":{"type":"string"},"description":"List of next immediate steps."}},"required":["project_name","task_id","title","status","summary"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_task_checkpoints":{"post":{"tags":["MCP Tools"],"summary":"get_task_checkpoints","description":"Retrieves task state checkpoints for a project to resume AI work seamlessly with optional domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"project_name":{"type":"string","description":"Target project name."},"status":{"type":"string","enum":["IN_PROGRESS","BLOCKED","COMPLETED"],"description":"Optional status filter."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/log_error_solution":{"post":{"tags":["MCP Tools"],"summary":"log_error_solution","description":"Logs build or runtime errors alongside root causes and solution patches to build an AI self-healing error knowledgebase.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name."},"error_signature":{"type":"string","description":"Error message or stack trace signature."},"root_cause":{"type":"string","description":"Explanation of why the error happened."},"solution_patch":{"type":"string","description":"Code snippet or exact fix steps that resolved the issue."},"tags":{"type":"array","items":{"type":"string"},"description":"Optional tags (e.g. 'docker', 'typescript', 'auth')."}},"required":["project_name","error_signature","root_cause","solution_patch"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_error_solutions":{"post":{"tags":["MCP Tools"],"summary":"search_error_solutions","description":"Searches the self-healing error knowledgebase to instantly find past fixes for build/runtime errors.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Error keyword, command name, or exception text."},"project_name":{"type":"string","description":"Optional project filter."}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/update_project_memory":{"post":{"tags":["MCP Tools"],"summary":"update_project_memory","description":"Updates, encrypts heavy memory payload using AES-GCM to Cloudflare R2 (projects/{project_id}/latest.json), creates automated R2 snapshot, and syncs metadata to Firebase Database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","description":"Project ID to isolate memory (e.g. 'otnarp', 'ampshop'). Defaults to 'otnarp'."},"current_progress":{"type":"string","description":"Current overall status or progress description of the project."},"completed_tasks":{"type":"array","items":{"type":"string"},"description":"List of recently completed tasks or milestones."},"future_plans":{"type":"array","items":{"type":"string"},"description":"List of planned next steps or upcoming features."}},"required":["current_progress"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_project_memory":{"post":{"tags":["MCP Tools"],"summary":"get_project_memory","description":"Retrieves and decrypts latest project state from projects/{project_id}/latest.json in Cloudflare R2 bucket.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","description":"Project ID to retrieve memory for (e.g. 'otnarp'). Defaults to 'otnarp'."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_project_snapshots":{"post":{"tags":["MCP Tools"],"summary":"list_project_snapshots","description":"Lists all historical disaster recovery snapshot versions for a project stored in Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","description":"Project ID to list snapshots for (e.g. 'otnarp'). Defaults to 'otnarp'."},"limit":{"type":"number","description":"Optional limit of snapshots to return (default 50)."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_project_snapshot":{"post":{"tags":["MCP Tools"],"summary":"get_project_snapshot","description":"Retrieves and decrypts a specific historical memory snapshot version from Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_id":{"type":"string","description":"Project ID of the snapshot."},"snapshot_key":{"type":"string","description":"R2 key path of the snapshot (e.g. 'projects/otnarp/snapshots/2026-07-31T19-00-00-000Z.json')."}},"required":["snapshot_key"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_project_memory":{"post":{"tags":["MCP Tools"],"summary":"search_project_memory","description":"Queries Firebase Database & R2 metadata index and optionally retrieves the exact decrypted memory payload from Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Search keyword or text to filter project metadata summaries."},"project_id":{"type":"string","description":"Filter search by specific project ID (e.g. 'otnarp')."},"retrieve_snapshot":{"type":"boolean","description":"Set to true to fetch and decrypt the full R2 memory payload for matching projects."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/export_r2_backup":{"post":{"tags":["MCP Tools"],"summary":"export_r2_backup","description":"Exports all stored R2 data (memories, tasks, credentials, error knowledgebase, project state) into a single structured JSON backup file.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/restore_r2_backup":{"post":{"tags":["MCP Tools"],"summary":"restore_r2_backup","description":"Restores R2 data from a structured JSON backup object into Cloudflare R2 storage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"backup_data":{"type":"object","description":"The JSON backup object containing records array to restore."}},"required":["backup_data"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/sync_local_backup":{"post":{"tags":["MCP Tools"],"summary":"sync_local_backup","description":"Automates backup sync to local storage solutions (NAS directory, mounted Docker volume, or local file system path). Exports all active memories, tasks, knowledge graph nodes, and config.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination_dir":{"type":"string","description":"Target local directory or NAS path (e.g. '/mnt/nas/backups', './backups'). Defaults to process.env.LOCAL_BACKUP_PATH or './backups'."},"file_name":{"type":"string","description":"Optional custom backup file name (default 'mcp_backup_<timestamp>.json')."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_architecture_blueprint":{"post":{"tags":["MCP Tools"],"summary":"save_architecture_blueprint","description":"Saves system architecture overview, database ERDs, API routing contracts, and Mermaid diagrams into permanent R2 memory.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name (e.g. 'otnarp')"},"system_overview":{"type":"string","description":"System architecture summary and component roles"},"database_schema":{"type":"string","description":"Database table schemas, collections, or SQL DDL"},"api_endpoints":{"type":"array","items":{"type":"string"},"description":"List of API endpoints and contracts"},"tech_stack":{"type":"array","items":{"type":"string"},"description":"List of technologies, frameworks, and drivers"},"diagram_mermaid":{"type":"string","description":"Mermaid string for visual architecture diagrams"}},"required":["project_name","system_overview"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_architecture_blueprint":{"post":{"tags":["MCP Tools"],"summary":"get_architecture_blueprint","description":"Fetches and decrypts the master architecture blueprint, ERD schema, and Mermaid diagrams for a project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_code_snippet":{"post":{"tags":["MCP Tools"],"summary":"save_code_snippet","description":"Saves a reusable code snippet, utility module, or configuration template into R2 memory across projects.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"snippet_name":{"type":"string","description":"Identifier name (e.g. 'aes_gcm_encrypt_ts', 'hono_jwt_auth')"},"language":{"type":"string","description":"Programming language (e.g. 'typescript', 'python', 'json')"},"code_content":{"type":"string","description":"Code snippet source text"},"description":{"type":"string","description":"Brief description of what this snippet accomplishes"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for searching"},"project_name":{"type":"string","description":"Optional project association"}},"required":["snippet_name","language","code_content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_code_snippets":{"post":{"tags":["MCP Tools"],"summary":"search_code_snippets","description":"Searches saved code snippets and reusable utilities by query term or programming language.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Search query or keyword"},"language":{"type":"string","description":"Filter by programming language"}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_project_roadmap":{"post":{"tags":["MCP Tools"],"summary":"save_project_roadmap","description":"Saves multi-phase project roadmaps, completed milestones, upcoming sprint goals, and active blockers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"current_phase":{"type":"string","description":"Current sprint or phase (e.g. 'Phase 2 - Security Gating')"},"completed_milestones":{"type":"array","items":{"type":"string"},"description":"List of finished features/tasks"},"upcoming_milestones":{"type":"array","items":{"type":"string"},"description":"List of next planned features"},"blockers":{"type":"array","items":{"type":"string"},"description":"List of unresolved blockers or dependencies"},"target_completion_date":{"type":"string","description":"Estimated completion date"}},"required":["project_name","current_phase"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_project_roadmap":{"post":{"tags":["MCP Tools"],"summary":"get_project_roadmap","description":"Fetches current phase, completed milestones, upcoming tasks, and blockers for a project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/log_ai_session_summary":{"post":{"tags":["MCP Tools"],"summary":"log_ai_session_summary","description":"Logs an end-of-session summary of pair programming work, modified files, key decisions, and next steps for AI context continuity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"agent_name":{"type":"string","description":"AI Agent/Assistant name (e.g. 'Antigravity AI', 'Claude')"},"summary_of_work":{"type":"string","description":"Detailed narrative of what was accomplished during session"},"modified_files":{"type":"array","items":{"type":"string"},"description":"List of modified or created file paths"},"key_decisions":{"type":"array","items":{"type":"string"},"description":"Architectural or design decisions agreed upon"},"next_steps":{"type":"array","items":{"type":"string"},"description":"Action items for the next AI session"},"unresolved_issues":{"type":"array","items":{"type":"string"},"description":"Open questions or unresolved bugs"}},"required":["project_name","summary_of_work"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_latest_ai_session_summary":{"post":{"tags":["MCP Tools"],"summary":"get_latest_ai_session_summary","description":"Fetches the latest AI session continuity summary so any AI assistant can instantly resume pair programming context.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/submit_sensitive_action":{"post":{"tags":["MCP Tools"],"summary":"submit_sensitive_action","description":"Submits a sensitive AI task (e.g. bulk deletion, schema modification, deployment trigger) into the Async AI Approval Queue. Returns an approval_id and pending status for admin manual approval.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action_type":{"type":"string","description":"Action type (e.g. 'DELETE_ALL_MEMORIES', 'UPDATE_PRODUCTION_SCHEMA', 'DEPLOY_RELEASE')"},"action_payload":{"type":"object","description":"JSON arguments payload for the requested action"},"reason":{"type":"string","description":"Justification for why this sensitive action is required"},"project_name":{"type":"string","description":"Optional project association"}},"required":["action_type","action_payload","reason"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/check_approval_status":{"post":{"tags":["MCP Tools"],"summary":"check_approval_status","description":"Checks the approval status (PENDING, APPROVED, REJECTED) of a previously queued sensitive AI action request by approval_id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approval_id":{"type":"string","description":"Unique approval ID (e.g. 'APP-1700000000000-A1B2C3')"}},"required":["approval_id"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_safe_directory":{"post":{"tags":["MCP Tools"],"summary":"list_safe_directory","description":"Securely lists directory contents within safe sandboxed directories ('./public', './logs', or './backups'). Strict path-jailing prevents traversing outside safe roots.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relative_path":{"type":"string","description":"Relative subfolder path (e.g. '', 'assets', 'dumps')"},"sandbox_folder":{"type":"string","description":"Target sandbox root: 'public', 'logs', or 'backups' (default: 'public')"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/read_safe_file":{"post":{"tags":["MCP Tools"],"summary":"read_safe_file","description":"Securely reads file content from disk inside designated sandboxed folders ('./public', './logs', or './backups'). Strict path-jailing & secret file filters block unauthorized file access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relative_path":{"type":"string","description":"Relative file path inside sandbox (e.g. 'favicon.ico', 'server.log', 'export.json')"},"sandbox_folder":{"type":"string","description":"Target sandbox root: 'public', 'logs', or 'backups' (default: 'public')"}},"required":["relative_path"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_secret":{"post":{"tags":["MCP Tools"],"summary":"save_secret","description":"Securely saves credentials, API keys, tokens, PII, or any sensitive value into the AES-GCM encrypted R2 Vault with domain segregation. The raw value is NEVER returned after saving — only the vault_key reference is returned. Use get_secret_reference for metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office' for work/Interstoff, 'personal' for personal, 'others' for utilities)."},"vault_key":{"type":"string","description":"Unique identifier for this secret (e.g. 'firebase_api_key', 'admin_password', 'stripe_secret')"},"secret_value":{"type":"string","description":"The raw secret value to encrypt and store"},"secret_type":{"type":"string","enum":["api_key","credential","token","personal_info","certificate","config"],"description":"Category of the secret"},"project_name":{"type":"string","description":"Project this secret belongs to"},"description":{"type":"string","description":"Human-readable description of what this secret is used for"},"expires_at":{"type":"string","description":"Optional ISO 8601 expiry date (e.g. '2026-12-31T00:00:00Z')"}},"required":["vault_key","secret_value","secret_type","project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_secret_reference":{"post":{"tags":["MCP Tools"],"summary":"get_secret_reference","description":"Returns safe metadata about a vault entry (type, description, masked preview, expiry) with domain isolation. NEVER returns the raw decrypted secret value. Used by AI models to confirm a secret exists and check its metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"vault_key":{"type":"string","description":"Vault key identifier"},"project_name":{"type":"string","description":"Project name"}},"required":["vault_key","project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_vault_keys":{"post":{"tags":["MCP Tools"],"summary":"list_vault_keys","description":"Lists all secret keys in the vault for a project. Shows only metadata (vault_key, secret_type, description, created_at) — never raw values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Filter by project. If omitted, lists all vault keys globally."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/delete_secret":{"post":{"tags":["MCP Tools"],"summary":"delete_secret","description":"Permanently deletes an encrypted vault entry by vault_key and project_name. This action is irreversible. The secret value is wiped from R2 storage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vault_key":{"type":"string","description":"Vault key to delete"},"project_name":{"type":"string","description":"Project name"}},"required":["vault_key","project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/rotate_secret":{"post":{"tags":["MCP Tools"],"summary":"rotate_secret","description":"Atomically rotates (replaces) the encrypted value of an existing vault key. Keeps all metadata intact and increments the rotation counter. Use this for regular credential rotation without breaking references.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vault_key":{"type":"string","description":"Vault key to rotate"},"project_name":{"type":"string","description":"Project name"},"new_secret_value":{"type":"string","description":"The new secret value to encrypt and store"}},"required":["vault_key","project_name","new_secret_value"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/enhance_prompt":{"post":{"tags":["MCP Tools"],"summary":"enhance_prompt","description":"Analyzes and rewrites a raw user prompt to be clearer, more structured, and AI-optimized. Optionally injects live project context (tech stack, architecture, current task) from memory to produce a context-aware, production-grade prompt for any AI model (Gemini, Claude, GPT).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"raw_prompt":{"type":"string","description":"The original raw prompt text to enhance"},"project_name":{"type":"string","description":"Optional project to pull live context from"},"intent":{"type":"string","enum":["coding","debugging","design","analysis","writing","general"],"description":"Purpose of the prompt — used to select the right expert role persona"},"target_model":{"type":"string","enum":["gemini","claude","gpt","general"],"description":"Target AI model to optimize the prompt format for"},"inject_project_context":{"type":"boolean","description":"If true, fetches and injects live project memory (architecture, tech stack, tasks) into the prompt"}},"required":["raw_prompt"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_prompt_template":{"post":{"tags":["MCP Tools"],"summary":"save_prompt_template","description":"Saves a reusable prompt template with {{variable}} placeholders. Templates can be retrieved and filled at any time to produce consistent, high-quality prompts for repeated tasks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template_name":{"type":"string","description":"Unique name for this template (e.g. 'code_review', 'bug_report', 'deploy_checklist')"},"template_content":{"type":"string","description":"Template content. Use {{variable_name}} for placeholders."},"variables":{"type":"array","items":{"type":"string"},"description":"List of variable names used in template (e.g. ['project_name', 'task'])"},"category":{"type":"string","description":"Category tag (e.g. 'coding', 'review', 'deploy', 'analysis')"},"project_name":{"type":"string","description":"Optional project scope (use 'global' for cross-project templates)"},"description":{"type":"string","description":"Brief description of what this template is for"}},"required":["template_name","template_content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_prompt_template":{"post":{"tags":["MCP Tools"],"summary":"get_prompt_template","description":"Retrieves a saved prompt template and optionally fills in {{variable}} placeholders with provided values. Returns both the raw template and the filled version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template_name":{"type":"string","description":"Name of the template to retrieve"},"project_name":{"type":"string","description":"Project scope (or 'global' for cross-project templates)"},"variables":{"type":"object","description":"Key-value pairs to fill into the template (e.g. { 'task': 'Fix login bug' })"}},"required":["template_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/log_prompt_history":{"post":{"tags":["MCP Tools"],"summary":"log_prompt_history","description":"Logs an AI prompt and response exchange to a searchable history log. Useful for auditing AI interactions, building fine-tuning datasets, and reviewing past prompts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project context"},"prompt_text":{"type":"string","description":"The prompt sent to the AI model"},"response_summary":{"type":"string","description":"Summary or excerpt of the AI response"},"model_used":{"type":"string","description":"AI model that was used (e.g. 'gemini-2.0-flash', 'claude-sonnet-4')"},"intent":{"type":"string","enum":["coding","debugging","design","analysis","writing","general"],"description":"Purpose of the prompt"},"session_id":{"type":"string","description":"Optional session identifier to group related exchanges"}},"required":["project_name","prompt_text","response_summary","model_used"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_prompt_history":{"post":{"tags":["MCP Tools"],"summary":"search_prompt_history","description":"Searches the saved prompt/response history log by keyword, project, model, or date range. Useful for finding past AI interactions or building training datasets.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Keyword to search in prompt text or response summary"},"project_name":{"type":"string","description":"Optional project filter"},"model_used":{"type":"string","description":"Optional model filter (e.g. 'gemini-2.0-flash')"},"date_from":{"type":"string","description":"Optional start date in ISO 8601 format"},"date_to":{"type":"string","description":"Optional end date in ISO 8601 format"},"limit":{"type":"number","description":"Max results to return (default 20)"}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/set_reminder":{"post":{"tags":["MCP Tools"],"summary":"set_reminder","description":"Creates a time-bound reminder for a task, deadline, or follow-up. When any AI model calls get_active_reminders at session start, overdue and due-today reminders will surface proactively — making the server think ahead on your behalf.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reminder_id":{"type":"string","description":"Unique identifier for this reminder (e.g. 'deploy-v2-review', 'api-key-renewal')"},"message":{"type":"string","description":"Reminder message — what needs to be done"},"due_at":{"type":"string","description":"ISO 8601 due date-time (e.g. '2026-08-10T09:00:00Z')"},"project_name":{"type":"string","description":"Optional project to associate this reminder with"},"priority":{"type":"string","enum":["low","medium","high","critical"],"description":"Priority level. Critical reminders appear first."},"repeat":{"type":"string","enum":["none","daily","weekly"],"description":"Recurrence frequency. 'none' means one-shot."}},"required":["reminder_id","message","due_at"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_active_reminders":{"post":{"tags":["MCP Tools"],"summary":"get_active_reminders","description":"Returns all reminders that are currently due or overdue (due_at <= now), grouped by priority. RECOMMENDED: Call this at the start of every AI session to surface proactive alerts. Also supports filtering by project or including future reminders.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Optional project filter"},"include_future":{"type":"boolean","description":"If true, also includes reminders not yet due. Default false."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/dismiss_reminder":{"post":{"tags":["MCP Tools"],"summary":"dismiss_reminder","description":"Marks a reminder as DISMISSED (done, won't resurface) or SNOOZED (temporarily hidden until snooze_until date). For repeating reminders, dismissing resets the next due date.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reminder_id":{"type":"string","description":"The reminder_id to dismiss or snooze"},"action":{"type":"string","enum":["dismiss","snooze"],"description":"Whether to permanently dismiss or temporarily snooze"},"snooze_until":{"type":"string","description":"Required if action is 'snooze'. ISO 8601 date to snooze until."}},"required":["reminder_id","action"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_ai_context_rules":{"post":{"tags":["MCP Tools"],"summary":"save_ai_context_rules","description":"Saves a set of behavioral rules and coding standards that any AI model must follow when working on a specific project. Acts as a persistent system-prompt supplement — defines tone, output format, forbidden patterns, and project-specific conventions. Any AI that calls get_ai_context_rules at session start will automatically apply these rules.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"rules":{"type":"array","items":{"type":"string"},"description":"List of behavioral rules (e.g. 'Always use TypeScript strict mode', 'Never expose raw secrets in output')"},"coding_standards":{"type":"string","description":"Markdown block of coding standards (style guide, naming conventions, patterns)"},"forbidden_actions":{"type":"array","items":{"type":"string"},"description":"List of explicitly forbidden actions (e.g. 'Do not use console.log in production code', 'Never use any type')"},"preferred_output_format":{"type":"string","description":"Preferred response format (e.g. 'Always use markdown code blocks', 'Bullet points first, code second')"},"personality_tone":{"type":"string","description":"AI personality tone for this project (e.g. 'Technical and concise', 'Friendly and educational', 'Senior engineer mentoring junior')"}},"required":["project_name","rules"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_ai_context_rules":{"post":{"tags":["MCP Tools"],"summary":"get_ai_context_rules","description":"Fetches the AI behavioral rules and coding standards for a project. Call this at the start of every AI session to ensure consistent behavior. Returns rules, forbidden actions, output format preferences, and personality tone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_knowledge_node":{"post":{"tags":["MCP Tools"],"summary":"save_knowledge_node","description":"Saves a named entity (person, technology, service, decision, event, or project) as a knowledge graph node with domain segregation. Indexed in D1 SQLite for sub-5ms queries and persisted to Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office' for work/Interstoff, 'personal' for personal, 'others' for utilities)."},"node_id":{"type":"string","description":"Unique identifier for this node (e.g. 'arif', 'cloudflare_workers', 'otnarp_project')"},"node_type":{"type":"string","enum":["person","technology","service","decision","event","project","concept"],"description":"Entity type"},"label":{"type":"string","description":"Human-readable display label (e.g. 'Arif Mahmud', 'Cloudflare Workers')"},"description":{"type":"string","description":"Detailed description of this entity"},"properties":{"type":"object","description":"Optional key-value properties (e.g. { 'role': 'owner', 'url': 'https://...' })"},"project_name":{"type":"string","description":"Optional project scope (use 'global' for cross-project nodes)"}},"required":["node_id","node_type","label","description"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/link_knowledge_nodes":{"post":{"tags":["MCP Tools"],"summary":"link_knowledge_nodes","description":"Creates a directed relationship between two knowledge graph nodes (e.g. 'arif OWNS otnarp', 'otnarp USES cloudflare_workers'). Indexed in D1 and persisted to R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office', 'personal', 'others')."},"from_node_id":{"type":"string","description":"Source node ID"},"relation":{"type":"string","description":"Relationship type in CAPS (e.g. 'OWNS', 'USES', 'DEPENDS_ON', 'CREATED_BY', 'BLOCKED_BY', 'PART_OF')"},"to_node_id":{"type":"string","description":"Target node ID"},"project_name":{"type":"string","description":"Project scope for this relationship"},"weight":{"type":"number","description":"Relationship strength weight (default 1.0)"}},"required":["from_node_id","relation","to_node_id"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/query_knowledge_graph":{"post":{"tags":["MCP Tools"],"summary":"query_knowledge_graph","description":"Queries the knowledge graph. Uses sub-5ms D1 SQLite indexing to find edges, related nodes, and graph triples with domain isolation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"node_id":{"type":"string","description":"Find all edges involving this node (as source or target)"},"node_type":{"type":"string","enum":["person","technology","service","decision","event","project"],"description":"Filter nodes by type"},"relation":{"type":"string","description":"Filter edges by relation type (e.g. 'OWNS', 'USES')"},"project_name":{"type":"string","description":"Project scope to query. Defaults to 'global'."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_knowledge_graph_vector":{"post":{"tags":["MCP Tools"],"summary":"search_knowledge_graph_vector","description":"Performs Cosine vector similarity search over knowledge graph nodes. Returns the most relevant subgraphs and graph triples matching the query topic for seamless LLM context injection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Optional domain partition filter ('office', 'personal', 'others')."},"query_text":{"type":"string","description":"Topic or query to find relevant knowledge subgraphs for"},"project_name":{"type":"string","description":"Project scope (default 'global')"},"top_k":{"type":"number","description":"Maximum number of relevant nodes to return (default 5)"}},"required":["query_text"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_document_reference":{"post":{"tags":["MCP Tools"],"summary":"save_document_reference","description":"Saves a reference to an external document, URL, PDF, Figma design, GitHub repo, or Notion page associated with a project. Useful for linking research papers, API docs, design files, changelogs, and references so any AI can quickly locate them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project to associate this document with"},"doc_id":{"type":"string","description":"Unique identifier for this document (e.g. 'cloudflare_r2_docs', 'figma_v2_design')"},"title":{"type":"string","description":"Human-readable title of the document"},"url":{"type":"string","description":"URL or path to the document"},"content_excerpt":{"type":"string","description":"Short excerpt or summary of the document content (max 500 chars)"},"doc_type":{"type":"string","enum":["url","pdf","figma","github","notion","doc"],"description":"Type of document"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for searching (e.g. ['auth', 'deployment', 'design'])"}},"required":["project_name","doc_id","title","doc_type"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_document_references":{"post":{"tags":["MCP Tools"],"summary":"search_document_references","description":"Searches saved document references by keyword (in title, excerpt, tags), document type, or project. Use to quickly find previously saved URLs, PDFs, Figma files, or GitHub repos.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Search keyword (matches title, excerpt, tags, doc_id)"},"project_name":{"type":"string","description":"Optional project filter"},"doc_type":{"type":"string","enum":["url","pdf","figma","github","notion","doc"],"description":"Optional document type filter"}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/acquire_agent_lock":{"post":{"tags":["MCP Tools"],"summary":"acquire_agent_lock","description":"Atomically acquires a named distributed lock. Prevents multiple AI agents from modifying the same resource simultaneously. Returns acquired=true with a lock_id if successful, or acquired=false if held by another agent. Locks auto-expire after ttl_seconds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lock_name":{"type":"string","description":"Name of the resource to lock (e.g. 'schema_migration', 'production_deploy', 'r2_bulk_write')"},"agent_id":{"type":"string","description":"Unique identifier of the acquiring agent (e.g. 'antigravity-main', 'claude-agent-1')"},"ttl_seconds":{"type":"number","description":"Lock TTL in seconds (default 300 = 5 minutes). Lock auto-expires after this duration."},"project_name":{"type":"string","description":"Optional project scope"}},"required":["lock_name","agent_id"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/release_agent_lock":{"post":{"tags":["MCP Tools"],"summary":"release_agent_lock","description":"Releases a previously acquired agent lock identified by lock_name and lock_id. Always release locks after completing the protected operation to allow other agents to proceed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lock_name":{"type":"string","description":"Name of the lock to release"},"lock_id":{"type":"string","description":"The lock_id returned by acquire_agent_lock"},"project_name":{"type":"string","description":"Optional project scope"}},"required":["lock_name","lock_id"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/broadcast_agent_event":{"post":{"tags":["MCP Tools"],"summary":"broadcast_agent_event","description":"Publishes a named event to the shared agent event log that other AI agents can poll for coordination. Use to announce state changes like DEPLOYMENT_STARTED, SCHEMA_UPDATED, TASK_COMPLETED, ERROR_DETECTED.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event_type":{"type":"string","description":"Event type in CAPS (e.g. 'DEPLOYMENT_STARTED', 'SCHEMA_UPDATED', 'TASK_COMPLETED', 'ERROR_DETECTED')"},"payload":{"type":"object","description":"Optional structured payload with event details"},"project_name":{"type":"string","description":"Optional project scope"},"agent_id":{"type":"string","description":"ID of the agent broadcasting this event"}},"required":["event_type"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/poll_agent_events":{"post":{"tags":["MCP Tools"],"summary":"poll_agent_events","description":"Fetches recent events from the shared agent event log, with optional filtering by project, event type, or since timestamp. Use to coordinate between agents or audit recent activity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Optional filter by project"},"event_type":{"type":"string","description":"Optional filter by event type (e.g. 'DEPLOYMENT_STARTED')"},"since_timestamp":{"type":"string","description":"Optional ISO 8601 timestamp — only return events after this time"},"limit":{"type":"number","description":"Max events to return (default 50)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/post_to_agent_blackboard":{"post":{"tags":["MCP Tools"],"summary":"post_to_agent_blackboard","description":"Publishes an announcement, hypothesis, architectural decision, or shared artifact to the Multi-Agent Swarm Blackboard. All collaborating AI agents subscribe to this blackboard to prevent duplicate work, resolve design choices, and exchange live progress.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","description":"Identifier of the posting agent (e.g. 'antigravity-ide', 'claude-architect')"},"topic":{"type":"string","description":"Blackboard topic (e.g. 'architecture_decision', 'schema_change', 'test_results', 'dependency_update')"},"content":{"type":"string","description":"Detailed message, JSON data, or markdown summary of the post"},"project_name":{"type":"string","description":"Target project scope (default 'global')"},"importance":{"type":"string","enum":["normal","high","critical"],"description":"Importance level (default 'normal')"},"tags":{"type":"array","items":{"type":"string"},"description":"Hierarchical or context tags"}},"required":["agent_id","topic","content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/read_agent_blackboard":{"post":{"tags":["MCP Tools"],"summary":"read_agent_blackboard","description":"Reads current posts from the Multi-Agent Swarm Blackboard for a project, with optional topic and tag filtering. Essential for synchronizing context before starting an autonomous build phase or architecture overhaul.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project scope (default 'global')"},"topic":{"type":"string","description":"Optional topic filter"},"limit":{"type":"number","description":"Maximum posts to return (default: 20)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_mcp_tools":{"post":{"tags":["MCP Tools"],"summary":"search_mcp_tools","description":"Dynamically searches and discovers tools by intent, keyword, or category among the 112+ available server tools. Returns tool definitions, parameter schemas, and recommended usage to prevent LLM context exhaustion.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Search keyword or intent (e.g. 'docker', 'encrypt', 'benchmark', 'secrets', 'graph', 'chaos')."},"category":{"type":"string","description":"Optional category filter ('core', 'devops', 'cognitive', 'agent_build', 'security', 'security_audit', 'memory', 'reverse_engineering', 'design')."},"limit":{"type":"number","description":"Maximum number of tools to return (default: 5, max: 15)."}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/list_tool_profiles":{"post":{"tags":["MCP Tools"],"summary":"list_tool_profiles","description":"Lists all available tool virtualization profiles, their descriptions, tool count, and guidance on how to connect with specific profiles to optimize AI prompt token costs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/log_tool_usage":{"post":{"tags":["MCP Tools"],"summary":"log_tool_usage","description":"Logs a tool invocation event to the analytics usage log with timestamp, tool name, project, duration, and success status. Can be called explicitly to record usage or automatically via the server middleware.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool_name":{"type":"string","description":"Name of the tool that was called"},"project_name":{"type":"string","description":"Optional project context"},"duration_ms":{"type":"number","description":"How long the tool call took in milliseconds"},"success":{"type":"boolean","description":"Whether the tool call succeeded"},"error_message":{"type":"string","description":"Error message if the call failed"}},"required":["tool_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_usage_analytics":{"post":{"tags":["MCP Tools"],"summary":"get_usage_analytics","description":"Returns aggregated usage analytics: most-used tools, most active projects, total calls, error rate, average response time, and usage breakdown by day. Filter by date range or project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date_from":{"type":"string","description":"Optional start date filter (ISO 8601)"},"date_to":{"type":"string","description":"Optional end date filter (ISO 8601)"},"project_name":{"type":"string","description":"Optional project filter"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/compress_context":{"post":{"tags":["MCP Tools"],"summary":"compress_context","description":"Intelligently compresses code, logs, text, markdown, or JSON context by 50-80% to dramatically save AI tokens and fit large payloads into LLM context windows.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"The raw text, code, log, or JSON content to compress."},"type":{"type":"string","enum":["code","log","json","markdown","text"],"description":"Type of content to optimize (default: 'text')."},"intensity":{"type":"string","enum":["light","medium","aggressive"],"description":"Compression aggressiveness level (default: 'medium')."}},"required":["content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/estimate_token_cost":{"post":{"tags":["MCP Tools"],"summary":"estimate_token_cost","description":"Calculates exact token counts and estimated USD costs across major AI models (Claude 3.7/3.5, Gemini 2.0/1.5, GPT-4o, DeepSeek) with caching savings analysis.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"The prompt, code, or context to calculate tokens and cost for."},"model":{"type":"string","description":"Target model key (e.g. 'claude-3-7-sonnet', 'gemini-2.0-flash', 'gpt-4o', or 'all'). Default: 'all'."}},"required":["content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/distill_project_memory":{"post":{"tags":["MCP Tools"],"summary":"distill_project_memory","description":"Consolidates and compresses multiple historical memory records for a project into a high-density AI briefing, reducing memory token overhead by 60-70%.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"The name of the project to distill memory for."},"max_tokens":{"type":"number","description":"Target maximum token count for the distilled briefing (default: 1200)."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/optimize_for_prompt_caching":{"post":{"tags":["MCP Tools"],"summary":"optimize_for_prompt_caching","description":"Structures system rules, memory context, and user instructions into Cache-Optimized Prefixes to unlock 90% prompt caching cost discounts (Anthropic & Gemini).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"static_system_rules":{"type":"string","description":"Static unchanging rules, personas, or behavioral guidelines."},"project_context":{"type":"string","description":"Project architecture and reference documentation."},"dynamic_user_task":{"type":"string","description":"The specific dynamic task, instruction, or user prompt for this turn."},"provider":{"type":"string","enum":["anthropic","gemini","openai"],"description":"Target LLM provider (default: 'anthropic')."}},"required":["static_system_rules","dynamic_user_task"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_semantic_diff":{"post":{"tags":["MCP Tools"],"summary":"generate_semantic_diff","description":"Generates a minimal unified diff slice between original and modified code, saving thousands of tokens compared to passing full multi-hundred line files to the AI.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"original_content":{"type":"string","description":"Original source code or document text."},"updated_content":{"type":"string","description":"Modified source code or document text."},"filename":{"type":"string","description":"Optional filename label (e.g. 'src/index.ts')."},"context_lines":{"type":"number","description":"Number of surrounding context lines to include around edits (default: 3)."}},"required":["original_content","updated_content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_runbook":{"post":{"tags":["MCP Tools"],"summary":"save_runbook","description":"Saves a structured incident runbook / operations playbook for a project. Stores symptoms, root causes, step-by-step resolution procedures, rollback instructions, and on-call contacts. Essential for Super DevOps: enables AI to recall exact production recovery procedures instantly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name (e.g. 'otnarp', 'ampshop')"},"incident_type":{"type":"string","description":"Category of incident (e.g. 'database_outage', 'memory_leak', 'deploy_failure', 'ssl_expiry', 'high_cpu')"},"title":{"type":"string","description":"Short human-readable title for this runbook entry"},"symptoms":{"type":"array","items":{"type":"string"},"description":"Observable symptoms (e.g. '500 errors on /api/health', 'DB connections timing out')"},"root_causes":{"type":"array","items":{"type":"string"},"description":"Possible root causes to investigate"},"resolution_steps":{"type":"array","items":{"type":"string"},"description":"Ordered step-by-step resolution procedure"},"rollback_procedure":{"type":"string","description":"How to safely rollback if resolution fails"},"affected_services":{"type":"array","items":{"type":"string"},"description":"List of services / microservices affected"},"oncall_contacts":{"type":"array","items":{"type":"string"},"description":"On-call contacts or escalation path"},"severity":{"type":"string","enum":["P0_critical","P1_high","P2_medium","P3_low"],"description":"Incident severity level"},"tags":{"type":"array","items":{"type":"string"},"description":"Searchable tags"}},"required":["project_name","incident_type","title","resolution_steps"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_runbook":{"post":{"tags":["MCP Tools"],"summary":"get_runbook","description":"Retrieves incident runbooks and operations playbooks by project and incident type. Returns resolution steps, rollback procedures, and on-call contacts. Use when a production incident occurs or when writing incident response code.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name"},"incident_type":{"type":"string","description":"Incident type to retrieve (e.g. 'database_outage'). Use 'list' to see all available runbooks."}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_environment_config":{"post":{"tags":["MCP Tools"],"summary":"save_environment_config","description":"Saves a complete environment configuration matrix for a project — including all service URLs, feature flags, environment variables (references only, not raw secrets), resource limits, and deployment targets for dev, staging, and production. Enables AI to generate environment-correct code and configs instantly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name"},"environment":{"type":"string","enum":["development","staging","production","testing"],"description":"Target environment name"},"service_urls":{"type":"object","description":"Key-value map of service names to their URLs in this environment (e.g. {'api': 'https://api.dev.example.com', 'db': 'postgres://...'})"},"env_variables":{"type":"array","items":{"type":"string"},"description":"List of environment variable names (keys only, not values!) required in this environment (e.g. ['DATABASE_URL', 'JWT_SECRET', 'API_KEY'])"},"feature_flags":{"type":"object","description":"Feature flags active in this environment (e.g. {'dark_mode': true, 'beta_signup': false})"},"resource_limits":{"type":"object","description":"Resource allocation (e.g. {'memory_mb': 512, 'cpu_cores': 2, 'max_connections': 100})"},"deployment_target":{"type":"string","description":"Where this environment deploys to (e.g. 'Cloudflare Workers', 'AWS ECS', 'Kubernetes namespace: prod')"},"notes":{"type":"string","description":"Any special notes or gotchas for this environment"}},"required":["project_name","environment"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_environment_config":{"post":{"tags":["MCP Tools"],"summary":"get_environment_config","description":"Retrieves the complete environment configuration for a project and specific environment (dev/staging/prod). Returns service URLs, required env variable names, feature flags, resource limits, and deployment target. Use before writing deployment scripts, CI/CD configs, or environment-specific code.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name"},"environment":{"type":"string","enum":["development","staging","production","testing"],"description":"Target environment"}},"required":["project_name","environment"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_iac_snippet":{"post":{"tags":["MCP Tools"],"summary":"save_iac_snippet","description":"Saves an Infrastructure as Code (IaC) configuration snippet — Docker Compose files, Kubernetes YAMLs, Terraform HCL modules, Nginx/Caddy configs, GitHub Actions workflows, Helm charts, and more. AI can later retrieve these exact, battle-tested configs instead of guessing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name (use 'global' for reusable snippets)"},"snippet_id":{"type":"string","description":"Unique ID (e.g. 'nginx_reverse_proxy', 'k8s_hpa', 'docker_node_app')"},"title":{"type":"string","description":"Human-readable title"},"technology":{"type":"string","enum":["docker","docker-compose","kubernetes","terraform","nginx","caddy","github-actions","helm","ansible","cloudflare","other"],"description":"IaC technology"},"content":{"type":"string","description":"The full IaC configuration content (YAML, HCL, Dockerfile, etc.)"},"description":{"type":"string","description":"What this snippet does and when to use it"},"tags":{"type":"array","items":{"type":"string"},"description":"Searchable tags (e.g. ['ssl', 'load-balancer', 'nodejs'])"},"version_target":{"type":"string","description":"Target version or platform (e.g. 'k8s 1.29', 'terraform 1.7', 'docker 27')"}},"required":["project_name","snippet_id","title","technology","content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_iac_snippets":{"post":{"tags":["MCP Tools"],"summary":"search_iac_snippets","description":"Searches saved Infrastructure as Code snippets by technology, tags, or keyword. Returns matching snippet metadata and content. Use before writing Dockerfiles, K8s manifests, Terraform modules, or CI/CD pipelines to retrieve proven configurations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name (or 'global' for shared snippets)"},"query":{"type":"string","description":"Search keyword (matches title, description, tags)"},"technology":{"type":"string","enum":["docker","docker-compose","kubernetes","terraform","nginx","caddy","github-actions","helm","ansible","cloudflare","other"],"description":"Filter by IaC technology"},"include_content":{"type":"boolean","description":"If true, returns full snippet content (default: false, returns index only)"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/save_security_checklist":{"post":{"tags":["MCP Tools"],"summary":"save_security_checklist","description":"Saves a security checklist, OWASP audit result, vulnerability scan finding, or security policy for a project. Includes severity, remediation steps, and compliance references (OWASP Top 10, CWE, CVE). Enables AI to write security-hardened code automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name"},"checklist_id":{"type":"string","description":"Unique ID (e.g. 'owasp_top10_audit', 'sql_injection_review', 'api_auth_checklist')"},"category":{"type":"string","enum":["owasp","authentication","authorization","injection","xss","csrf","crypto","secrets_management","api_security","dependency","infrastructure","compliance","custom"],"description":"Security category"},"title":{"type":"string","description":"Checklist title"},"items":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string","description":"What to check"},"status":{"type":"string","enum":["pass","fail","warning","not_applicable","pending"]},"severity":{"type":"string","enum":["critical","high","medium","low","info"]},"remediation":{"type":"string","description":"How to fix if failing"},"reference":{"type":"string","description":"OWASP/CWE/CVE reference"}}},"description":"List of security check items"},"overall_status":{"type":"string","enum":["pass","fail","needs_review"],"description":"Overall audit status"},"notes":{"type":"string","description":"General notes or context"}},"required":["project_name","checklist_id","category","title","items"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_deployment_plan":{"post":{"tags":["MCP Tools"],"summary":"generate_deployment_plan","description":"Generates a comprehensive, project-specific deployment checklist by combining saved architecture blueprints, runbooks, environment configs, and security checklists. Produces a ready-to-execute deployment plan with pre-deploy, deploy, post-deploy, verification, and rollback phases. The ultimate Super DevOps tool.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Project name to generate plan for"},"target_environment":{"type":"string","enum":["development","staging","production"],"description":"Target deployment environment"},"deployment_type":{"type":"string","enum":["full_release","hotfix","rollback","canary","blue_green","feature_flag"],"description":"Type of deployment (default: full_release)"},"include_sections":{"type":"array","items":{"type":"string","enum":["pre_deploy","deploy","post_deploy","verification","rollback","monitoring"]},"description":"Sections to include (default: all)"},"custom_steps":{"type":"array","items":{"type":"string"},"description":"Additional custom steps to append to the plan"}},"required":["project_name","target_environment"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_vector_embedding":{"post":{"tags":["MCP Tools"],"summary":"generate_vector_embedding","description":"Generates a 1024-dimensional dense vector embedding for text, code, or queries using Cloudflare Workers AI (@cf/baai/bge-large-en-v1.5) with zero third-party API dependencies.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"The text, code snippet, or query to generate vector embedding for."},"model":{"type":"string","description":"Workers AI model identifier (default: '@cf/baai/bge-large-en-v1.5')."}},"required":["text"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/register_dynamic_project":{"post":{"tags":["MCP Tools"],"summary":"register_dynamic_project","description":"Dynamically registers any new or existing project into the Universal Multi-Project Hub. Supports personal portfolios, agency services, SaaS apps, e-commerce, core utilities, and custom client repositories.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Unique project identifier (e.g. 'arifmahmud-com', 'itsupport-bd', 'ampshop', '48_otnarp', 'custom-client-app')"},"display_name":{"type":"string","description":"Human-readable project title (e.g. 'Arif Mahmud Portfolio & Blog')"},"ecosystem":{"type":"string","enum":["portfolio","agency_enterprise","ecommerce_retail","infra_security","client_custom"],"description":"Ecosystem category this project belongs to"},"description":{"type":"string","description":"Comprehensive summary of project goals, domain, and architecture"},"tech_stack":{"type":"array","items":{"type":"string"},"description":"Technologies, frameworks, and drivers (e.g. ['Next.js', 'Cloudflare Workers', 'TailwindCSS', 'D1', 'Prisma'])"},"live_url":{"type":"string","description":"Production live URL (e.g. 'https://www.arifmahmud.com', 'https://www.itsupport.com.bd')"},"repository_url":{"type":"string","description":"GitHub or Git repository URL (e.g. 'https://github.com/pranto48/portfolio')"},"deployment_target":{"type":"string","description":"Target cloud platform (e.g. 'Cloudflare Pages / Workers', 'Vercel', 'AWS ECS', 'Self-Hosted VPS')"},"tags":{"type":"array","items":{"type":"string"},"description":"Searchable metadata tags"}},"required":["project_name","display_name","ecosystem","description"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/ingest_project_codebase":{"post":{"tags":["MCP Tools"],"summary":"ingest_project_codebase","description":"Ingests and indexes file trees, API routes, components, database schemas, and architectural summaries for any project. Computes vector embeddings for each code block for fast semantic retrieval.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project identifier"},"modules":{"type":"array","items":{"type":"object","properties":{"file_path":{"type":"string","description":"Relative file path (e.g. 'src/app/api/auth/route.ts')"},"module_type":{"type":"string","enum":["api_route","ui_component","database_model","service_logic","config","documentation"],"description":"Type of module"},"summary":{"type":"string","description":"Concise summary of what this file/module accomplishes"},"key_exports":{"type":"array","items":{"type":"string"},"description":"Functions, classes, or types exported"},"code_snippet":{"type":"string","description":"Representative code snippet or full code block"}}},"description":"List of key files and modules to ingest"},"architecture_notes":{"type":"string","description":"High-level architecture overview and data flow notes"}},"required":["project_name","modules"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/search_codebase_semantic":{"post":{"tags":["MCP Tools"],"summary":"search_codebase_semantic","description":"Performs dense vector semantic search across ingested codebases using Workers AI embeddings. Finds relevant functions, components, API routes, or logic across one or all registered projects.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Natural language query or code search phrase (e.g. 'JWT token verification middleware', 'Cloudflare D1 query pagination', 'dark mode toggle component')"},"project_name":{"type":"string","description":"Optional: limit search to a specific project. If omitted, searches across ALL registered projects."},"top_k":{"type":"number","description":"Number of top results to return (default: 5)."},"min_score":{"type":"number","description":"Minimum cosine similarity score threshold 0.0 - 1.0 (default: 0.15)."}},"required":["query"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/query_cross_project_patterns":{"post":{"tags":["MCP Tools"],"summary":"query_cross_project_patterns","description":"Cross-references patterns across all projects in the user's ecosystem (e.g. portfolio, enterprise, e-commerce, core utilities). Recommends reusable architecture patterns, auth flows, and code patterns.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pattern_category":{"type":"string","enum":["authentication","database_access","caching_strategy","ui_design_system","deployment_pipeline","error_handling","all"],"description":"Category of pattern to synthesize across projects"},"ecosystem_filter":{"type":"string","enum":["portfolio","agency_enterprise","ecommerce_retail","infra_security","client_custom","all"],"description":"Optional ecosystem filter"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_edge_scaffold":{"post":{"tags":["MCP Tools"],"summary":"generate_edge_scaffold","description":"Generates production-grade, memory-safe, and timer-safe boilerplate code for Cloudflare Workers, Hono, Next.js Edge, or D1/R2 services with zero runtime errors.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"framework":{"type":"string","enum":["hono_cloudflare_worker","nextjs_edge_route","cloudflare_d1_repository","cloudflare_r2_vault"],"description":"Target edge architecture framework"},"module_name":{"type":"string","description":"Name of the module or service (e.g. 'authMiddleware', 'projectRepository', 'analyticsService')"},"include_zod_validation":{"type":"boolean","description":"If true, includes Zod schemas for request validation (default: true)."}},"required":["framework","module_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/inspect_semantic_cache":{"post":{"tags":["MCP Tools"],"summary":"inspect_semantic_cache","description":"Returns efficiency analytics, hit rate, memory footprint, and tokens saved by the Semantic Edge Response Cache.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Optional project scope filter"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/clear_semantic_cache":{"post":{"tags":["MCP Tools"],"summary":"clear_semantic_cache","description":"Invalidates and purges the Semantic Edge Response Cache for a specific project or globally.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name, or 'all' for global eviction"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/deduplicate_project_memories":{"post":{"tags":["MCP Tools"],"summary":"deduplicate_project_memories","description":"Scans project memories using dense cosine similarity to detect, report, or automatically merge duplicate records.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name (e.g. 48_otnarp, ampshop)"},"similarity_threshold":{"type":"number","description":"Cosine similarity threshold (default 0.88)"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/run_d1_migrations":{"post":{"tags":["MCP Tools"],"summary":"run_d1_migrations","description":"Inspects and executes pending zero-downtime database schema migrations for Cloudflare D1 / SQLite.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apply_pending":{"type":"boolean","description":"If true, applies all pending migrations immediately"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/send_admin_alert":{"post":{"tags":["MCP Tools"],"summary":"send_admin_alert","description":"Dispatches a high-priority mobile push alert to Telegram Bot, Discord webhook, or generic webhook channels for security, operational, or testing events.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"Alert title or summary"},"event_type":{"type":"string","description":"Alert event classification (e.g. TEST_ALERT, CRITICAL_SECURITY_ALERT, DEVICE_PENDING_APPROVAL, GEO_FENCE_BREACH)"},"severity":{"type":"string","enum":["info","warning","critical"],"description":"Severity level of the notification (default: info)"},"details":{"type":"object","description":"Detailed key-value telemetry data or context to display in the alert"}},"required":["title"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/configure_alert_channels":{"post":{"tags":["MCP Tools"],"summary":"configure_alert_channels","description":"Configures real-time push alert credentials and channels (Telegram bot token, chat ID, Discord webhook, debounce window, public server URL) stored securely in Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"telegram_bot_token":{"type":"string","description":"Telegram Bot Token from @BotFather"},"telegram_chat_id":{"type":"string","description":"Target Telegram Chat ID or Channel ID"},"discord_webhook_url":{"type":"string","description":"Discord incoming webhook URL"},"generic_webhook_url":{"type":"string","description":"Custom HTTP POST webhook endpoint"},"enabled_channels":{"type":"array","items":{"type":"string","enum":["telegram","discord","generic"]},"description":"Active channels to dispatch notifications to"},"debounce_seconds":{"type":"number","description":"Debounce cooldown window in seconds (default: 30)"},"server_public_url":{"type":"string","description":"Public domain for interactive 1-click webhook URLs (e.g. https://data48otnarp.arif.bd)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_alert_telemetry":{"post":{"tags":["MCP Tools"],"summary":"get_alert_telemetry","description":"Returns current alert channel configurations, enabled push routes, and recent push notification dispatch telemetry logs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"number","description":"Number of recent logs to retrieve (default: 20, max: 50)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/configure_github_snapshot":{"post":{"tags":["MCP Tools"],"summary":"configure_github_snapshot","description":"Configures the automated GitHub encrypted memory snapshot backup system. Set your GitHub Personal Access Token (PAT), target private repository, branch, and R2 object prefix. Configuration is stored securely in Cloudflare R2.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"github_token":{"type":"string","description":"GitHub Personal Access Token (PAT) with 'repo' or 'contents:write' scope"},"github_repo":{"type":"string","description":"Target GitHub repository in 'owner/repo' format (e.g. 'pranto48/otnarp-backups')"},"github_branch":{"type":"string","description":"Target branch for commits (default: 'main')"},"snapshot_prefix":{"type":"string","description":"R2 object key prefix to include in snapshots (default: 'memories/')"},"enabled":{"type":"boolean","description":"Enable or disable automatic hourly cron snapshots"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/trigger_github_snapshot":{"post":{"tags":["MCP Tools"],"summary":"trigger_github_snapshot","description":"Immediately triggers a full encrypted snapshot of all R2 memories and metadata to the configured private GitHub repository. Returns a snapshot manifest with object counts, bytes, and GitHub commit URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trigger_reason":{"type":"string","description":"Optional reason or label for this snapshot (e.g. 'pre-migration backup', 'post-phase-4')"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_github_snapshot_status":{"post":{"tags":["MCP Tools"],"summary":"get_github_snapshot_status","description":"Returns the current GitHub snapshot configuration, last snapshot timestamp, GitHub commit SHA, and the last N snapshot history records.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"history_limit":{"type":"number","description":"Number of recent snapshot records to return (default: 10, max: 50)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/configure_s3_mirror":{"post":{"tags":["MCP Tools"],"summary":"configure_s3_mirror","description":"Configures cross-cloud disaster recovery mirroring to AWS S3, Cloudflare secondary R2, or custom S3-compatible object storage. Stores credentials securely in R2 metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["aws_s3","supabase","cloudflare_r2","custom_s3"],"description":"Target cloud object storage provider"},"endpoint":{"type":"string","description":"Custom S3 endpoint URL (required for custom_s3 or secondary cloudflare_r2)"},"region":{"type":"string","description":"AWS S3 region (default: 'us-east-1')"},"bucket_name":{"type":"string","description":"Target bucket name"},"access_key_id":{"type":"string","description":"S3 Access Key ID"},"secret_access_key":{"type":"string","description":"S3 Secret Access Key"},"path_prefix":{"type":"string","description":"Path prefix in the target bucket (default: 'otnarp-backup/')"},"enabled":{"type":"boolean","description":"Enable or disable mirroring to this provider"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/configure_supabase_mirror":{"post":{"tags":["MCP Tools"],"summary":"configure_supabase_mirror","description":"Configures cross-cloud backup mirroring to Supabase Storage. Stores Supabase URL and service role key securely in R2 metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supabase_url":{"type":"string","description":"Supabase project URL (e.g. 'https://xyzcompany.supabase.co')"},"supabase_service_key":{"type":"string","description":"Supabase Service Role Key (secret)"},"storage_bucket":{"type":"string","description":"Target Supabase storage bucket name (default: 'otnarp-memory-backup')"},"path_prefix":{"type":"string","description":"Subdirectory prefix inside bucket (default: 'memories/')"},"enabled":{"type":"boolean","description":"Enable or disable Supabase mirroring"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/trigger_cloud_mirror":{"post":{"tags":["MCP Tools"],"summary":"trigger_cloud_mirror","description":"Executes an immediate synchronization/mirror run replicating memories to the specified external provider (s3 or supabase).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["s3","supabase","all"],"description":"Target cloud provider to mirror to (default: 's3')"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_cloud_mirror_telemetry":{"post":{"tags":["MCP Tools"],"summary":"get_cloud_mirror_telemetry","description":"Returns current configuration status, last sync times, and execution history for S3 and Supabase cross-cloud backup mirroring.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"history_limit":{"type":"number","description":"Number of past mirror reports to return (default: 10)"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_project_architecture_file":{"post":{"tags":["MCP Tools"],"summary":"generate_project_architecture_file","description":"Autonomous Project Layout & Architecture Generator. Generates structured project directory layout, updates master output.txt, indexes historical architecture guidelines, and provides 85-95% token savings for AI model analysis.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name (defaults to '48_otnarp')."},"workspace_path":{"type":"string","description":"Absolute or relative local workspace path to scan (defaults to process.cwd())."},"include_file_tree":{"type":"boolean","description":"Whether to include hierarchical file and directory tree (default: true)."},"max_depth":{"type":"number","description":"Maximum directory traversal depth (default: 3)."},"sync_output_txt":{"type":"boolean","description":"Whether to automatically write and update root output.txt file (default: true)."},"sync_r2_blueprint":{"type":"boolean","description":"Whether to synchronize blueprint to Cloudflare R2 storage (default: true)."},"active_phase_summary":{"type":"string","description":"Optional summary of active development phase or newly built features."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/record_build_command_context":{"post":{"tags":["MCP Tools"],"summary":"record_build_command_context","description":"Tracks and understands every building command (npm run build, wrangler deploy, typecheck, test, etc.), relates it to past architecture guidelines, shows current scenario, and updates output.txt.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string","description":"The exact build or execution command (e.g. 'npm run build', 'npx wrangler deploy', 'npm run typecheck')."},"command_intent":{"type":"string","description":"Intent, purpose, or goal of running this command (e.g. 'Deploy updated worker to Cloudflare network')."},"phase_name":{"type":"string","description":"Target development phase or sprint name."},"target_environment":{"type":"string","enum":["local","cloudflare_workers","production","staging"],"description":"Target execution environment (default: 'local')."},"execution_status":{"type":"string","enum":["pending","running","success","failed"],"description":"Execution status of the command (default: 'running')."},"target_components":{"type":"array","items":{"type":"string"},"description":"List of subsystems or components affected by this build."},"output_logs":{"type":"string","description":"Optional summary of command output logs or errors."},"notes":{"type":"string","description":"Additional architectural notes or guidelines to remember."},"project_name":{"type":"string","description":"Target project name (defaults to '48_otnarp')."},"workspace_path":{"type":"string","description":"Workspace root path."},"sync_output_txt":{"type":"boolean","description":"Whether to update root output.txt with the active command scenario (default: true)."}},"required":["command"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_compact_project_context":{"post":{"tags":["MCP Tools"],"summary":"get_compact_project_context","description":"Ultra Token-Saver Project Context. Ingests current building process, historical architecture guidelines, tech stack, and layout in <1,500 tokens (saving 85-95% tokens compared to raw file scans).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name (defaults to '48_otnarp')."},"workspace_path":{"type":"string","description":"Workspace directory path."},"detail_level":{"type":"string","enum":["minimal","standard","comprehensive"],"description":"Level of detail to include (default: 'standard')."},"include_build_process":{"type":"boolean","description":"Include active build command status (default: true)."},"include_old_architecture":{"type":"boolean","description":"Include historical architecture guidelines of what was already built (default: true)."},"include_layout":{"type":"boolean","description":"Include layout structure and directory subsystem roles (default: true)."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_system_status":{"post":{"tags":["MCP Tools"],"summary":"get_system_status","description":"Returns health status, uptime, and system diagnostics for the enterprise MCP server.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_scope":{"type":"string"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/run_ctpat_audit":{"post":{"tags":["MCP Tools"],"summary":"run_ctpat_audit","description":"Triggers an asynchronous C-TPAT enterprise endpoint security compliance audit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"total_endpoints":{"type":"number"},"environment_scope":{"type":"string"}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_task_status":{"post":{"tags":["MCP Tools"],"summary":"get_task_status","description":"Queries the current status, progress, intermediate reasoning, and metrics of an async task.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"}},"required":["task_id"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/validate_bengali_nlp":{"post":{"tags":["MCP Tools"],"summary":"validate_bengali_nlp","description":"Validates Bengali (বাংলা) text for Unicode NFC normalization, broken conjuncts (যুক্তাক্ষর), grapheme cluster integrity, zero-width characters, and Banglish transliteration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"The Bengali text to analyze and validate."},"strict":{"type":"boolean","description":"If true, treats warnings as failure."}},"required":["text"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/verify_agent_handoff":{"post":{"tags":["MCP Tools"],"summary":"verify_agent_handoff","description":"Validates an ECC-standard cross-agent task handoff document to ensure seamless resumption, verified evidence, and zero secret leakage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handoff_content":{"type":"string","description":"The Markdown or text content of the agent handoff document."},"target_agent":{"type":"string","description":"Target receiving agent persona (e.g. 'code-reviewer', 'planner', 'security-reviewer')."}},"required":["handoff_content"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/reverse_engineer_codebase":{"post":{"tags":["MCP Tools"],"summary":"reverse_engineer_codebase","description":"Performs deep static code reverse engineering: Language detection, AST lexical structure extraction, call graph reconstruction, API endpoint discovery, data model extraction, obfuscation metrics, and interactive Mermaid architecture diagrams.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_code":{"type":"string","description":"Target source code snippet, file content, or deobfuscated payload to reverse engineer."},"language":{"type":"string","description":"Programming language hint (e.g. 'typescript', 'javascript', 'python', 'go', 'rust', 'c', 'cpp', 'java'). Auto-detected if omitted."},"target_aspect":{"type":"string","description":"Target focus aspect for reverse engineering: 'architecture', 'api_endpoints', 'data_models', 'state_machine', 'call_graph', 'security_audit', or 'deobfuscation'."},"user_intent_prompt":{"type":"string","description":"User's explicit reverse engineering intent or question to guide specific analysis."},"project_name":{"type":"string","description":"Optional project identifier to associate with the analysis."}},"required":["source_code"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/reverse_engineer_binary_format":{"post":{"tags":["MCP Tools"],"summary":"reverse_engineer_binary_format","description":"Inspects binary executable or container files (PE/COFF Windows .exe/.dll, ELF Linux, Mach-O macOS, WebAssembly .wasm, Android DEX, Java Class, ZIP archives). Analyzes magic headers, section tables, Shannon entropy per section for packing detection, and extracts ASCII/UTF-16 strings.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"binary_hex":{"type":"string","description":"Binary payload as a hexadecimal string (e.g. '4d 5a 90 00 ...' or continuous hex)."},"binary_base64":{"type":"string","description":"Binary payload as a Base64-encoded string."},"file_format_hint":{"type":"string","description":"Expected format hint: 'auto', 'pe', 'elf', 'macho', 'wasm', 'dex', 'archive'."},"extract_strings":{"type":"boolean","description":"Whether to extract printable string tables (default: true)."},"min_string_length":{"type":"number","description":"Minimum character length for extracted strings (default: 4)."},"calculate_entropy":{"type":"boolean","description":"Whether to compute Shannon entropy per section to detect packing or encryption (default: true)."}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/disassemble_bytecode":{"post":{"tags":["MCP Tools"],"summary":"disassemble_bytecode","description":"Disassembles raw binary machine code or virtual machine bytecode (x86, x64, ARM, ARM64, WebAssembly, Ethereum EVM, Dalvik DEX). Identifies function prologues/epilogues, partitions basic blocks, detects jumps and branches, and generates Control Flow Graphs (CFG) in Mermaid format.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hex_bytes":{"type":"string","description":"Hexadecimal byte stream representing instruction stream (e.g., '55 48 89 e5 48 83 ec 10')."},"architecture":{"type":"string","description":"Target instruction set architecture: 'x86', 'x64', 'arm', 'arm64', 'wasm', 'evm', 'dalvik'. (default: 'x64')"},"base_address":{"type":"string","description":"Hex base address offset for instruction labeling (default: '0x00400000')."},"detect_control_flow":{"type":"boolean","description":"Whether to generate basic block Control Flow Graph (CFG) and Mermaid diagram (default: true)."}},"required":["hex_bytes"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/reverse_engineer_protocol_payload":{"post":{"tags":["MCP Tools"],"summary":"reverse_engineer_protocol_payload","description":"Decodes binary network payloads and serialization protocols (Google Protocol Buffers / Protobuf wire format, Type-Length-Value / TLV, MessagePack, custom binary framing). Reconstructs wire field tags, wire types, and automatically synthesizes clean .proto schemas, TypeScript types, and C struct definitions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload_hex":{"type":"string","description":"Raw wire packet in hexadecimal format (e.g., '08 96 01 12 07 74 65 73 74 69 6e 67')."},"payload_base64":{"type":"string","description":"Raw wire packet in Base64 format."},"protocol_hint":{"type":"string","description":"Expected serialization protocol hint: 'auto', 'protobuf', 'tlv', 'custom_binary', 'msgpack'."},"infer_schema":{"type":"boolean","description":"Whether to automatically synthesize .proto schema and TypeScript interfaces (default: true)."}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_reverse_engineering_plan":{"post":{"tags":["MCP Tools"],"summary":"synthesize_reverse_engineering_plan","description":"Synthesizes an enterprise 4-phase reverse engineering methodology and tactical execution plan tailored to a specific binary, protocol, or application target. Outlines reconnaissance, static disassembly, dynamic analysis, and interoperability verification while adhering to defensive software engineering principles.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_description":{"type":"string","description":"Detailed description of the target system, firmware, executable, or protocol."},"user_prompt":{"type":"string","description":"The user's specific reverse engineering goals, constraints, or questions."},"artifacts_available":{"type":"array","items":{"type":"string"},"description":"Available artifacts for analysis: ['source', 'binary', 'network_dumps', 'api_docs', 'firmware']."},"objective":{"type":"string","description":"Primary objective: 'interoperability', 'security_audit', 'legacy_migration', 'protocol_clone', 'data_extraction'."}},"required":["target_description","user_prompt"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/detect_crypto_primitives":{"post":{"tags":["MCP Tools"],"summary":"detect_crypto_primitives","description":"Scans binary buffers, hex streams, or source code for cryptographic primitives and constants: AES Forward & Inverse S-Boxes, Rijndael Rcon schedules, SHA-256 and SHA-512 initial hash constants, MD5 initial vectors, ChaCha20/Salsa20 matrix constants ('expand 32-byte k'), CRC32 polynomials, Base58/Base64 alphabets, and performs automated single-byte XOR key brute force frequency analysis.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_hex":{"type":"string","description":"Target binary payload as a hex string to scan for cryptographic constants."},"target_text":{"type":"string","description":"Target source code or text buffer to scan for cryptographic constants."}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/deobfuscate_code_payload":{"post":{"tags":["MCP Tools"],"summary":"deobfuscate_code_payload","description":"Deobfuscates, normalizes, and simplifies obfuscated JavaScript, TypeScript, or Python code. Inlines and de-rotates string arrays, decodes hex/unicode string escapes, folds constants and booleans, prunes dead branches, generates variable rename maps, and produces tailored prompt payloads for Gemini, ChatGPT, and Claude.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"obfuscated_code":{"type":"string","description":"The obfuscated source code or snippet to unpack and normalize."},"language":{"type":"string","description":"Programming language hint: 'javascript', 'typescript', 'python', 'generic'. (default: 'javascript')"},"target_model":{"type":"string","description":"Target AI model for tailored synthesis: 'gemini', 'chatgpt', 'claude', 'deepseek', 'generic'. (default: 'gemini')"},"resolve_hex_strings":{"type":"boolean","description":"Whether to decode \\x and \\u escape sequences into printable strings (default: true)."},"derotate_string_arrays":{"type":"boolean","description":"Whether to inline string array pools and resolve accessor functions (default: true)."},"fold_constants":{"type":"boolean","description":"Whether to fold boolean expressions and static arithmetic (default: true)."},"clean_dead_branches":{"type":"boolean","description":"Whether to prune dead conditions like if(false) or if(0) (default: true)."}},"required":["obfuscated_code"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/decompile_bytecode_to_pseudocode":{"post":{"tags":["MCP Tools"],"summary":"decompile_bytecode_to_pseudocode","description":"Decompiles raw machine code (x86, x64, ARM, EVM) into high-level structured C pseudocode and Python equivalent logic. Reconstructs stack frame variables, translates low-level jump conditions into if/else branches and loops, and synthesizes model-specific system prompts for Gemini, ChatGPT, and Claude to generate cleanroom reimplementations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hex_bytes":{"type":"string","description":"Hexadecimal byte stream of instructions to decompile (e.g. '55 48 89 e5 48 83 ec 20 ...')."},"architecture":{"type":"string","description":"Target architecture: 'x86', 'x64', 'arm', 'arm64', 'wasm', 'evm'. (default: 'x64')"},"function_name":{"type":"string","description":"Symbolic name for the reconstructed function (default: 'sub_recovered_func')."},"target_model":{"type":"string","description":"Target AI model: 'gemini', 'chatgpt', 'claude', 'generic'. (default: 'gemini')"},"base_address":{"type":"string","description":"Hex base address (default: '0x00401000')."}},"required":["hex_bytes"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_design_system_tokens":{"post":{"tags":["MCP Tools"],"summary":"generate_design_system_tokens","description":"Generates production-grade UI design system tokens following strict visual standards: 12-tier spacing scale (2px to 96px), mathematical nested radii (R_inner = R_outer - padding), fluid typography scales, layered dark/light surface palettes, and physics-based motion curves. Outputs CSS custom properties, Tailwind configuration, or JSON tokens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"string","description":"Design theme: 'dark_cyber', 'sleek_minimal', 'glassmorphic_neon', 'luxury_editorial', 'corporate_clean'. (default: 'dark_cyber')"},"primary_color_hex":{"type":"string","description":"Optional custom brand primary color (e.g. '#6366f1')."},"font_heading":{"type":"string","description":"Optional custom heading font from vetted whitelist (e.g. 'Plus Jakarta Sans', 'Geist', 'Manrope')."},"format":{"type":"string","description":"Token output format: 'css_variables', 'tailwind_config', 'json_tokens'. (default: 'css_variables')"}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/audit_ui_design_and_accessibility":{"post":{"tags":["MCP Tools"],"summary":"audit_ui_design_and_accessibility","description":"Audits any HTML, CSS, React, or Vue component for UI/UX anti-patterns and WCAG accessibility: flags banned AI slop buzzwords ('seamless', 'elevate', 'game-changer'), un-vetted fonts, arbitrary margins/paddings not in the 12-tier scale, insufficient contrast (<4.5:1), and un-nested radii. Delivers a numeric quality score (0-100) and actionable CSS fixes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code_snippet":{"type":"string","description":"HTML, CSS, or React/JSX code to analyze and audit."},"text_color_hex":{"type":"string","description":"Optional text hex color to verify WCAG 2.1 AA/AAA contrast (e.g. '#94a3b8')."},"background_color_hex":{"type":"string","description":"Optional background surface hex color (e.g. '#090d16')."}},"required":["code_snippet"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_ui_component":{"post":{"tags":["MCP Tools"],"summary":"synthesize_ui_component","description":"Synthesizes high-converting, state-of-the-art UI components adhering to the strict visual system: Hero Sections with announcement badges and trust metrics, Bento Grid feature matrices, Pricing Tables with monthly/annual toggles, Glass Sticky Navbars, FAQ Accordions, and CTA Banners. Zero placeholders, rich typography, and fluid CSS micro-animations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"component_type":{"type":"string","description":"Target component: 'hero_section', 'bento_grid', 'pricing_table', 'glass_navbar', 'faq_accordion', 'cta_banner', 'testimonial_card'."},"title":{"type":"string","description":"Main heading or value proposition."},"tagline":{"type":"string","description":"Supporting explanation or proof subheadline."},"cta_text":{"type":"string","description":"Primary action label (e.g. 'Deploy Edge Cluster →')."},"theme":{"type":"string","description":"Theme styling: 'dark_cyber', 'sleek_minimal', 'glassmorphic_neon', 'luxury_editorial', 'corporate_clean'. (default: 'dark_cyber')"}},"required":["component_type"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/synthesize_landing_page_blueprint":{"post":{"tags":["MCP Tools"],"summary":"synthesize_landing_page_blueprint","description":"Synthesizes a complete high-converting landing page blueprint combining Part A (Conversion Strategy, Single Intent Mandate, UVP Headlines, Objection Busters, and Anti-Slop Copywriting) and Part B (Visual System, Typography scales, 12-tier Spacing, and 7-part Page Layout Sequence).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"product_name":{"type":"string","description":"Name of the product, service, or platform."},"target_audience":{"type":"string","description":"Ideal Customer Profile / audience (e.g. 'Full-Stack Developers building AI agents')."},"primary_action":{"type":"string","description":"Single measurable primary action (e.g. 'Start Free Trial', 'Book 15-min Demo')."},"core_problem":{"type":"string","description":"Primary pain point or status-quo alternative (e.g. 'high latency and context fragmentation')."},"theme":{"type":"string","description":"Theme preset: 'dark_cyber', 'sleek_minimal', 'glassmorphic_neon', 'luxury_editorial', 'corporate_clean'. (default: 'dark_cyber')"}},"required":["product_name","target_audience","primary_action","core_problem"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/redesign_amateur_interface":{"post":{"tags":["MCP Tools"],"summary":"redesign_amateur_interface","description":"Transforms raw, bland, or amateur HTML/CSS into an elite, high-converting interface. Strips un-vetted fonts and flat white/black backgrounds, applies the 12-tier spacing scale, injects glassmorphic surfaces with backdrop blur, and fixes contrast to exceed WCAG 2.1 AA.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"raw_code":{"type":"string","description":"Raw HTML or CSS markup of the amateur interface to upgrade."},"target_theme":{"type":"string","description":"Theme preset: 'dark_cyber', 'sleek_minimal', 'glassmorphic_neon', 'luxury_editorial', 'corporate_clean'. (default: 'dark_cyber')"}},"required":["raw_code"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/map_attack_surface":{"post":{"tags":["MCP Tools"],"summary":"map_attack_surface","description":"Inventories external interfaces, endpoints, data sinks, and trust boundaries inspired by Cloudflare's security audit skill. Analyzes code for public HTTP routes, RPC methods, SQL/D1 query sinks, outbound fetch calls (SSRF risks), command execution, and environment secret accesses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code_content":{"type":"string","description":"Source code snippet, API router file, or configuration to map."},"file_name":{"type":"string","description":"Optional filename or relative path being audited (e.g. 'src/routes/api.ts')."},"endpoints":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"method":{"type":"string"},"auth":{"type":"boolean"}}},"description":"Optional explicit list of endpoints with HTTP method and authentication status."}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/manage_audit_ledger":{"post":{"tags":["MCP Tools"],"summary":"manage_audit_ledger","description":"Manages durable coverage tracking (PENDING -> IN_PROGRESS -> AUDITED / EXEMPT) conforming to Cloudflare's file-backed audit ledger methodology. Tracks audit depth (surface_scan, dataflow_trace, deep_ast_audit), logs findings count per symbol, and computes completion percentage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["init","update_entry","get_summary","get_pending","mark_exempt"],"description":"Ledger action to execute."},"project_name":{"type":"string","description":"Name of the audited project (e.g. '48_otnarp')."},"audit_id":{"type":"string","description":"Unique audit identifier (defaults to project_name)."},"entry":{"type":"object","properties":{"target_file":{"type":"string"},"symbol_or_endpoint":{"type":"string"},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","AUDITED","EXEMPT"]},"depth":{"type":"string","enum":["surface_scan","dataflow_trace","deep_ast_audit"]},"findings_count":{"type":"number"},"auditor_notes":{"type":"string"}},"description":"Ledger target entry for 'update_entry' or 'mark_exempt'."},"targets":{"type":"array","items":{"type":"object","properties":{"target_file":{"type":"string"},"symbol_or_endpoint":{"type":"string"},"depth":{"type":"string"}}},"description":"List of targets to populate during 'init'."}},"required":["action"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/adversarial_validate_vulnerability":{"post":{"tags":["MCP Tools"],"summary":"adversarial_validate_vulnerability","description":"Executes Cloudflare's Adversarial Validation Protocol on candidate vulnerability hypotheses. Actively searches for upstream schema validators (Zod), type guards, auth middleware, edge runtime sandboxing, or parameterized query bindings to disprove false positives before reporting.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vulnerability_title":{"type":"string","description":"Candidate vulnerability title (e.g. 'Potential SQL Injection in User Lookup')."},"cwe_id":{"type":"string","description":"CWE identifier (e.g. 'CWE-89', 'CWE-918', 'CWE-287', 'CWE-385', 'CWE-400')."},"target_file":{"type":"string","description":"File path containing the suspected vulnerability."},"sink_snippet":{"type":"string","description":"Exact code snippet of the data sink (e.g. 'db.prepare(`SELECT * FROM ${user}`).all()')."},"source_snippet":{"type":"string","description":"Optional code snippet where untrusted user input enters."},"context_code":{"type":"string","description":"Surrounding code, router handlers, middleware stack, or schema definitions to test against."},"claimed_severity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"],"description":"Initial hypothesis severity claim."}},"required":["vulnerability_title","cwe_id","target_file","sink_snippet","context_code"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/calculate_cvss_score":{"post":{"tags":["MCP Tools"],"summary":"calculate_cvss_score","description":"Calculates the Common Vulnerability Scoring System (CVSS) v3.1 Base Score, severity rating, and vector string conforming to FIRST standards. Supports calculating from individual metrics (AV, AC, PR, UI, S, C, I, A) or parsing an existing CVSS:3.1 vector string.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vector_string":{"type":"string","description":"Optional existing CVSS:3.1 vector string to parse and calculate (e.g. 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N')."},"metrics":{"type":"object","properties":{"av":{"type":"string","enum":["N","A","L","P"],"description":"Attack Vector: Network (N), Adjacent (A), Local (L), Physical (P)"},"ac":{"type":"string","enum":["L","H"],"description":"Attack Complexity: Low (L), High (H)"},"pr":{"type":"string","enum":["N","L","H"],"description":"Privileges Required: None (N), Low (L), High (H)"},"ui":{"type":"string","enum":["N","R"],"description":"User Interaction: None (N), Required (R)"},"scope":{"type":"string","enum":["U","C"],"description":"Scope: Unchanged (U), Changed (C)"},"c":{"type":"string","enum":["N","L","H"],"description":"Confidentiality Impact: None (N), Low (L), High (H)"},"i":{"type":"string","enum":["N","L","H"],"description":"Integrity Impact: None (N), Low (L), High (H)"},"a":{"type":"string","enum":["N","L","H"],"description":"Availability Impact: None (N), Low (L), High (H)"}},"description":"Individual CVSS v3.1 metrics if vector_string is not provided."}},"required":[]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/generate_sarif_security_report":{"post":{"tags":["MCP Tools"],"summary":"generate_sarif_security_report","description":"Generates schema-compliant OASIS SARIF v2.1.0 JSON report conforming to GitHub Advanced Security and CI/CD code scanning specifications. Ingests confirmed vulnerability findings, rules, CWE mappings, file positions, and remediation diffs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tool_name":{"type":"string","description":"Scanner / auditor tool name (defaults to '48_otnarp-security-auditor')."},"tool_version":{"type":"string","description":"Auditor tool version (defaults to '3.4.0')."},"project_uri":{"type":"string","description":"Repository or project URI."},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"rule_id":{"type":"string"},"rule_name":{"type":"string"},"message":{"type":"string"},"level":{"type":"string","enum":["error","warning","note"]},"cwe_id":{"type":"string"},"file_path":{"type":"string"},"start_line":{"type":"number"},"end_line":{"type":"number"},"code_snippet":{"type":"string"},"remediation":{"type":"string"}},"required":["id","rule_id","rule_name","message","level","file_path","start_line"]},"description":"List of confirmed security audit findings to export in SARIF format."}},"required":["findings"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/control_ai_model":{"post":{"tags":["MCP Tools"],"summary":"control_ai_model","description":"Administer and govern connected AI models (Google Gemini, Claude Desktop, Antigravity IDE, ChatGPT Actions, Ollama). Enables 1-click kill-switch pausing, resuming, token budget caps, and domain isolation permissions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model_name":{"type":"string","description":"Target model identifier (e.g. 'google_gemini', 'claude_desktop', 'antigravity_ide', 'chatgpt_actions', 'ollama_local')"},"action":{"type":"string","enum":["pause","resume","set_limits","set_domains"],"description":"Governance action to perform"},"domain_access":{"type":"array","items":{"type":"string","enum":["office","personal","others"]},"description":"List of allowed domains for this model ('office', 'personal', 'others')"},"max_tokens_per_req":{"type":"number","description":"Maximum tokens allowed per request/context window"},"max_rpm":{"type":"number","description":"Maximum allowed requests per minute (rate limit cap)"},"system_prompt_hint":{"type":"string","description":"Custom system steering hint injected into model sessions"}},"required":["model_name","action"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/get_ai_model_status":{"post":{"tags":["MCP Tools"],"summary":"get_ai_model_status","description":"Retrieves real-time governance status, active domain permissions, rate limits, token usage telemetry, and kill-switch states for all connected AI models.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model_name":{"type":"string","description":"Optional model name filter. If omitted, returns status for all models."}}}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/cross_model_consensus_review":{"post":{"tags":["MCP Tools"],"summary":"cross_model_consensus_review","description":"Executes multi-model consensus review. Enables an AI model (e.g. Gemini) to propose a major code/architecture change and automatically request peer review from other models (e.g. Claude, Antigravity) before execution.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"proposal_title":{"type":"string","description":"Title of the proposal or architectural change"},"proposal_content":{"type":"string","description":"Detailed Markdown diff, architecture plan, or configuration"},"proposing_model":{"type":"string","description":"Model name making the proposal (e.g. 'google_gemini')"},"reviewing_models":{"type":"array","items":{"type":"string"},"description":"List of peer models requested to review (e.g. ['claude_desktop', 'antigravity_ide'])"},"project_name":{"type":"string","description":"Target project"},"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition"}},"required":["proposal_title","proposal_content","proposing_model","reviewing_models"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/post_swarm_blackboard_update":{"post":{"tags":["MCP Tools"],"summary":"post_swarm_blackboard_update","description":"Posts findings, decisions, open questions, and task handoffs to the shared Swarm Blackboard so multiple AI models (Gemini, Claude, Antigravity) collaborate smoothly without conflicts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","enum":["office","personal","others"],"description":"Domain partition ('office', 'personal', 'others')"},"project_name":{"type":"string","description":"Target project name"},"author_model":{"type":"string","description":"Name of the posting model (e.g. 'antigravity_ide', 'gemini')"},"topic":{"type":"string","description":"Topic or workstream (e.g. 'auth_migration', 'api_performance')"},"findings":{"type":"string","description":"Interim discoveries, code locations, or investigation notes"},"decisions":{"type":"array","items":{"type":"string"},"description":"Decisions finalized during this turn"},"open_questions":{"type":"array","items":{"type":"string"},"description":"Unresolved questions for peer models"},"tasks":{"type":"array","items":{"type":"object","properties":{"task_id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED"]},"assigned_model":{"type":"string"}},"required":["task_id","title","status"]},"description":"Task items assigned or updated"}},"required":["project_name","author_model","topic","findings"]}}}},"responses":{"200":{"description":"Tool execution result"}}}},"/api/tools/read_swarm_blackboard":{"post":{"tags":["MCP Tools"],"summary":"read_swarm_blackboard","description":"Reads shared scratchpad findings, architectural decisions, and active task handoffs posted by peer AI models on the Swarm Blackboard.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string","description":"Target project name"},"topic":{"type":"string","description":"Optional topic filter"}},"required":["project_name"]}}}},"responses":{"200":{"description":"Tool execution result"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Enter your MCP Server Authorization Secret"}}},"security":[{"BearerAuth":[]}]}