Skip to content

Commit ec02202

Browse files
authored
Merge pull request #380 from rajbos/copilot/add-custom-agent-for-tool-handling
Add tool-names agent definition for MCP tool name mapping
2 parents d71678f + 75dc925 commit ec02202

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

.github/agents/tool-names.agent.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
description: "Add friendly display names for unknown MCP and VS Code tools detected in session logs. Handles tool name mapping in src/toolNames.json."
3+
name: "Tool Names - Add Missing Friendly Names"
4+
tools: ["execute/runInTerminal", "execute/getTerminalOutput", "search/codebase", "read/problems"]
5+
---
6+
7+
# Tool Names - Add Missing Friendly Names
8+
9+
Resolve issues that report unknown/missing tool display names by adding entries to `src/toolNames.json`. This agent understands MCP (Model Context Protocol) server naming conventions and can research tool origins.
10+
11+
## When to Use This Agent
12+
13+
Trigger this agent when:
14+
- An issue reports unknown or missing friendly tool names (title like "Add missing friendly names for tools")
15+
- New MCP tools appear in user session logs without display labels
16+
- The sync-toolnames workflow detects new upstream tools from `microsoft/vscode-copilot-chat`
17+
18+
## Key File
19+
20+
**`src/toolNames.json`** — The single mapping file from raw tool identifiers to human-readable display names. Every tool the extension encounters gets looked up here; missing entries show as "Unknown" in the UI.
21+
22+
## MCP Tool Name Conventions
23+
24+
MCP tools follow predictable naming patterns. The raw tool identifier encodes the MCP server origin and the action:
25+
26+
### Prefix Patterns (raw identifier → display prefix)
27+
28+
| Raw Prefix | Display Prefix | Source Repository |
29+
|---|---|---|
30+
| `mcp.io.github.git.` or `mcp_io_github_git_` | `GitHub MCP (Local):` | [github/github-mcp-server](https://github.com/github/github-mcp-server) |
31+
| `mcp_github_github_` | `GitHub MCP (Remote):` | [github/github-mcp-server](https://github.com/github/github-mcp-server) |
32+
| `mcp_github-code-s_` | `GitHub MCP (Code Scanning):` | [github/github-mcp-server](https://github.com/github/github-mcp-server) |
33+
| `mcp_com_microsoft_` | `GitHub MCP:` | Microsoft internal MCP server |
34+
| `mcp_gitkraken_` | `GitKraken MCP:` | GitKraken (no public MCP server repo; tools come from the GitKraken VS Code extension) |
35+
| `mcp_oraios_serena_` | `Serena:` | [oraios/serena](https://github.com/oraios/serena) |
36+
| `mcp_microsoft_pla_` | `Playwright MCP:` | [microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) |
37+
| `mcp_io_github_ups_` | `Context7 MCP:` | [upstash/context7](https://github.com/upstash/context7) |
38+
39+
### How to Generate a Friendly Name
40+
41+
1. **Identify the prefix** — match the raw tool name against the prefix table above.
42+
2. **Extract the action** — remove the prefix to get the action part (e.g., `mcp_io_github_git_search_code``search_code`).
43+
3. **Format the action** — replace `_`, `-`, `.` with spaces, split camelCase, then Title Case each word.
44+
4. **Preserve acronyms** — keep these in ALL CAPS: `VSCODE`, `MCP`, `GITHUB`, `API`, `URL`, `JSON`, `HTTP`, `HTTPS`, `CLI`, `UI`, `IO`, `ID`.
45+
5. **Combine**`"<Display Prefix> <Formatted Action>"`.
46+
47+
### Examples
48+
49+
```
50+
mcp_io_github_git_search_code → "GitHub MCP (Local): Search Code"
51+
mcp_github_github_issue_read → "GitHub MCP (Remote): Issue Read"
52+
mcp_github-code-s_list_code_scanning_alerts → "GitHub MCP (Code Scanning): List Alerts"
53+
mcp_gitkraken_git_status → "GitKraken MCP: Git Status"
54+
mcp_oraios_serena_find_symbol → "Serena: Find Symbol"
55+
mcp_microsoft_pla_browser_navigate → "Playwright MCP: Browser Navigate"
56+
mcp_io_github_ups_resolve-library-id → "Context7 MCP: Resolve Library ID"
57+
```
58+
59+
### Non-MCP Tools
60+
61+
Tools without an `mcp.` or `mcp_` prefix are VS Code built-in or Copilot tools. Use plain Title Case without a server prefix:
62+
63+
```
64+
run_in_terminal → "Run In Terminal"
65+
copilot_readFile → "Read File"
66+
setup.agent → "Setup Agent"
67+
bash → "Bash"
68+
grep → "Grep"
69+
```
70+
71+
Copilot-prefixed tools (`copilot_*`) typically drop the prefix in the friendly name for brevity.
72+
73+
## Researching Unknown MCP Servers
74+
75+
When you encounter an MCP tool with an **unfamiliar prefix** that does not match the table above:
76+
77+
1. **Search GitHub** for the MCP server's source repository:
78+
- Search for repos with topic `mcp-server` matching keywords from the prefix
79+
- Check https://github.com/github/github-mcp-server for the official GitHub MCP Server tools reference
80+
- Check https://github.com/punkpeye/awesome-mcp-servers for a curated community list
81+
- Search `modelcontextprotocol` org repos: https://github.com/modelcontextprotocol
82+
2. **Inspect the server's tool definitions** — MCP servers typically expose tool names via a manifest or handler registration. Look for files like `server.json`, tool handler source files, or README documentation.
83+
3. **Derive the display prefix** — use the server's product/project name (e.g., "Serena", "GitKraken MCP", "Context7 MCP").
84+
4. **Add the new prefix pattern** to this document's table for future reference.
85+
86+
### Well-Known MCP Server Repositories
87+
88+
Use these repos to look up tool definitions when needed:
89+
90+
| Server | Repository | Language | Tools File / Path |
91+
|---|---|---|---|
92+
| GitHub MCP Server | [github/github-mcp-server](https://github.com/github/github-mcp-server) | Go | `pkg/github/*.go` (each file exposes tools for a domain: issues, PRs, repos, search, actions, code scanning, etc.) |
93+
| Playwright MCP | [microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) | TypeScript | Browser automation tools |
94+
| Serena | [oraios/serena](https://github.com/oraios/serena) | Python | Semantic code editing and symbol navigation |
95+
| Context7 | [upstash/context7](https://github.com/upstash/context7) | TypeScript | Library documentation retrieval |
96+
| Chrome DevTools MCP | [ChromeDevTools/chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp) | TypeScript | Browser debugging tools |
97+
98+
## Editing `src/toolNames.json`
99+
100+
### Style Rules
101+
102+
- Use leading comma style: `,"new_tool": "Friendly Name"`
103+
- Group related tools together (same MCP server prefix, same tool category)
104+
- Insert new MCP entries near existing entries with the same prefix
105+
- Insert new non-MCP entries alphabetically or near logically related tools
106+
- Never remove existing entries
107+
108+
### Validation
109+
110+
After editing `src/toolNames.json`:
111+
112+
1. Run `npm run compile` to verify ESLint + build passes
113+
2. Ensure the JSON is valid (no trailing commas, proper quoting)
114+
3. Run tests with `npm run test:node` to confirm nothing is broken
115+
116+
## Upstream Sync Reference
117+
118+
The `sync-toolnames` workflow (`.github/workflows/sync-toolnames.yml`) automatically syncs tool IDs from `microsoft/vscode-copilot-chat` using the prompt at `.github/workflows/prompts/sync-toolnames-prompt.md`. This covers VS Code built-in and Copilot tools. MCP tool names from user sessions are **not** covered by this sync and must be added manually via issues.
119+
120+
## Checklist
121+
122+
- [ ] Identify all unknown tool names from the issue
123+
- [ ] Determine if each tool is MCP or non-MCP
124+
- [ ] For MCP tools, match the prefix to a known server or research the source
125+
- [ ] Generate friendly names following the conventions above
126+
- [ ] Add entries to `src/toolNames.json` in the correct location
127+
- [ ] Run `npm run compile` to validate
128+
- [ ] Run `npm run test:node` to confirm tests pass

0 commit comments

Comments
 (0)