Skip to content

fix: correct invalid Gemini CLI tool names in agents and docs#35

Merged
Jamkris merged 4 commits intomainfrom
fix/agent-invalid-tool-names
Apr 22, 2026
Merged

fix: correct invalid Gemini CLI tool names in agents and docs#35
Jamkris merged 4 commits intomainfrom
fix/agent-invalid-tool-names

Conversation

@Jamkris
Copy link
Copy Markdown
Owner

@Jamkris Jamkris commented Apr 22, 2026

Replace search_files with search_file_content and replace_in_file with replace across all agent frontmatter and documentation. These were not valid Gemini CLI built-in tool names and caused agent loading failures at startup (validation error: tools.N: Invalid tool name).

The terminology tables in docs/ that mapped Claude Code tools to Gemini CLI equivalents were the source of the incorrect names, which had propagated into 18 agent files.

Fixes #34

Summary by CodeRabbit

  • Chores

    • Added repository-wide configuration for automated, incremental code reviews with an assertive, bug/security-first tone; enabled early-access/free-tier behavior, chat auto-replies, labeling rules, path filters, and security/style checks (shellcheck, gitleaks, markdownlint, eslint).
    • Standardized internal tool names and capabilities across agent configurations for consistent behavior.
  • Documentation

    • Updated contributor and agent docs and mapping tables to reflect the new tool name mappings and guidance.

Replace `search_files` with `search_file_content` and `replace_in_file`
with `replace` across all agent frontmatter and documentation.
These were not valid Gemini CLI built-in tool names and caused agent
loading failures at startup (validation error: `tools.N: Invalid tool name`).

The terminology tables in docs/ that mapped Claude Code tools to
Gemini CLI equivalents were the source of the incorrect names, which
had propagated into 18 agent files.

Fixes #34
@Jamkris Jamkris force-pushed the fix/agent-invalid-tool-names branch from efc1312 to 01892d0 Compare April 22, 2026 04:08
gemini-code-assist[bot]

This comment was marked as low quality.

gemini-code-assist[bot]

This comment was marked as low quality.

…ames

Ignore auto-review on release/version-bump PRs via ignore_title_keywords.
Add path_instructions for agents/**/*.md that explicitly restrict the
frontmatter `tools:` array to valid Gemini CLI tool names, preventing
the class of bug reported in #34 from being reintroduced.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a3adcc5-2829-4e31-b43e-0903b0046139

📥 Commits

Reviewing files that changed from the base of the PR and between 674dc6f and 440509f.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • agents/chief-of-staff.md

Walkthrough

Adds a new .coderabbit.yaml CodeRabbit configuration and updates many agent frontmatter/tool names (search_filessearch_file_content, replace_in_filereplace), plus documentation mapping updates; some agents also gained MCP Slack tool entries. No runtime code or exported APIs changed.

Changes

