Skip to content

Switch MCP tool names from underscore to hyphen separator #235

@jpoehnelt

Description

@jpoehnelt

Problem

MCP tool names use underscores as separators: drive_files_list. This is ambiguous when services or resources contain underscores (e.g., admin_reports_activities_list — is admin or admin_reports the service?). Additionally, tools/list used Discovery doc names while tools/call validated against configured aliases (#162).

MCP Spec Constraints

  • Max 64 characters
  • Must start with a letter
  • Only lowercase letters and hyphens allowed
  • Dots are NOT allowed per spec
  • Underscores are used in ecosystem but not mandated

Proposal

Switch from underscore to hyphen as the hierarchy separator:

Before:  drive_files_list              (ambiguous with split("_"))
After:   drive-files-list              (unambiguous with split("-"))

Hyphens are safe because Google API service/resource names contain underscores and dots but never hyphens, so - is an unambiguous separator. Parsing becomes tool_name.splitn(3, "-").

Changes required

  1. build_tools_list — join service, resource, method with - instead of _
  2. handle_tools_call — split on - instead of _
  3. Use configured service alias (not Discovery doc name) as prefix
  4. Update compact mode tool naming to match

Breaking change

This changes all MCP tool names. Since the MCP ecosystem is early and tool names are dynamically discovered via tools/list, this should be transparent to well-behaved clients.

Consolidates

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions