Skip to content

Fix MCP tool detection from toolNames.json#192

Merged
rajbos merged 3 commits intomainfrom
copilot/rebase-changes-from-pr-187
Feb 8, 2026
Merged

Fix MCP tool detection from toolNames.json#192
rajbos merged 3 commits intomainfrom
copilot/rebase-changes-from-pr-187

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

MCP tools in toolNames.json (e.g., mcp.io.github.git.assign_copilot_to_issue, mcp_io_github_git_pull_request_read) were misclassified as regular tool calls, causing incorrect statistics in usage analysis and file viewer.

Changes

Added detection logic

  • isMcpTool(): Identifies MCP tools by mcp. or mcp_ prefix
  • extractMcpServerName(): Extracts server identifier from tool name (e.g., mcp.io.github.toolio)

Updated tool processing (4 locations)

  • JSONL event processing (CLI format)
  • JSON response processing (VS Code format)
  • Log viewer turn extraction
  • extractResponseData() helper
// Before: All tools counted as regular tool calls
if (event.type === 'tool.call') {
  analysis.toolCalls.total++;
  analysis.toolCalls.byTool[toolName] = ...;
}

// After: MCP tools routed to MCP statistics
if (this.isMcpTool(toolName)) {
  analysis.mcpTools.total++;
  const serverName = this.extractMcpServerName(toolName);
  analysis.mcpTools.byServer[serverName] = ...;
  analysis.mcpTools.byTool[toolName] = ...;
} else {
  analysis.toolCalls.total++;
  analysis.toolCalls.byTool[toolName] = ...;
}

MCP tools now appear correctly in MCP-specific statistics and UI sections instead of being mixed with regular tool calls.

Original prompt

Look at the proposed changes in #187, and recreate them in a new PR. We ran into so many merge conflicts that we need to rebase instead


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 8, 2026 20:09
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Rebase changes from pull request 187 Fix MCP tool detection from toolNames.json Feb 8, 2026
Copilot AI requested a review from rajbos February 8, 2026 20:12
@rajbos rajbos marked this pull request as ready for review February 8, 2026 20:16
@rajbos rajbos merged commit f1674e6 into main Feb 8, 2026
13 checks passed
@rajbos rajbos deleted the copilot/rebase-changes-from-pr-187 branch February 8, 2026 20:22
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.

2 participants

Comments