From 36d7c0b01e9e5a01f079784e4bf9f052c974c91e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 11 Feb 2026 22:43:50 +0200 Subject: feat: add MCP Tools support for prompt management Implements tools/list and tools/call endpoints to expose prompt management operations (create, update, delete) as callable MCP tools. This enables Claude to use the meta-prompts (save_prompt, update_prompt) to actually create and modify prompts. Key changes: - Add Tool type definitions (Tool, ListToolsRequest, CallToolRequest, etc.) - Implement handleToolsList() returning 3 tools with JSON Schemas - Implement handleToolsCall() with tool wrappers for create/update/delete - Add 17 comprehensive unit tests (82.8% coverage maintained) - Update meta-prompts to reference tools instead of JSON-RPC methods - Enable listChanged notifications for immediate prompt availability - Refactor large functions into helpers to stay under 50-line limit Tools advertised alongside Prompts capability. All functions under 50 lines. Backward compatible - existing prompts/* JSON-RPC methods unchanged. Co-Authored-By: Claude Sonnet 4.5 --- internal/promptstore/default_prompts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/promptstore') diff --git a/internal/promptstore/default_prompts.go b/internal/promptstore/default_prompts.go index ea8c793..09a998a 100644 --- a/internal/promptstore/default_prompts.go +++ b/internal/promptstore/default_prompts.go @@ -43,7 +43,7 @@ Please help me by: - What tags would help categorize it - Whether multi-turn messages are needed 3) Showing me a complete preview of the prompt structure in a code block -4) Only after I approve, use the MCP prompts/create method to save it +4) Only after I approve, use the create_prompt tool to save it IMPORTANT FORMATTING RULES for clarifying questions: - Use numbered questions: 1), 2), 3) @@ -104,11 +104,11 @@ Start by examining our conversation and asking your clarifying questions using t Text: `I want to update the existing prompt '{{prompt_name}}'. Please help me by: -1) First, retrieve the current prompt using prompts/get to show me what exists +1) First, show me the current prompt (you can access it via the prompts capability) 2) Ask me what changes I want to make (description, arguments, messages, tags) 3) If I reference content from our current conversation, help extract and template it 4) Show me a complete preview of the updated prompt with changes highlighted -5) Only after I approve, use the MCP prompts/update method to save the changes +5) Only after I approve, use the update_prompt tool to save the changes IMPORTANT FORMATTING RULES for clarifying questions: - Use numbered questions: 1), 2), 3) -- cgit v1.2.3