Skip to content

Commit 63483ef

Browse files
authored
Merge branch 'main' into dependabot/github_actions/minor-and-patch-updates-e415389c79
2 parents 0d42889 + a5e03ef commit 63483ef

8 files changed

Lines changed: 291 additions & 17 deletions

File tree

.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

.github/scripts/package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"scrape": "node scrape-models.js"
1010
},
1111
"dependencies": {
12-
"puppeteer": "^24.38.0"
12+
"puppeteer": "^24.39.0"
1313
}
1414
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Check Toolnames in Issue
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
# Checks each tool name in the issue body against src/toolNames.json on main
12+
# and posts a comment with the status of each one.
13+
check-toolnames:
14+
runs-on: ubuntu-latest
15+
if: github.event.label.name == 'Toolnames checkup'
16+
permissions:
17+
issues: write
18+
contents: read
19+
steps:
20+
- name: Harden the runner (Audit all outbound calls)
21+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
22+
with:
23+
egress-policy: audit
24+
25+
- name: Checkout main branch
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
ref: main
29+
30+
- name: Check toolnames and post comment
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
ISSUE_BODY: ${{ github.event.issue.body }}
34+
ISSUE_NUMBER: ${{ github.event.issue.number }}
35+
REPO: ${{ github.repository }}
36+
RUN_ID: ${{ github.run_id }}
37+
SERVER_URL: ${{ github.server_url }}
38+
run: |
39+
echo "=== Checking toolnames and building comment ==="
40+
41+
python3 - << 'PYEOF'
42+
import json
43+
import os
44+
import re
45+
import sys
46+
47+
issue_body = os.environ.get("ISSUE_BODY", "")
48+
issue_number = os.environ.get("ISSUE_NUMBER", "")
49+
repo = os.environ.get("REPO", "")
50+
run_id = os.environ.get("RUN_ID", "")
51+
server_url = os.environ.get("SERVER_URL", "https://github.com")
52+
53+
COMMENT_FILE = "/tmp/toolnames-comment.md"
54+
MAX_BODY_LEN = 100_000 # guard against extremely large issue bodies
55+
56+
# Truncate untrusted input to prevent resource exhaustion
57+
if len(issue_body) > MAX_BODY_LEN:
58+
issue_body = issue_body[:MAX_BODY_LEN]
59+
print("Warning: issue body was truncated to 100 KB", file=sys.stderr)
60+
61+
# Extract backtick-wrapped strings and filter to plausible tool-name shapes
62+
# (no path separators or spaces; reasonable length). This avoids matching
63+
# inline-code snippets like `src/toolNames.json` or prose code examples.
64+
raw_matches = re.findall(r'`([^`\n]+)`', issue_body)
65+
tools = sorted(set(
66+
m for m in raw_matches
67+
if "/" not in m and " " not in m and len(m) <= 128
68+
))
69+
print(f"Found {len(tools)} candidate tool name(s): {tools}", file=sys.stderr)
70+
71+
if not tools:
72+
print("No candidate tool names found in issue body. Skipping.", file=sys.stderr)
73+
with open(COMMENT_FILE, "w") as f:
74+
f.write("## 🔍 Toolnames Checkup\n\n_No candidate tool names (backtick-wrapped identifiers without path separators) were found in the issue body._\n")
75+
else:
76+
with open("src/toolNames.json", "r") as f:
77+
known_tools = json.load(f)
78+
79+
already_added = []
80+
needs_adding = []
81+
82+
for tool in tools:
83+
if tool in known_tools:
84+
already_added.append((tool, known_tools[tool]))
85+
else:
86+
needs_adding.append(tool)
87+
88+
lines = ["## 🔍 Toolnames Checkup", ""]
89+
lines.append("Checked the tool names in this issue against `src/toolNames.json` on the `main` branch:")
90+
lines.append("")
91+
92+
if already_added:
93+
lines.append("### ✅ Already mapped")
94+
lines.append("")
95+
lines.append("| Tool Name | Friendly Name |")
96+
lines.append("| --- | --- |")
97+
for tool, friendly in already_added:
98+
lines.append(f"| `{tool}` | {friendly} |")
99+
lines.append("")
100+
101+
if needs_adding:
102+
lines.append("### ❌ Not yet in `toolNames.json`")
103+
lines.append("")
104+
lines.append("| Tool Name |")
105+
lines.append("| --- |")
106+
for tool in needs_adding:
107+
lines.append(f"| `{tool}` |")
108+
lines.append("")
109+
110+
if already_added and not needs_adding:
111+
lines.append("> **All tool names in this issue are already mapped.** This issue may be a duplicate — consider closing it.")
112+
elif needs_adding:
113+
lines.append(f"> **{len(needs_adding)} tool name(s) still need to be added.** Please use the `tool-names` custom agent or update `src/toolNames.json` manually.")
114+
115+
lines.append("")
116+
lines.append(f"_Workflow run: {server_url}/{repo}/actions/runs/{run_id}_")
117+
118+
comment_body = "\n".join(lines)
119+
with open(COMMENT_FILE, "w") as f:
120+
f.write(comment_body)
121+
print("=== Comment preview ===", file=sys.stderr)
122+
print(comment_body, file=sys.stderr)
123+
PYEOF
124+
125+
echo "=== Posting comment to issue #${ISSUE_NUMBER} ==="
126+
gh issue comment "$ISSUE_NUMBER" \
127+
--repo "$REPO" \
128+
--body-file /tmp/toolnames-comment.md
129+
130+
echo "✅ Comment posted successfully"