Cohort / File(s) Summary
CodeRabbit config
\.coderabbit.yaml
New CodeRabbit review config: English locale, assertive review profile, incremental reviews, path filters, path-specific validation rules, label rules, enabled tools (shellcheck, gitleaks, markdownlint, eslint), chat auto-replies, and local-only knowledge.
Agent frontmatter updates
agents/.../*.md
Unified tool-name updates in agent frontmatter: search_filessearch_file_content; replace_in_filereplace where present; selective addition of MCP Slack tool entries in some agents. Changes are metadata-only in frontmatter.
Documentation — mappings & guides
CONTRIBUTING.md, docs/en/agents/README.md, docs/en/contributing/SKILL-PLACEMENT-POLICY.md, docs/en/contributing/TERMINOLOGY.md, docs/ko-KR/contributing/README.md, docs/ko-KR/contributing/SKILL-PLACEMENT-POLICY.md, docs/ko-KR/contributing/TERMINOLOGY.md
Updated Claude Code → Gemini CLI tool mappings: Edit: replace (was replace_in_file) and Grep: search_file_content (was search_files); added google_web_search mapping in one locale file. Documentation-only edits.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

breaking, agents, docs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the primary change: correcting invalid Gemini CLI tool names across agent files and documentation.
Linked Issues check ✅ Passed The PR directly addresses issue #34 by replacing invalid tool names (search_files→search_file_content, replace_in_file→replace) across 18 agents and related documentation to restore agent loading functionality.
Out of Scope Changes check ✅ Passed All changes directly support fixing the agent loading error. The .coderabbit.yaml configuration and documentation updates for tool-name mappings are necessary supporting changes within scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-invalid-tool-names

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@agents/docs-lookup.md`:
- Line 4: The frontmatter tools array contains non-allowlisted MCP tool names
(mcp__context7__resolve-library-id and mcp__context7__query-docs) which must be
removed; update the tools array in agents/docs-lookup.md to include only
built-in Gemini CLI tool names (e.g., keep "read_file" and "search_file_content"
and remove the mcp__... entries) so the agent frontmatter complies with the
built-in-only rule and will pass startup validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: eaf098ce-e7d2-48b3-9517-b825a455a7ed

📥 Commits

Reviewing files that changed from the base of the PR and between a3b6eab and b6ed0ff.

📒 Files selected for processing (45)
  • .coderabbit.yaml
  • CONTRIBUTING.md
  • agents/architect.md
  • agents/chief-of-staff.md
  • agents/code-architect.md
  • agents/code-explorer.md
  • agents/code-reviewer.md
  • agents/code-simplifier.md
  • agents/comment-analyzer.md
  • agents/conversation-analyzer.md
  • agents/cpp-build-resolver.md
  • agents/cpp-reviewer.md
  • agents/csharp-reviewer.md
  • agents/dart-build-resolver.md
  • agents/docs-lookup.md
  • agents/flutter-reviewer.md
  • agents/gan-evaluator.md
  • agents/gan-generator.md
  • agents/gan-planner.md
  • agents/harness-optimizer.md
  • agents/healthcare-reviewer.md
  • agents/java-build-resolver.md
  • agents/java-reviewer.md
  • agents/kotlin-build-resolver.md
  • agents/kotlin-reviewer.md
  • agents/loop-operator.md
  • agents/opensource-forker.md
  • agents/opensource-packager.md
  • agents/opensource-sanitizer.md
  • agents/performance-optimizer.md
  • agents/planner.md
  • agents/pr-test-analyzer.md
  • agents/pytorch-build-resolver.md
  • agents/rust-build-resolver.md
  • agents/rust-reviewer.md
  • agents/seo-specialist.md
  • agents/silent-failure-hunter.md
  • agents/type-design-analyzer.md
  • agents/typescript-reviewer.md
  • docs/en/agents/README.md
  • docs/en/contributing/SKILL-PLACEMENT-POLICY.md
  • docs/en/contributing/TERMINOLOGY.md
  • docs/ko-KR/contributing/README.md
  • docs/ko-KR/contributing/SKILL-PLACEMENT-POLICY.md
  • docs/ko-KR/contributing/TERMINOLOGY.md

Comment thread agents/docs-lookup.md
- chief-of-staff: add missing Slack MCP tools to frontmatter `tools:`
  array so the agent can actually call them at runtime
- docs/ko-KR TERMINOLOGY: add WebSearch → google_web_search row to
  match the English version
- .coderabbit.yaml: loosen agent `tools:` rule to allow MCP tools
  (mcp__<server>__<tool>) alongside built-ins, and flag body-referenced
  MCP tools that are missing from the frontmatter declaration
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.coderabbit.yaml:
- Around line 57-58: The "Skill definitions" guidance is ambiguous about where
the "When to Use" / "Ideal For" sections should live; update the
.coderabbit.yaml text under the "Skill definitions" block so it explicitly
states that frontmatter must include `name` and `description`, while the "When
to Use" / "Ideal For" explanatory sections should appear in the document body
(not frontmatter) and be specific and actionable; reference the existing `name`
and `description` frontmatter requirements and the literal section headings
"When to Use" / "Ideal For" so readers know exactly where to place them.
- Around line 66-67: Update the shell script guidance line that currently reads
"Shell scripts must use `set -e`, quote all variables, and avoid interpolating
shell variables into `node -e` strings" to recommend also enabling `set -u` and
`set -o pipefail`; specifically, change the guidance text to include `set -u`
(error on undefined variables) and `set -o pipefail` (fail on pipeline errors)
so scripts are required to use `set -e`, `set -u`, `set -o pipefail`, quote all
variables, and avoid interpolating shell variables into `node -e` strings (use
`process.env` instead).
- Line 45: The documented MCP tool naming pattern is incorrect: replace the
double-underscore pattern `mcp__<server>__<tool_name>` with the correct
single-underscore pattern `mcp_<server>_<tool_name>` so generated tool names
match the Gemini CLI/Gemini API regex; update the string in the documentation
entry that references the MCP naming pattern to use `mcp_<server>_<tool_name>`
everywhere it appears (so discovery output will validate).
- Around line 42-44: Update the Gemini CLI tool list by removing the deprecated
tools "replace" and "save_memory", replace the legacy alias
"search_file_content" with "grep_search", and expand the list to exactly:
read_file, read_many_files, write_file, glob, list_directory, run_shell_command,
web_fetch, google_web_search, grep_search, ask_user, write_todos,
get_internal_docs, activate_skill, enter_plan_mode; edit the string/list that
currently contains read_file,...,replace,save_memory (as shown in the diff) to
match the new set and then verify the final list against the official Gemini CLI
tools reference to ensure no additional tools are missing or misnamed.

In `@agents/chief-of-staff.md`:
- Line 4: The frontmatter tools array is missing the Slack MCP tool used by the
agent body: add "mcp__slack__conversations_add_message" to the tools list in
agents/chief-of-staff.md so the referenced conversations_add_message action
(mentioned in the body) can be invoked at runtime; ensure the exact identifier
mcp__slack__conversations_add_message is added alongside the existing
mcp__slack__... entries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 10278338-2199-4539-bfce-806d2a7d8e7e

📥 Commits

Reviewing files that changed from the base of the PR and between b6ed0ff and 674dc6f.

📒 Files selected for processing (3)
  • .coderabbit.yaml
  • agents/chief-of-staff.md
  • docs/ko-KR/contributing/TERMINOLOGY.md

Comment thread .coderabbit.yaml
Comment thread .coderabbit.yaml
Comment thread .coderabbit.yaml Outdated
Comment thread .coderabbit.yaml Outdated
Comment thread agents/chief-of-staff.md Outdated
- chief-of-staff: declare `mcp__slack__conversations_add_message` in
  frontmatter; it is referenced in the body at line 102 (send action)
  and would otherwise be unavailable at runtime
- .coderabbit.yaml: clarify that skill "When to Use"/"Ideal For" sections
  live in the document body (not frontmatter); tighten shell-script
  guidance to `set -euo pipefail`

Not changed (disputed):
- MCP tool naming convention remains `mcp__<server>__<tool>` (double
  underscore) — matches existing usage across chief-of-staff, docs-lookup,
  and gan-evaluator; single-underscore variant would break all current
  agents
- `replace` and `save_memory` kept in the built-in allow-list — this
  PR itself proves `replace` is valid (it is the fix for #34); the
  CodeRabbit web-search result claiming they are deprecated is
  inconsistent with the Gemini CLI version this repo targets
@Jamkris Jamkris merged commit 6856236 into main Apr 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent loading error

1 participant