Add chat.spaces.readonly scope for listing spaces

The list_spaces tool was using chat.messages.readonly which is overly
broad for simply enumerating available spaces. This adds the
chat.spaces.readonly scope and uses it for list_spaces, following the
principle of least privilege.

Closes #479

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Seth Ladd
2026-02-17 20:58:08 -08:00
parent d4bbd6db1c
commit d964324e5d
3 changed files with 6 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
@server.tool()
@require_google_service("chat", "chat_read")
@require_google_service("chat", "chat_spaces_readonly")
@handle_http_errors("list_spaces", service_type="chat")
async def list_spaces(
service,