Skip to content

Implement Dynamic 'Tool Profiles' for MCP Server #20

@krisrowe

Description

@krisrowe

Goal

Optimize tool availability when running GWSA alongside other extensions (e.g., Google's official extension) to avoid redundancy and context clutter.

Problem

Currently, GWSA exposes all tools (Docs, Gmail, Drive). Some of these (like Docs) support only plain text, whereas official extensions support Rich Text (Markdown). Running both results in confusing tool overlap. However, we cannot simply disable GWSA because its Multi-Profile capability is unique and essential for managing secondary accounts.

Proposed Solution: Tool Profiles

Introduce a GWSA_TOOL_PROFILE environment variable to control tool registration at startup.

Profile: standard (Default)

  • Target: Standalone usage, Claude Code.
  • Behavior: Registers ALL tools.

Profile: extension-complement

  • Target: Environments with the Official Extension installed.
  • Behavior:
    • Disable: Docs tools (create_google_doc, etc.) to avoid inferior plain-text output.
    • Keep: Gmail, Drive, Chat, Identity (Profiles).
    • Guidance: Enhance docstrings for Gmail/Drive tools to hint: "Use primarily for SECONDARY profiles. For primary account, prefer official tools."

Configuration

  • Runtime: Read GWSA_TOOL_PROFILE from env.
  • User Pref: Add mcp.primary_email to config.yaml to allow specific docstring hints (e.g., "For primary account (user@example.com)...").

Implementation Tasks

  1. Add mcp.primary_email to default config schema.
  2. Refactor server.py to implement dynamic registration logic based on the profile env var.
  3. Implement the docstring decorator for usage hints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions