Skip to content

fix: use service alias in MCP tool names for aliased services#224

Closed
Bortlesboat wants to merge 1 commit intogoogleworkspace:mainfrom
Bortlesboat:fix/mcp-aliased-service-names
Closed

fix: use service alias in MCP tool names for aliased services#224
Bortlesboat wants to merge 1 commit intogoogleworkspace:mainfrom
Bortlesboat:fix/mcp-aliased-service-names

Conversation

@Bortlesboat
Copy link

Summary

Test plan

  • Configure an aliased service (e.g., events for workspaceevents)
  • Run tools/list and verify tool names use the alias
  • Call a tool and verify it resolves correctly

🤖 Generated with Claude Code

Fixes googleworkspace#162 — when services are aliased (e.g., events, apps-script, admin-reports),
build_tools_list used the Discovery document's internal name instead of the
user-configured alias, causing tools/list to return names that handle_tools_call
couldn't match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: 370e747

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug where tools associated with aliased services were not correctly recognized due to a discrepancy in how their names were generated and validated. By standardizing the tool name prefix to use the service alias, the change ensures that all configured services, including those with custom aliases, function as expected within the system's tool handling mechanism.

Highlights

  • Tool Name Resolution Fix: Corrected an issue where the build_tools_list function used the Discovery document's internal name (doc.name) as the tool name prefix, leading to mismatches with user-configured service aliases. The function now uses the service alias (svc_name) to ensure tool names align with what the handle_tools_call function expects.
  • Service Alias Support: Enhanced support for aliased services by ensuring that tools generated from Discovery documents correctly reflect the user-defined aliases, resolving a bug where tools for aliased services were not properly recognized.
Changelog
  • src/mcp_server.rs
    • Updated the walk_resources function call to use the service alias (svc_name) instead of the Discovery document's internal name (doc.name) when building the list of tools.
Activity
  • The pull request was generated with Claude Code.
  • A test plan has been outlined, including steps to configure an aliased service, verify tool names, and confirm correct tool resolution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla
Copy link

google-cla bot commented Mar 6, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug in the Model Context Protocol (MCP) server where tool names for aliased services were being generated incorrectly. By using the service alias (svc_name) instead of the discovery document's internal name (doc.name) as the prefix for tool names, the change ensures that generated tools can be correctly validated and executed by handle_tools_call. The fix is well-targeted and resolves the issue for aliased services in 'full' tool mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tools/list returns uncallable tool names for aliased services (events, apps-script, admin-reports)

3 participants