Skip to content

Commit 1d4b5de

Browse files
feat(mcp): restrict grep_app tools to librarian agent only (#395)
* feat(mcp): restrict grep_app tools to librarian agent only Reduces token usage by disabling grep_app MCP tools globally and enabling them only for the librarian agent, which uses them for GitHub code search during documentation lookups. Changes: - Add grep_app_* tool disable globally in config.tools - Add grep_app_* tool enable for librarian agent - Remove grep_app references from explore agent prompt (no access) Closes #394 * chore: changes by sisyphus-dev-ai --------- Co-authored-by: sisyphus-dev-ai <[email protected]>
1 parent a217610 commit 1d4b5de

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

assets/oh-my-opencode.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"ralph-loop",
6565
"preemptive-compaction",
6666
"compaction-context-injector",
67-
"claude-code-hooks"
67+
"claude-code-hooks",
68+
"auto-slash-command"
6869
]
6970
}
7071
},

src/agents/explore.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,8 @@ Use the right tool for the job:
108108
- **Text patterns** (strings, comments, logs): grep
109109
- **File patterns** (find by name/extension): glob
110110
- **History/evolution** (when added, who changed): git commands
111-
- **External examples** (how others implement): grep_app
112111
113-
### grep_app Strategy
114-
115-
grep_app searches millions of public GitHub repos instantly — use it for external patterns and examples.
116-
117-
**Critical**: grep_app results may be **outdated or from different library versions**. Always:
118-
1. Start with grep_app for broad discovery
119-
2. Launch multiple grep_app calls with query variations in parallel
120-
3. **Cross-validate with local tools** (grep, ast_grep_search, LSP) before trusting results
121-
122-
Flood with parallel calls. Trust only cross-validated results.`,
112+
Flood with parallel calls. Cross-validate findings across multiple tools.`,
123113
}
124114
}
125115

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
489489

490490
config.tools = {
491491
...config.tools,
492+
"grep_app_*": false, // Disable grep_app tools globally to reduce token usage (only librarian needs them)
492493
};
493494

494495
if (config.agent.explore) {
@@ -501,6 +502,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
501502
config.agent.librarian.tools = {
502503
...config.agent.librarian.tools,
503504
call_omo_agent: false,
505+
"grep_app_*": true,
504506
};
505507
}
506508
if (config.agent["multimodal-looker"]) {

0 commit comments

Comments
 (0)