.github/workflows/prompts/sync-models-prompt.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Update `src/tokenEstimators.json` and `src/modelPricing.json` with missing model
1515
- Add it to the appropriate JSON file(s)
1616
- Use sensible defaults based on existing similar models
1717

18+
> **IMPORTANT**: Only add models that are **explicitly listed** on the documentation page above. Do NOT add models based on your own knowledge of AI models, third-party sources, or speculation about what models might exist. If a model is not present on that specific documentation page, it must not be added.
19+
1820
## Token Estimators (`src/tokenEstimators.json`)
1921

2022
For missing models in tokenEstimators.json:
@@ -53,7 +55,7 @@ For missing models in modelPricing.json:
5355
- **ONLY** update `lastUpdated` field in `src/modelPricing.json` to today's date (YYYY-MM-DD format) **if you added new models to the pricing file**
5456
- If no models were added, do NOT update the `lastUpdated` field
5557
- Do NOT modify the `sources` section unless you have specific pricing data
56-
- Do not make up new model names. If they are not in any of the lists in the documentation, then we do not add them to the json
58+
- Do NOT add models that are not explicitly listed on the documentation page — if a model is not on that page, skip it entirely
5759

5860
## Output Format
5961

@@ -64,6 +66,7 @@ For missing models in modelPricing.json:
6466

6567
## Constraints
6668

69+
- **Only add models that appear on the GitHub Copilot supported models documentation page** (`https://docs.github.com/en/copilot/reference/ai-models/supported-models`). Do NOT add models from any other source, from your own training knowledge, or that you believe might exist — only what is explicitly listed on that page.
6770
- Only modify `src/tokenEstimators.json` and `src/modelPricing.json`
6871
- Do not open a PR (the workflow will handle that)
6972
- Preserve all existing entries and formatting conventions

src/modelPricing.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"description": "Model pricing data - costs per million tokens for input and output",
44
"metadata": {
5-
"lastUpdated": "2026-03-02",
5+
"lastUpdated": "2026-03-09",
66
"sources": [
77
{
88
"name": "OpenAI API Pricing",
@@ -115,6 +115,13 @@
115115
"tier": "premium",
116116
"multiplier": 1
117117
},
118+
"gpt-5.4": {
119+
"inputCostPerMillion": 0.00,
120+
"outputCostPerMillion": 0.00,
121+
"category": "GPT-5 models",
122+
"tier": "premium",
123+
"multiplier": 1
124+
},
118125
"gpt-4": {
119126
"inputCostPerMillion": 3.0,
120127
"outputCostPerMillion": 12.0,

src/tokenEstimators.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"gpt-5.2-codex": 0.25,
2121
"gpt-5.2-pro": 0.25,
2222
"gpt-5.3-codex": 0.25,
23+
"gpt-5.4": 0.25,
2324
"gpt-4.1-nano": 0.25,
2425
"gemini-2.0-flash": 0.25,
2526
"gemini-2.0-flash-lite": 0.25,

0 commit comments

Comments
 (0)