From b1299021cd4031bf5430adcdbb1b139a8d1c3eb0 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Fri, 23 Oct 2026 17:03:35 +0200 Subject: [PATCH] fix: draft_post prompt is offered only to grants that may write The prompt directs journal_create_post, so it carries pact.MCPPrompt.Writes and pier hides it from read-only grants. --- README.md | 2 +- mcp.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4dea210..39bc96a 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ With the framework's MCP endpoint mounted (`summer.yaml` `build.tags: [summercms | `journal_update_post` | `PUT /_journal/api/v1/posts/{id}` | `id` and any of the create fields; only the fields sent change | | `journal_delete_post` | `DELETE /_journal/api/v1/posts/{id}` | `id` (destructive) | -The prompt `journal_draft_post` (arguments `topic`, required, and `tone`) asks the agent to draft a post, reuse existing categories and tags and save it with `journal_create_post` as a draft. A grant without the `write` scope lists only the read tools. Publishing still needs `golem15.journal.access_publish` and editing another author's post `golem15.journal.access_other_posts`; the route answers its usual error body, which the agent receives as the tool error. The media and featured-image uploads (multipart) are not tools. +The prompt `journal_draft_post` (arguments `topic`, required, and `tone`) asks the agent to draft a post, reuse existing categories and tags and save it with `journal_create_post` as a draft; it is marked `Writes`, so it is offered only to grants that may write. A grant without the `write` scope lists only the read tools and no prompt. Publishing still needs `golem15.journal.access_publish` and editing another author's post `golem15.journal.access_other_posts`; the route answers its usual error body, which the agent receives as the tool error. The media and featured-image uploads (multipart) are not tools. ### Blog Editor diff --git a/mcp.go b/mcp.go index 02d91db..a205445 100644 --- a/mcp.go +++ b/mcp.go @@ -157,6 +157,9 @@ func (p *Plugin) MCP() pact.MCP { Description: "Drafts a Journal post on a topic and saves it as a draft.", Guard: mcpGuard, Permissions: []string{mcpAccessPosts}, + // It directs journal_create_post, so a read-only grant does + // not see it. + Writes: true, Arguments: []pact.MCPPromptArgument{ {Name: "topic", Description: "what the post is about", Required: true}, {Name: "tone", Description: "the tone of voice, for example friendly or formal"},