Skip to content

fix(genkit-tools/mcp): Add docs to top-level tool descriptions#4416

Closed
ssbushi wants to merge 1 commit intomainfrom
sb/mcpDocsUpdates
Closed

fix(genkit-tools/mcp): Add docs to top-level tool descriptions#4416
ssbushi wants to merge 1 commit intomainfrom
sb/mcpDocsUpdates

Conversation

@ssbushi
Copy link
Contributor

@ssbushi ssbushi commented Feb 3, 2026

Before:
image

After:
image

Checklist (if applicable):

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ssbushi, 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 significantly improves the discoverability and usability of Genkit tools by automatically augmenting their descriptions with details about their expected input parameters. This change streamlines the process for users to understand how to interact with each tool without needing to inspect the full schema separately, thereby enhancing the overall developer experience.

Highlights

  • New Utility Function: Introduced a new enrichToolDescription utility function in genkit-tools/cli/src/mcp/utils.ts that dynamically generates more informative tool descriptions by appending details about their input schema arguments.
  • Enhanced Tool Descriptions: Applied the enrichToolDescription function to various Genkit tools, including lookup_genkit_docs, list_flows, run_flow, start_runtime, kill_runtime, restart_runtime, get_trace, and get_usage_guide, to automatically include their input schema arguments in their top-level descriptions.
  • Input Schema Refactoring: Refactored the definition of inputSchema objects for several tools, moving them into separate constants. This improves readability, reusability, and facilitates their use with the new enrichToolDescription function.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • genkit-tools/cli/src/mcp/docs.ts
    • Imported enrichToolDescription from ./utils.js.
    • Updated the lookup_genkit_docs tool to use enrichToolDescription for its description.
    • Refactored the inputSchema definition for lookup_genkit_docs into a separate constant.
  • genkit-tools/cli/src/mcp/flows.ts
    • Imported enrichToolDescription from ./utils.js.
    • Modified list_flows and run_flow tools to utilize enrichToolDescription for their descriptions.
    • Extracted the inputSchema definitions for list_flows and run_flow into separate constants.
  • genkit-tools/cli/src/mcp/runtime.ts
    • Imported enrichToolDescription from ./utils.js.
    • Applied enrichToolDescription to start_runtime, kill_runtime, and restart_runtime tools' descriptions.
    • Refactored the inputSchema definitions for start_runtime, kill_runtime, and restart_runtime into separate constants.
  • genkit-tools/cli/src/mcp/trace.ts
    • Imported enrichToolDescription from ./utils.js.
    • Integrated enrichToolDescription into the get_trace tool's description.
    • Refactored the inputSchema definition for get_trace into a separate constant.
  • genkit-tools/cli/src/mcp/usage.ts
    • Imported enrichToolDescription from ./utils.js.
    • Updated the get_usage_guide tool to use enrichToolDescription for its description.
    • Separated the inputSchema definition for get_usage_guide into a constant.
  • genkit-tools/cli/src/mcp/utils.ts
    • Added a new constant PROJECT_ROOT_DESCRIPTION for consistent project root descriptions.
    • Implemented the enrichToolDescription function, which takes a base description and a Zod schema, and returns an enriched description including argument details.
Activity
  • The pull request was opened by ssbushi.
  • No further human activity (comments, reviews, or progress updates) has been recorded since its creation.
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 Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 introduces a consistent way to enrich tool descriptions with information from their input schemas. A new enrichToolDescription utility function has been added for this purpose, and it's used across various tool definitions (docs, flows, runtime, trace, usage). This refactoring improves code clarity and maintainability by centralizing the logic for generating tool descriptions. My review includes a suggestion to improve the formatting of the generated argument descriptions for better readability.

Comment on lines +47 to +56
const args = Object.entries(schema)
.map(([key, value]) => {
const desc = value.description;
return desc ? `${key}: ${desc}` : key;
})
.join('; ');

if (args.length === 0) return baseDescription;

return `${baseDescription} Arguments: ${args}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current implementation joins argument descriptions with a semicolon, which can be hard to read, especially with longer descriptions. Using a markdown list would improve readability for both developers and LLMs that might consume this description.

This change formats the arguments as a markdown list, which is clearer and more structured.

  const entries = Object.entries(schema);
  if (entries.length === 0) {
    return baseDescription;
  }

  const argsList = entries
    .map(([key, value]) => {
      const desc = value.description;
      return `\n- ${key}${desc ? `: ${desc}` : ''}`;
    })
    .join('');

  return `${baseDescription}\n\nArguments:${argsList}`;

@ssbushi ssbushi requested a review from pavelgj February 3, 2026 18:37
@ssbushi ssbushi closed this Feb 5, 2026
@ssbushi
Copy link
Contributor Author

ssbushi commented Feb 5, 2026

This change is no longer needed with the new MCP tools refactor.

@ssbushi ssbushi deleted the sb/mcpDocsUpdates branch February 5, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant