MCPcopy Create free account
hub / github.com/github/gh-aw / formatMcpName

Function formatMcpName

actions/setup/js/log_parser_shared.cjs:215–226  ·  view source on GitHub ↗

* Formats MCP tool name from internal format to display format * @param {string} toolName - The raw tool name (e.g., mcp__github__search_issues) * @returns {string} Formatted tool name (e.g., github::search_issues)

(toolName)

Source from the content-addressed store, hash-verified

213 * @returns {string} Formatted tool name (e.g., github::search_issues)
214 */
215function formatMcpName(toolName) {
216 // Convert mcp__github__search_issues to github::search_issues
217 if (toolName.startsWith("mcp__")) {
218 const parts = toolName.split("__");
219 if (parts.length >= 3) {
220 const provider = parts[1]; // github, etc.
221 const method = parts.slice(2).join("_"); // search_issues, etc.
222 return `${provider}::${method}`;
223 }
224 }
225 return toolName;
226}
227
228/**
229 * Checks if a tool name looks like a custom agent (kebab-case with multiple words)

Callers 5

formatToolUseFunction · 0.85
appendToolExecutionLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected